code wiki / (root) / nx_id_param_gate.nx

nx_id_param_gate.nx

buildroot/runtime/nx_id_param_gate.nx

26059 B459 linesdepth 5pulls 7 transitivereach 0 importersview sourcekind gate/prooftopic id
docsdependenciesstructsconstsfunctions

about

nx_id_param_gate.nx -- THE IDENTITY-PARAMETER CORE AND ITS FIRST CONSUMER, GATED. /compare/procgen C36 (id_param_core) and C33 (gn_palette_sample). Subjects: nx_id_param_core, nx_id_palette. WHAT MAKES THIS GATE NON-VACUOUS. A "correlated sampler" is the easiest thing in the world to fake: return the master for every axis and every correlation is perfect. So the teeth here are the properties the WRONG implementations provably cannot all satisfy at once, and BOTH wrong implementations are kept RUNNABLE in the subject rather than described in a comment: * the INCUMBENT (independent uniform draws, loading 0) -> dies at T3, T6 * a COLLAPSED palette (every axis IS the master) -> dies at T7, keeps T3/T6 -- which is exactly why T7 has to exist * a correlation bought by narrowing the spread -> dies at T4 * loadings that drifted from their ledger -> dies at T8 T6 IS THE LOAD-BEARING TOOTH AND ITS BAR IS NOT A CONSTANT. A one-factor model predicts every PAIRWISE correlation from the two loadings alone -- corr(a,b) = load_a*load_b/UNIT -- a non-obvious three-way prediction nothing but that structure produces. It is measured with a real Pearson estimator over the whole cast, against a bar DERIVED from the declared loadings. THE TOLERANCE IS DERIVED, NOT PICKED. The standard error of a Pearson r is about (1-r^2)/sqrt(n). At n=512 and the weakest declared pair (r=0.45) that is ~35 permil, so IPG_CORR_TOL=60 leaves under 2x headroom -- enough for sampling noise and integer rounding, not enough to admit a different model. Stated so a later reader can tighten it against a bigger cast rather than guess. license_tier: ORIGINAL expect_exit: 0 No hw writes (Rule 26).

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_id_param_core.nx nx_id_palette.nx nx_id_param_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_id_param_core.nxnx_id_palette.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main gv_ctr sys_mmap nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ gv_head gv_puts sys_write ↻ sys_mmap ↻ idp_master idp_centered idp_unit idp_stream idp_avalanche gn_hash3 gn_mix gn_palette_sample idp_master ↻ idp_to_span idp_fan idp_centered ↻ idp_isqrt gn_palette_load gn_palette_sample_uncorrel idp_to_span ↻ idp_fan ↻ gn_palette_sample_collapse idp_master ↻

structs

none

consts

30const IPG_N: i64 = 4096 // cast size. The denominator of every rate printed below.
31const IPG_CORR_TOL: i64 = 60 // permil; derived above from the estimator's own standard error
41const IPG_SPREAD_TOL: i64 = 50
45const IPG_CLAMP_CEIL: i64 = 200
46const IPG_SEED0: i64 = 20260828
47const IPG_BUF: i64 = 256
48const IPG_CONF_A: *u8 = "knowledge/id_palette.conf"
49const IPG_CONF_B: *u8 = "buildroot/knowledge/id_palette.conf"
50const IPG_RGB_PACK: i64 = 256
81const IPG_KAT_0S: i64 = 781
82const IPG_KAT_0H: i64 = 1000
83const IPG_KAT_0E: i64 = 508
84const IPG_KAT_1S: i64 = 642
85const IPG_KAT_1H: i64 = 658
86const IPG_KAT_1E: i64 = 133
87const IPG_KAT_2S: i64 = 730
88const IPG_KAT_2H: i64 = 1000
89const IPG_KAT_2E: i64 = 890

functions

52func ipg_abs(v: i64) -> i64 { if v < 0 { return 0 - v } return v }
53func ipg_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: main
54func ipg_find(hay: *u8, hn: i64, ndl: *u8, nn: i64) -> i64
called by 1: main
70func ipg_corr_wrong(measured: i64, declared: i64) -> i64
called by 1: main calls 1: ipg_abs
76func ipg_pair_pred(la: i64, lb: i64) -> i64 { return la * lb / IDP_UNIT }
called by 1: main
90func ipg_kat(k: i64, ax: i64) -> i64
called by 1: main
107func ipg_not_independent(c: i64) -> i64
called by 1: main calls 1: ipg_abs
114func ipg_collapsed(all_equal: i64) -> i64
called by 1: main
119func ipg_loss_permil(sp: i64, sp0: i64) -> i64
called by 1: main calls 1: ipg_abs
127func ipg_alt_loss_permil(w: i64) -> i64
called by 1: main calls 1: idp_isqrt
133func main() -> i64