code wiki / _hdl_build / nx_refbench_gate.nx

nx_refbench_gate.nx

buildroot/runtime/_hdl_build/nx_refbench_gate.nx

8954 B171 linesdepth 9pulls 24 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

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 2 imports · 0 importers

nx_refbench_lib.nx nx_gate_verdict.nx nx_refbench_gate.nx

imports: nx_refbench_lib.nxnx_gate_verdict.nx

imported by: nobody (leaf or entry point)

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

main gw g_make rb_compare nx_phash_downscale rb_wrap nx_image_alloc 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 nxa_dump_sizes nx_ssim_mean_image_q10 _ssim_local_q10 sys_mmap ↻ _ssim_window_stats nx_image_get nx_phash_dhash nx_phash_downscale ↻ nx_simhash_hamming nx_bits_popcount64_soft gn rb_retention nx_phash_downscale ↻ g_corrupt g_rnd rb_load_gray nx_png_decode sys_mmap ↻ _png_check_signature _png_read_u32_be nx_crc32

structs

none

consts

60const RB_LCG_MULT: i64 = 6364136223846793005
61const RB_LCG_INC: i64 = 1442695040888963407
64const RB_GATE_SEED: i64 = 12345

functions

25func 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
26func gn(v: i64) -> i64
called by 1: main
42func g_make(side: i64) -> *u8
called by 1: main
67func g_rnd(st: *i64) -> i64
called by 1: g_corrupt
75func g_corrupt(src: *u8, side: i64, pct: i64, seed: i64) -> *u8
called by 1: main calls 1: g_rnd
88func main() -> i64