code wiki / _hdl_build / nx_gate_bite.nx

nx_gate_bite.nx

buildroot/runtime/_hdl_build/nx_gate_bite.nx

62091 B1197 linesdepth 5pulls 9 transitivereach 0 importersview sourcekind tooltopic gate
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_gate_green.nx nx_sha256.nx nx_artifact_root.nx nx_guarded_run.nx nx_gate_bite.nx

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

main w sys_write sys_exit gb_load_deadline sys_mmap gb_read sys_openat_rd sys_read sys_close sys_mmap ↻ ar_resolve ar_resolve_with ar_exists sys_openat_rd ↻ sys_close ↻ sys_mmap ↻ ar_read sys_openat_rd ↻ sys_read ↻ sys_close ↻ wn sys_mmap ↻ sys_write ↻ gb_read ↻ gb_aim_find sys_mmap ↻ gb_find gb_num_at gb_in_comment gb_build sys_fork sys_openat_wr sys_dup3 sys_mmap ↻ ar_resolve ↻ sys_chdir sys_mmap ↻ sys_execve sys_exit ↻

structs

none

consts

56const GB_MAGIC_4096: i64 = 4096
57const GB_MAGIC_1024: i64 = 1024
59const GB_MAXSRC: i64 = 4194304
60const GB_DEF_SITES: i64 = 4
81const GB_MUTANT_DEADLINE_MS: i64 = 120000

functions

88func w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
89func 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 }
91func gb_read(path: *u8, buf: *u8, cap: i64) -> i64
103func gb_write(path: *u8, buf: *u8, n: i64) -> i64
113func gb_load_deadline(target: *u8) -> i64
called by 1: main calls 2: sys_mmapgb_read
144func gb_in_comment(b: *u8, p: i64) -> i64
172func gb_site_cmp(b: *u8, n: i64, k: i64) -> i64
called by 1: main calls 1: gb_in_comment
211func gb_site_num(b: *u8, n: i64, k: i64) -> i64
called by 1: main calls 1: gb_in_comment
251func gb_find(hay: *u8, hn: i64, ned: *u8, nl: i64) -> i64
265func gb_load_gate_src(target: *u8) -> i64
called by 1: main calls 3: sys_mmapar_resolvegb_read
299func gb_ident_ch(c: i64) -> i64
called by 1: gb_gate_call
316func gb_cmp_flip(b: *u8, off: i64) -> i64
called by 1: main
320func gb_cmp_at(b: *u8, n: i64, from: i64) -> i64
called by 1: main calls 1: gb_in_comment
348func gb_num_at(b: *u8, n: i64, from: i64) -> i64
called by 1: main calls 1: gb_in_comment
377func gb_aim_find(name: *u8) -> i64
called by 1: main calls 2: sys_mmapgb_find
401func gb_gate_call(k: i64, out: *u8, cap: i64) -> i64
called by 1: main calls 1: gb_ident_ch
434func gb_needle_audit(b: *u8, n: i64) -> i64
called by 1: main calls 4: sys_mmapgb_findwwn
494func gb_site_needle(b: *u8, n: i64, k: i64) -> i64
called by 1: main calls 2: sys_mmapgb_find
559func gb_site_lit(b: *u8, n: i64, k: i64) -> i64
called by 1: main calls 1: gb_in_comment
595func gb_build() -> i64
656func gb_out_has(needle: *u8) -> i64
called by 1: gb_try calls 3: sys_mmapgb_readgg_last
668func gb_rungate() -> i64
712func gb_green(rc: i64) -> i64
726func gb_try(off: i64, newbyte: i64) -> i64
764func main(argc: i64, argv: *i64) -> i64