code wiki / _hdl_build / nx_frame_sanity.nx

nx_frame_sanity.nx

buildroot/runtime/_hdl_build/nx_frame_sanity.nx

5776 B124 linesdepth 2pulls 2 transitivereach 9 importersview sourcekind librarytopic frame
docsdependenciesstructsconstsfunctions

about

nx_frame_sanity.nx -- EXPERIENTIAL frame verifier: mechanizes the eyeball for rendered RGB frames. WHY: three Gx framing bugs (pure-sky win frame, camera buried in hillside, 50.4% blown-white) each passed every numeric gate tooth and were caught ONLY by a human eyeball (rule 5). vqoe's probe835 taught the same lesson for video (median GREEN while 100% of frames never decoded). This lib gives every gate a cheap composable tooth: "does this frame LOOK like a scene a player would accept?" Metrics (all integer, deterministic, RGB24 caller fb like nx_swgpu/nx_gamehud): [0] blown_permil -- pixels clipped to near-white (the tonemap-missing class) [1] black_permil -- pixels near-black (the void/underexposed class) [2] edge_permil -- luminance-step density (detail present at all; pure sky scores ~0) [3] cedge_permil -- edge density in the CENTER THIRD (framing: the subject belongs mid-frame; a sky-stare or floor-stare has its detail off-center or absent) [4] flat_permil -- horizontal-run flatness (px == right neighbor); gradient skies are flat fs_verdict applies DATA-DRIVEN thresholds (caller-supplied; keep them in a conf, rule 11). HONEST RESIDUAL: cannot judge SEMANTICS (is that the right building?) -- it kills the gross framing classes only; the realism-loop critic stays the fidelity judge. LIB, no main. license_tier: ORIGINAL

dependencies 1 imports · 5 importers

nx_syscalls.nx nx_frame_sanity.nx nx_frame_sanity_gate.nx nx_gx7_game_gate.nx nx_wire_diablo2_gate.nx nx_wire_endlesssky_gate.nx nx_wire_harness.nx

imports: nx_syscalls.nx

imported by: nx_frame_sanity_gate.nxnx_gx7_game_gate.nxnx_wire_diablo2_gate.nxnx_wire_endlesssky_gate.nxnx_wire_harness.nx

structs

none

consts

18const FS_NMETRIC: i64 = 5
19const FS_M_BLOWN: i64 = 0
20const FS_M_BLACK: i64 = 1
21const FS_M_EDGE: i64 = 2
22const FS_M_CEDGE: i64 = 3
23const FS_M_FLAT: i64 = 4

functions

25func fs_lum(fb: *u8, o: i64) -> i64
called by 1: fs_score
31func fs_score(fb: *u8, w: i64, h: i64, out: *i64) -> i64
called by 2: fs_score_i64main calls 1: fs_lum
86func fs_score_i64(fb: *i64, w: i64, h: i64, out: *i64) -> i64
103func fs_verdict(out: *i64, th: *i64) -> i64
117func fs_default_th(th: *i64) -> i64