code wiki / _hdl_build / nx_gate_bite.nx
nx_gate_bite.nx
buildroot/runtime/_hdl_build/nx_gate_bite.nx
about
nx_gate_bite.nx -- NON-VACUITY BY MUTATION. Answers the one question a green gate cannot answer about
itself: CAN THIS GATE EVER FAIL? Closes debt seq1344; the two-operator design closes seq1413.
REWRITTEN (rule 3, not patched a fourth time). The first version accumulated four corrections in one
session -- an anchor-blind judge, a vacuity overclaim, uncounted invalid mutants, and a single operator.
Each was a real defect and the accumulation was the signal to rewrite rather than keep patching.
THE METHOD (mutation testing, the 2026 field standard): perturb the SOURCE the gate is supposed to be
judging, rebuild, and require the gate to go RED. Killing ONE mutant proves the gate bites; we stop at
the first kill because the question is binary, not a score.
★★TWO OPERATORS, ESCALATED -- because ONE OPERATOR CANNOT REACH EVERY ASSERTION SURFACE.
phase 1 COMPARISON (`==` -> `!=`): reaches logic. Kills nx_raci_gate, nx_medbill_{nsa,codes,recon,civic}.
phase 2 LITERAL (flip a letter inside a copy string): reaches OUTPUT. MEASURED: nx_healthhelp_site_gate
asserts on rendered page TEXT (tone phrases, absence of "fight"/"arsenal"), so a comparison flip in a
path that does not change emitted copy is a survivor BY CONSTRUCTION -- not a hollow gate. A
single-operator harness makes every text-asserting gate permanently unprovable and would slander all
of them. The operator must be chosen by what the gate ASSERTS ON, so we try both before concluding.
★A MUTANT THAT DOES NOT COMPILE IS NOT A KILL. nx_sov_build_run RUNS the gate as its final step, so a
non-zero build exit means EITHER the gate went RED (real kill) OR the source failed to compile (proves
only that I broke the code). Counting the second as the first would let this organ certify non-vacuity it
never observed -- the `green>=1` overclaim rebuilt inside the tool built to catch it.
★NO KILL IS NOT PROOF OF VACUITY. Killing one mutant proves a gate CAN fail; failing to kill N proves
only that those N perturbations did not reach its assertions. INCONCLUSIVE is the honest word.
★THE JUDGE IS DIALECT-TOLERANT. Gates do not all speak one form: nx_medbill_nsa_gate ends
`ADV3 ...: GREEN` with NO `verdict=` anchor. Reading "anchor absent" as "not green" made an earlier build
of this organ report a 21/21 gate as broken -- an instrument reporting its own blindness as the subject's
defect. Prefer the verdict line; fall back to the exit code; always print which judge decided.
FAIL-SAFE BY CONSTRUCTION (rule 26 spirit): pristine bytes held before the first mutation, the mutation
window is the narrowest possible (mutate -> build -> RESTORE -> only then judge), the restore is
byte-verified, and the organ REFUSES to exit 0 if it cannot prove the restore.
usage: nx_gate_bite <gate_target> <source.nx> [max_sites] [aim <func> <skip> | aimlist <func>] (CWD = nxc2 root)
AIMED MODE (2026-08-03, debt 1785779063): mutation testing has THREE axes -- assertion strength, fixture
coverage, and SITE REACHABILITY. Position-picked sites in a large shared subject land in guards, early
helpers and sibling codecs the gate never executes, and A TOOTH CANNOT KILL A MUTANT THAT NEVER EXECUTES.
dependencies 5 imports · 0 importers
imports: nx_syscalls.nxnx_gate_green.nxnx_sha256.nxnx_artifact_root.nxnx_guarded_run.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 56 | const GB_MAGIC_4096: i64 = 4096 |
| 57 | const GB_MAGIC_1024: i64 = 1024 |
| 59 | const GB_MAXSRC: i64 = 4194304 |
| 60 | const GB_DEF_SITES: i64 = 4 |
| 81 | const GB_MUTANT_DEADLINE_MS: i64 = 120000 |
functions
| 88 | func w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 89 | func wn(v: i64) -> i64 { let t: *u8=sys_mmap(28); var m: i64=v; 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(28); var i: i64=0; while i<k{b[i]=t[k-1-i];i=i+1} sys_write(1,b,k); return 0 } |
| 91 | func gb_read(path: *u8, buf: *u8, cap: i64) -> i64 called by 5: gb_load_deadlinegb_load_gate_srcgb_out_hasgb_greenmain calls 3: sys_openat_rdsys_readsys_close |
| 103 | func gb_write(path: *u8, buf: *u8, n: i64) -> i64 |
| 113 | func gb_load_deadline(target: *u8) -> i64 |
| 144 | func gb_in_comment(b: *u8, p: i64) -> i64 |
| 172 | func gb_site_cmp(b: *u8, n: i64, k: i64) -> i64 |
| 211 | func gb_site_num(b: *u8, n: i64, k: i64) -> i64 |
| 251 | func gb_find(hay: *u8, hn: i64, ned: *u8, nl: i64) -> i64 |
| 265 | func gb_load_gate_src(target: *u8) -> i64 |
| 299 | func gb_ident_ch(c: i64) -> i64 called by 1: gb_gate_call |
| 316 | func gb_cmp_flip(b: *u8, off: i64) -> i64 called by 1: main |
| 320 | func gb_cmp_at(b: *u8, n: i64, from: i64) -> i64 |
| 348 | func gb_num_at(b: *u8, n: i64, from: i64) -> i64 |
| 377 | func gb_aim_find(name: *u8) -> i64 |
| 401 | func gb_gate_call(k: i64, out: *u8, cap: i64) -> i64 |
| 434 | func gb_needle_audit(b: *u8, n: i64) -> i64 |
| 494 | func gb_site_needle(b: *u8, n: i64, k: i64) -> i64 |
| 559 | func gb_site_lit(b: *u8, n: i64, k: i64) -> i64 |
| 595 | func gb_build() -> i64 |
| 656 | func gb_out_has(needle: *u8) -> i64 |
| 668 | func gb_rungate() -> i64 |
| 712 | func gb_green(rc: i64) -> i64 |
| 726 | func gb_try(off: i64, newbyte: i64) -> i64 |
| 764 | func main(argc: i64, argv: *i64) -> i64 |