code wiki / _hdl_build / nx_page_verify_gate.nx

nx_page_verify_gate.nx

buildroot/runtime/_hdl_build/nx_page_verify_gate.nx

24771 B323 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind gate/prooftopic page
docsdependenciesstructsconstsfunctions

about

nx_page_verify_gate.nx -- proves the browser-grade page verifier END-TO-END on the REAL edge: the fixed /render3d page must be GREEN (exit 0), and the PERMANENT negctl fixture (sites/nishifamily/render3d/negctl.html: a .png that answers HTML + a relative ref) must be RED with EXACTLY 2 broken -- the two classes that caused the 2026-07-16 "the pngs are broken" incident. If the negctl leg ever passes, the verifier lost its teeth. D001-MIGRATED 2026-08-18 onto nx_gate_verdict (per-tooth gv_check, exit carries the verdict, census- readable). SUBJECT = the DEPLOYED verifier at its absolute nishihost path (the binary the estate actually runs; the old /tmp subject was volatile and could silently test a stale or absent build). license_tier: ORIGINAL expect_exit: 0

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_tool_run.nx nx_page_verify_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_tool_run.nx

imported by: nobody (leaf or entry point)

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

main gv_ctr sys_mmap nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ gv_head gv_puts sys_write ↻ run1 sys_mmap ↻ run2cap sys_mmap ↻ pvg_dirname tr_run_capture_cwd tr_run_capture_core tr_run_capture_core_owned tr_run_capture_core_eviden hw sys_write ↻ pn sys_mmap ↻ sys_write ↻ gv_check gv_puts ↻ sys_mmap ↻ run2cap ↻ pvg_dirname ↻ pvg_write_bighead

structs

none

consts

20const PVG_EXIT_GREEN: i64 = 0
21const PVG_EXIT_RED: i64 = 1
22const PVG_EXIT_UNOBSERVABLE: i64 = 3
23const PVG_EXIT_EXEC_MISSING: i64 = 127
29const PVG_CLOSED_PORT_OVERRIDE: *u8 = "127.0.0.1:9"
30const PVG_CAPTURE_CAP: i64 = 262144
31const PVG_ARGV_SLOTS: i64 = 8
32const PVG_WORD_BYTES: i64 = 8
45const PVG_BIGHEAD_BYTES: i64 = 10758232 // sites/nishifamily/world/ref9d.nxa, nx_fs size exact=1, 2026-09-05
46const PVG_BIGHEAD_MAGIC_PATH: *u8 = "sites/nishifamily/render3d/negctl_bighead_magic.nxa"
47const PVG_BIGHEAD_NOMAGIC_PATH: *u8 = "sites/nishifamily/render3d/negctl_bighead_nomagic.nxa"
48const PVG_BIGHEAD_MAGIC_PAGE: *u8 = "sites/nishifamily/render3d/negctl_bighead.html"
49const PVG_BIGHEAD_NOMAGIC_PAGE: *u8 = "sites/nishifamily/render3d/negctl_bighead_nomagic.html"
50const PVG_SEEK_SET: i64 = 0
51const PVG_SEEK_END: i64 = 2
52const PVG_NXA_MAGIC_LEN: i64 = 8 // NXANIM01, owned by nx_nxa.nx
59const PVG_PATH_SEP: i64 = 47 // '/'
60const PVG_ABSPATH_CAP: i64 = 4096 // one absolute fixture path
152const PVG_CWD_CAP: i64 = 4096
153const PVG_NO_TIMEOUT: i64 = 0 // tr_run_capture_cwd: <=0 delegates to the unbounded capture (explicit opt-out contract)
154const PVG_SLASH: i64 = 47

functions

61func pvg_abs(rel: *u8) -> *u8
75func pvg_file_size(rel: *u8) -> i64
85func pvg_write_bighead(rel: *u8, head: *u8) -> i64
99func pvg_write_page(rel: *u8, body: *u8) -> i64
110func hw(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 calls 1: sys_write
118func pvg_has(b: *u8, n: i64, lit: *u8) -> i64
called by 1: main
134func pvg_last_line_starts(b: *u8, n: i64, lit: *u8) -> i64
155func pvg_dirname(path: *u8, out: *u8) -> i64
called by 2: run2capmain
167func run2cap(elf: *u8, a1: *u8, a2: *u8, out: *u8, olen: *i64) -> i64
175func pn(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: main calls 2: sys_mmapsys_write
181func run1(elf: *u8, a1: *u8) -> i64
called by 1: main calls 2: sys_mmaprun2cap
186func run2(elf: *u8, a1: *u8, a2: *u8) -> i64
calls 2: sys_mmaprun2cap
192func main() -> i64