code wiki / _hdl_build / nx_parity_judge.nx

nx_parity_judge.nx

buildroot/runtime/_hdl_build/nx_parity_judge.nx

7931 B169 linesdepth 9pulls 12 transitivereach 1 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_parity_judge.nx -- THE ORGAN EYE (operator 2026-07-16: "this workflow isnt complete until you see the exact same issues i see without your or my involvement"). Given (oracle.png, nishi.png) of the SAME page, it autonomously reports the failure classes a human eyeball found on the top-20 suite -- so the suite self-diagnoses every run with NO human/Claude in the loop: BLANK-NISHI nishi has almost no ink while the oracle has plenty (google: blank page scored 97.3% parity by matching white space -- THE metric hole this organ closes) STRIP-COLLAPSE nishi's ink is squeezed into a narrow vertical band (bing/netflix: 1-char-per-line column collapse from a near-zero-width container) CANVAS-OFF the two sides disagree about the page background color (hackernews: dark canvas vs beige) SPARSE-NISHI nishi paints real ink but a fraction of the oracle's (missing bg-images/sections) CONTENT-OK ink mass + spread comparable -- grade quality by the parity numbers Ink = pixels differing from that side's own dominant background (corner-sampled) by > tol. usage: nx_parity_judge <oracle.png> <nishi.png> [nishi_y_offset] (offset skips the browser chrome bar) license_tier: ORIGINAL

dependencies 1 imports · 1 importers

nx_visual_diff.nx nx_parity_judge.nx nx_parity_judge_gate.nx

imports: nx_visual_diff.nx

imported by: nx_parity_judge_gate.nx

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

main rj_w vd_load sys_mmap 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 ↻ _png_a7_expected _png_a7_col0 _png_a7_coli _png_a7_row0 _png_a7_rowi nx_zlib_inflate sys_mmap ↻ nx_deflate_inflate sys_mmap ↻ nx_bitstream_alloc sys_mmap ↻ _deflate_inflate_block nx_bitstream_read_lsb nx_bitstream_byte_align nx_bitstream_read_byte_ali _deflate_build_static_litl _deflate_build_static_dist _deflate_decode_huffman_bl sys_mmap ↻

structs

none

consts

16const K_MAGIC_4096: i64 = 4096

functions

18func rj_w(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 2: rj_classifymain
19func rj_n(v: i64) -> i64 { let t: *u8=sys_mmap(24); var m: i64=v; if m<0{sys_write(1,"-" as *u8,1);m=0-m} var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} let b: *u8=sys_mmap(24); var j: i64=0; while j<k{b[j]=t[k-1-j];j=j+1} sys_write(1,b,k); return 0 }
called by 1: rj_classify
20func rj_atoi(s: *u8) -> i64 { var v: i64=0; var i: i64=0; while s[i]!=(0 as u8){ let c: i64=(s[i] as i64)&255; if c>=48 { if c<=57 { v=v*10+(c-48) } } i=i+1 } return v }
called by 1: main
23func rj_bg(im: *VdImg, yoff: i64, out: *i64) -> i64
called by 1: rj_classify
60func rj_ink(im: *VdImg, yoff: i64, bg: *i64, tol: i64, cols: *i64, out: *i64) -> i64
called by 1: rj_classify
115func rj_classify(a: *VdImg, b: *VdImg, byoff: i64) -> i64
called by 2: maing_case calls 4: rj_bgrj_inkrj_wrj_n
158func main(argc: i64, argv: *i64) -> i64