code wiki / _hdl_build / nx_brand_snap_gate.nx

nx_brand_snap_gate.nx

buildroot/runtime/_hdl_build/nx_brand_snap_gate.nx

3192 B51 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind gate/prooftopic brand
docsdependenciesstructsconstsfunctions

about

nx_brand_snap_gate.nx -- grid snapping + alignment guides. 100% sovereign. expect_exit: 0 MIGRATED 2026-07-31 onto nx_gate_verdict (D001, ws=gate-dry-d001) in the MINIMAL form -- the shape a mechanical applier can generate. Deliberately NOT a full rewrite: t_row and every check row are left EXACTLY as they were, so the PASS/FAIL vector is unchanged by construction. The only thing replaced is the hand-rolled verdict tail, which is precisely the debt D001 names ("gates roll their own verdict"). The gate's own tot[] counters are handed straight to gv_verdict, so the ecosystem's ONE judge now sees this gate in the canonical "NX-<NAME> passed p/t verdict=..." shape instead of a bespoke line that happened to read "VERDICT=verdict=GREEN". WHY MINIMAL IS THE RIGHT FIRST RUNG: it is mechanically generatable across the ~950 gates that share this counter idiom, it cannot change the check vector, and it still collects the payoff -- canonical verdict shape today, and the gv_journal harness outcome frame for free on trees whose base class has it. Full gv_check adoption is a later, optional rung; it is not required to eat the debt.

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_brand_snap.nx nx_gate_verdict.nx nx_brand_snap_gate.nx

imports: nx_syscalls.nxnx_brand_snap.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 sys_mmap gw sys_write bs_snap t_row gw ↻ bs_aligned bs_snap_place bs_snap ↻ gn sys_mmap ↻ sys_write ↻ gv_ctr sys_mmap ↻ gv_verdict gv_puts sys_write ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap gv_journal sys_openat_append sys_mmap ↻ gv_catn sys_mmap ↻ sys_munmap ↻ sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real gv_cat sys_write ↻ sys_close sys_munmap ↻

structs

none

consts

none

functions

18func 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 2: t_rowmain calls 1: sys_write
19func gn(v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(1,"-" as *u8,1)} let t: *u8=sys_mmap(28); 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} var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1} sys_write(1,bb,k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
20func t_row(name: *u8, ok: i64, tot: *i64) -> i64
called by 1: main calls 1: gw
25func main() -> i64