code wiki / _hdl_build / nx_parity_judge.nx
nx_parity_judge.nx
buildroot/runtime/_hdl_build/nx_parity_judge.nx
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
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
structs
| none |
consts
| 16 | const K_MAGIC_4096: i64 = 4096 |
functions
| 18 | func 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 } |
| 19 | func 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 |
| 20 | func 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 |
| 23 | func rj_bg(im: *VdImg, yoff: i64, out: *i64) -> i64 called by 1: rj_classify |
| 60 | func rj_ink(im: *VdImg, yoff: i64, bg: *i64, tol: i64, cols: *i64, out: *i64) -> i64 called by 1: rj_classify |
| 115 | func rj_classify(a: *VdImg, b: *VdImg, byoff: i64) -> i64 |
| 158 | func main(argc: i64, argv: *i64) -> i64 |