code wiki / (root) / nx_capres_gate.nx

nx_capres_gate.nx

buildroot/runtime/nx_capres_gate.nx

14349 B308 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_capres_gate.nx -- THE GATE FOR THE CAPTURE-RESOLUTION RULER (subject: nx_capres / nx_capres_lib). WHAT IT PROVES, AND WHY EACH TOOTH EXISTS: * the ruler READS a resolution out of a real capture header rather than assuming one (PNG + NXFH1) * a capture below its subject's declared full resolution is REFUSED, not rounded up * a judge whose ceiling sits below the capture is reported BLIND -- that is NO score, not a low one * every "I could not look" path abstains (UNPROVEN) instead of acquitting * the shipped conf actually declares the subject the world lane depends on, and declares it ONCE * the CLI's EXIT CODE carries the verdict, checked by forking the real binary THE REQUIRED NEGATIVE CONTROL is neg-control-downsampled-capture-must-not-verdict-FULL: the whole policy is worthless if a reduced capture can pass, so a tooth asserts that it CANNOT. It is paired with a bite cell (fires on the reduced input, silent on the full one), because a detector that has only ever seen good input has not been shown to fire. FIXTURES ARE ASSEMBLED AT RUNTIME in /tmp/, never checked in and never under knowledge/store: a gate that shares a fixture with a production beat measures the fixture, and a detector that scans source will find its own fixture written as a literal. license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_capres_lib.nx nx_capres_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_capres_lib.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 ↻ sys_mmap ↻ cr_conf_res sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close cr_num_at sys_munmap ↻ gv_check gv_puts ↻ cr_conf_count sys_mmap ↻ sys_read_file ↻ cg_write_png sys_mmap ↻ cg_u32be

structs

none

consts

24const CG_MODE_644: i64 = 420
25const CG_FIX_PNG: *u8 = "/tmp/nx_capres_gate_full.png" as *u8
26const CG_FIX_PNG_SMALL: *u8 = "/tmp/nx_capres_gate_small.png" as *u8
27const CG_FIX_NXFH: *u8 = "/tmp/nx_capres_gate_frame.nxfh" as *u8
28const CG_FIX_JUNK: *u8 = "/tmp/nx_capres_gate_junk.bin" as *u8
29const CG_ELF: *u8 = "./nx_capres.elf" as *u8
30const CG_SUBJECT: *u8 = "world" as *u8
31const CG_OUT_BYTES: i64 = 64
32const CG_FIXBUF: i64 = 256
33const CG_JUNK_LEN: i64 = 64
34const CG_JUNK_FILL: i64 = 90 // an ASCII letter: junk that is plainly neither PNG nor NXFH1
35const CG_IHDR_LEN: i64 = 13 // RFC 2083: IHDR carries exactly 13 bytes
36const CG_U32: i64 = 4
37const CG_BYTE_BASE: i64 = 256
43const CG_SMALL_DIV: i64 = 8 // q=8 -- the value nx_world_snap was MEASURED landing on

functions

45func cg_u32be(b: *u8, off: i64, v: i64) -> i64
called by 1: cg_write_png
57func cg_write_png(path: *u8, w: i64, h: i64) -> i64
82func cg_num_into(b: *u8, o: i64, v: i64) -> i64
called by 1: cg_write_nxfh calls 2: sys_mmapsys_munmap
95func cg_write_nxfh(path: *u8, w: i64, h: i64) -> i64
118func cg_write_junk(path: *u8) -> i64
132func cg_present(rc: i64) -> i64
called by 1: main
139func cg_run3(elf: *u8, a1: *u8, a2: *u8, a3: *u8) -> i64
159func main(argc: i64, argv: *i64) -> i64