code wiki / (root) / nx_planepeek_gate.nx

nx_planepeek_gate.nx

buildroot/runtime/nx_planepeek_gate.nx

16087 B272 linesdepth 5pulls 7 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_planepeek_gate.nx -- THE REFEREE FOR nx_planepeek's FALSE-ABSENCE FIX (debt 1787282525). WHAT IS UNDER TEST. v1 of nx_planepeek printed one word -- MISS -- for five distinguishable conditions, and that word is a NEGATIVE ASSERTION about a plane. It was quoted as proof of absence in a build-refusal message and nearly produced a filed defect against a healthy lane. The fix gives every condition its own word and its own exit code, and prints the coverage each verdict was computed from. THIS GATE PROVES THE SEPARATION IS REAL, IN BOTH DIRECTIONS. WHY IT IS END-TO-END. The defect is in what the ORGAN PRINTS AND EXITS WITH, not in a pure function, so the only honest subject is the built ELF. It is forked with tr_run_capture (the one proven subprocess primitive) and judged on exit code AND emitted bytes. ★A GREEN THAT NEVER HAD A CORRESPONDING RED IS UNVERIFIED, so the decisive teeth are gv_bite pairs: the same organ must FIRE on the broken fixture and stay SILENT on the healthy one. Two tests that each isolate one signal do not prove discrimination between them. ★A READER THAT MISSES EVERYTHING WOULD PASS EVERY ABSENCE TEST -- hence the POSITIVE CONTROL (tooth 2/3): a key that IS present must be found, with its bytes. Without it, an organ that returned MISS unconditionally would score full marks on this gate. ★ASSERT THE FIXTURE REACHED THE CONDITION BEFORE ASSERTING THE OUTCOME: tooth 1 refuses to believe any verdict until the subject has actually run and reported scanning segments>0. FIXTURES ARE ASSEMBLED AT RUNTIME under /tmp/<gate>/ (never the production knowledge/store tree: a gate sharing a fixture with a production beat reports on the FIXTURE, not the code) and the setup is IDEMPOTENT -- every artifact is unlinked before it is written, because a gate that is not idempotent reports on its first run and lies about every run after. license_tier: ORIGINAL Read-only outside /tmp. No hw writes (Rule 26).

dependencies 4 imports · 0 importers

nx_gate_verdict.nx nx_seg_store.nx nx_tool_run.nx nx_syscalls.nx nx_planepeek_gate.nx

imports: nx_gate_verdict.nxnx_seg_store.nxnx_tool_run.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main gv_head gv_puts sys_write 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 ↻ sys_mkdir pg_rm sys_mmap ↻ pg_path ss_cat sys_unlinkat sys_munmap sys_mmap ↻ pg_path ↻ pg_build_plane ss_begin ss_begin_cap sys_mmap ↻ sys_mmap ↻ pg_row ss_cat ↻ ss_add ss_add2 ss_w32 ss_len

structs

none

consts

34const PG_DIRMODE: i64 = 493
40const PG_OUTCAP: i64 = 65536
43const PG_KIND_PUT: i64 = 1
44const PG_KIND_TOMB: i64 = 2
47const PG_EX_HIT: i64 = 0
48const PG_EX_MISS: i64 = 1
49const PG_EX_UNPROVEN: i64 = 3
50const PG_EX_NOPLANE: i64 = 4
51const PG_EX_TOMBSTONED: i64 = 5
52const PG_EX_NOTAKEY: i64 = 6
54const PG_PATHCAP: i64 = 512
58const PG_TAB: i64 = 9
61const PG_SEG_A: i64 = 1
62const PG_SEG_B: i64 = 2

functions

64func pg_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: pg_has
68func pg_eq(a: i64, b: i64) -> i64 { if a == b { return 1 } return 0 }
called by 1: main
69func pg_lt(a: i64, b: i64) -> i64 { if a < b { return 1 } return 0 }
called by 1: main
70func pg_gt0(a: i64) -> i64 { if a > 0 { return 1 } return 0 }
called by 1: main
71func pg_not(a: i64) -> i64 { if a == 0 { return 1 } return 0 }
called by 1: main
74func pg_has(hay: *u8, haylen: i64, needle: *u8) -> i64 {
called by 1: main calls 1: pg_len
90func pg_path(dir: *u8, name: *u8, out: *u8) -> i64 {
called by 2: pg_rmmain calls 1: ss_cat
97func pg_exists(path: *u8) -> i64 {
104func pg_rm(dir: *u8, name: *u8) -> i64 {
117func pg_row(out: *u8, c0: *u8, c1: *u8, c2: *u8) -> i64 {
called by 1: pg_build_plane calls 1: ss_cat
127func pg_build_plane(prefix: *u8) -> i64 {
147func pg_try_subject(cand: *u8, out: *u8) -> i64 {
called by 1: pg_subject calls 2: pg_existsss_cat
153func pg_subject(out: *u8) -> i64 {
called by 1: main calls 1: pg_try_subject
161func pg_run(subj: *u8, prefix: *u8, key: *u8, out: *u8, outlen: *i64) -> i64 {
called by 1: main calls 2: sys_mmaptr_run_capture
170func main(argc: i64, argv: *i64) -> i64 {