code wiki / _hdl_build / nx_refbench_gate.nx
nx_refbench_gate.nx
buildroot/runtime/_hdl_build/nx_refbench_gate.nx
about
nx_refbench_gate.nx -- proves the reference-retention ruler is a RULER and not a rubber stamp.
It imports the SAME lib the shipping tool imports, so it grades the code that ships.
T1 IDENTITY : an image against ITSELF must score 1000 on BOTH channels.
T2 DISCRIMINATION : a MIRRORED copy (identical histogram, different structure) must score
materially LOWER. This is the anti-vacuity tooth -- a ruler that has never
been seen to say NO is not a ruler.
T3 SCALE INVARIANCE: the same content at a DIFFERENT SIZE must still score high. This is the
real production case (2550x3300 reference vs 768x1024 render); if it failed,
every retention number would be measuring resolution, not content.
T4 MONOTONICITY : increasing corruption must produce MONOTONICALLY FALLING retention. The
whole L3 denoise curve is worthless if the ruler does not ORDER correctly --
this tooth is what licenses reading the curve as a curve.
T5 MIN-HEADLINE : retention must equal the WEAKEST channel, never the mean. Proven with a
planted split (strong one side, weak the other) so a good channel can never
flatter a bad one.
T6 FAIL-CLOSED : an unreadable/absent image must return an ERROR, never a score. Two failed
decodes must NOT both become zeroed planes and score a perfect 1000 against
each other -- the blank-decoy trap that already fooled an artifact tooth in
this ecosystem (a failing producer wrote a valid PNG of an empty render).
expect_exit: 0 license_tier: ORIGINAL
dependencies 1 imports · 0 importers
imports: nx_refbench_lib.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
| 59 | const RB_LCG_MULT: i64 = 6364136223846793005 |
| 60 | const RB_LCG_INC: i64 = 1442695040888963407 |
| 63 | const RB_GATE_SEED: i64 = 12345 |
functions
| 24 | func gw(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } called by 1: main |
| 25 | func gn(v: i64) -> i64 called by 1: main |
| 41 | func g_make(side: i64) -> *u8 called by 1: main |
| 66 | func g_rnd(st: *i64) -> i64 called by 1: g_corrupt |
| 74 | func g_corrupt(src: *u8, side: i64, pct: i64, seed: i64) -> *u8 |
| 87 | func main() -> i64 |