nx_id_param_gate.nx
buildroot/runtime/nx_id_param_gate.nx
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
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
structs
| none |
consts
| 30 | const IPG_N: i64 = 4096 // cast size. The denominator of every rate printed below. |
| 31 | const IPG_CORR_TOL: i64 = 60 // permil; derived above from the estimator's own standard error |
| 41 | const IPG_SPREAD_TOL: i64 = 50 |
| 45 | const IPG_CLAMP_CEIL: i64 = 200 |
| 46 | const IPG_SEED0: i64 = 20260828 |
| 47 | const IPG_BUF: i64 = 256 |
| 48 | const IPG_CONF_A: *u8 = "knowledge/id_palette.conf" |
| 49 | const IPG_CONF_B: *u8 = "buildroot/knowledge/id_palette.conf" |
| 50 | const IPG_RGB_PACK: i64 = 256 |
| 81 | const IPG_KAT_0S: i64 = 781 |
| 82 | const IPG_KAT_0H: i64 = 1000 |
| 83 | const IPG_KAT_0E: i64 = 508 |
| 84 | const IPG_KAT_1S: i64 = 642 |
| 85 | const IPG_KAT_1H: i64 = 658 |
| 86 | const IPG_KAT_1E: i64 = 133 |
| 87 | const IPG_KAT_2S: i64 = 730 |
| 88 | const IPG_KAT_2H: i64 = 1000 |
| 89 | const IPG_KAT_2E: i64 = 890 |
functions
| 52 | func ipg_abs(v: i64) -> i64 { if v < 0 { return 0 - v } return v } |
| 53 | func ipg_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } called by 1: main |
| 54 | func ipg_find(hay: *u8, hn: i64, ndl: *u8, nn: i64) -> i64 called by 1: main |
| 70 | func ipg_corr_wrong(measured: i64, declared: i64) -> i64 |
| 76 | func ipg_pair_pred(la: i64, lb: i64) -> i64 { return la * lb / IDP_UNIT } called by 1: main |
| 90 | func ipg_kat(k: i64, ax: i64) -> i64 called by 1: main |
| 107 | func ipg_not_independent(c: i64) -> i64 |
| 114 | func ipg_collapsed(all_equal: i64) -> i64 called by 1: main |
| 119 | func ipg_loss_permil(sp: i64, sp0: i64) -> i64 |
| 127 | func ipg_alt_loss_permil(w: i64) -> i64 |
| 133 | func main() -> i64 |