code wiki / _hdl_build / nx_refbench_gate.nx

nx_refbench_gate.nx

buildroot/runtime/_hdl_build/nx_refbench_gate.nx

8638 B169 linesdepth 9pulls 23 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 1 imports · 0 importers

nx_refbench_lib.nx nx_refbench_gate.nx

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

main gw g_make rb_compare nx_phash_downscale rb_wrap nx_image_alloc sys_mmap 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 sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close nx_png_decode sys_mmap ↻ _png_check_signature _png_read_u32_be nx_crc32 nx_crc32_update nx_crc32_init nx_crc32_table_at _png_n_channels _png_bytes_per_pixel _png_n_channels ↻

structs

none

consts

59const RB_LCG_MULT: i64 = 6364136223846793005
60const RB_LCG_INC: i64 = 1442695040888963407
63const RB_GATE_SEED: i64 = 12345

functions

24func 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
25func gn(v: i64) -> i64
called by 1: main
41func g_make(side: i64) -> *u8
called by 1: main
66func g_rnd(st: *i64) -> i64
called by 1: g_corrupt
74func g_corrupt(src: *u8, side: i64, pct: i64, seed: i64) -> *u8
called by 1: main calls 1: g_rnd
87func main() -> i64