code wiki / (root) / nx_gate_bite_gate.nx

nx_gate_bite_gate.nx

buildroot/runtime/nx_gate_bite_gate.nx

14934 B249 linesdepth 5pulls 8 transitivereach 0 importersview sourcekind gate/prooftopic gate
docsdependenciesstructsconstsfunctions

about

nx_gate_bite_gate.nx -- THE GATE FOR THE MUTATION HARNESS ITSELF (2026-08-25). SUBJECT: the nx_gate_bite ELF, forked for real against a fixture .nx written into a fresh run directory (/tmp/nx_gate_bite_gate/r<usec>/), so this gate is idempotent by construction and nothing it measures was inherited from an earlier run. Substitutable: argv[1] overrides the subject path -- which is exactly the addressing nx_gate_bite's own `subject <target>` mode requires of the gates it bites, so this gate can be bitten by the very capability it proves. WHY THESE TEETH. nx_gate_bite gained a `subject <subject_target>` argument on 2026-08-25 because without it the harness ALWAYS rebuilt the GATE and never the SUBJECT. For the 152 end-to-end gates in the estate that meant every mutant returned NOT-REACHED, and a bite of the gate's own source returned a clean verdict=GREEN that reads exactly like a subject proof and is not one. MEASURED before the fix on nx_communitypulse_gate: 10 mutants, 10 NOT-REACHED, valid_mutants=0. After: valid_mutants=1, killed=1. So this gate holds the NEW grammar to its documented shape and holds the OLD grammar unchanged. EVERY INVOCATION HERE IS BUILD-FREE ON PURPOSE. `aimlist` mutates nothing and builds nothing, and both refusals fire before the baseline build, so this gate runs in milliseconds and can sit on the roster: A GATE THAT OUTLIVES EVERY CALLER'S TIMEOUT IS INDISTINGUISHABLE FROM A GATE THAT EMITS NOTHING. The gate target passed below DELIBERATELY DOES NOT EXIST -- if any of these paths ever started building, this gate would fail loudly here instead of silently costing the roster minutes. license_tier: ORIGINAL

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_gate_green.nx nx_tool_run.nx nx_gate_bite_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_gate_green.nxnx_tool_run.nx

imported by: nobody (leaf or entry point)

structs

none

consts

28const GBG_SUBJECT_DEFAULT: *u8 = "_offc/nx_gate_bite.elf"
29const GBG_DIR: *u8 = "/tmp/nx_gate_bite_gate"
30const GBG_MODE_DIR: i64 = 493 // 0755
31const GBG_CAP: i64 = 262144
32const GBG_PATH_CAP: i64 = 512
33const GBG_ARGV_SLOTS: i64 = 16
34const GBG_WORD: i64 = 8 // sizeof(i64)
35const GBG_LP_BYTES: i64 = 16 // two i64 slots for the capture length out-param
36const GBG_NUM_BYTES: i64 = 32
37const GBG_ASCII_ZERO: i64 = 48
38const GBG_DECIMAL: i64 = 10
39const GBG_DEC_LAST: i64 = 9
42const GBG_RUN_TIMEOUT_MS: i64 = 60000
43const GBG_EXIT_OK: i64 = 0
44const GBG_EXIT_USAGE: i64 = 2
45const GBG_EXIT_AIM_ABSENT: i64 = 4
46const GBG_SITES_ARG: *u8 = "4"
48const GBG_FIX_LEAF: *u8 = "nx_gbfixture.nx"
49const GBG_FIX_TARGET: *u8 = "nx_gbfixture"
50const GBG_FIX_FUNC: *u8 = "gbf_pick"
51const GBG_ABSENT_FUNC: *u8 = "gbf_no_such_function"
52const GBG_WRONG_TARGET: *u8 = "nx_not_the_fixture"
53const GBG_FAKE_GATE: *u8 = "nx_gate_bite_gate_absent_probe"
54const GBG_FIXTURE_TEXT: *u8 = "// fixture for nx_gate_bite_gate -- the numeric sites below are DELIBERATE.\nfunc gbf_pick(a: i64) -> i64 {\n if a > 37 { return 4211 }\n if a > 11 { return 909 }\n return 5\n}\nfunc gbf_other(b: i64) -> i64 { return b + 77 }\n"
55const GBG_MARK_SITES: *u8 = "total_numeric_sites="
56const GBG_MARK_SUBJ: *u8 = "subject_target="
57const GBG_MARK_MISMATCH: *u8 = "NOTE subject-source-is-not-the-target"
58const GBG_MARK_USAGE: *u8 = "usage: nx_gate_bite"
59const GBG_MARK_GRAMMAR: *u8 = "[subject <subject_target>]"
60const GBG_MARK_AIMABSENT: *u8 = "AIM-ABSENT"

functions

65func gbg_cat(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { dst[off + i] = s[i]; i = i + 1 } return off + i }
66func gbg_catn(dst: *u8, off: i64, v: i64) -> i64
76func gbg_path(dir: *u8, leaf: *u8) -> *u8
84func gbg_write_text(path: *u8, s: *u8) -> i64
94func gbg_nil() -> *u8 { return 0 as *u8 }
98func gbg_run(subject: *u8, a1: *u8, a2: *u8, a3: *u8, a4: *u8, a5: *u8, a6: *u8, a7: *u8) -> i64
113func gbg_has(needle: *u8) -> i64 { return tr_contains(gbg_cap_g, gbg_len_g[0], needle) }
118func gbg_num_after(needle: *u8) -> i64
140func main(argc: i64, argv: *i64) -> i64