code wiki / (root) / nx_bck_elide_gate.nx

nx_bck_elide_gate.nx

buildroot/runtime/nx_bck_elide_gate.nx

21513 B363 linesdepth 3pulls 5 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_bck_elide_gate.nx -- THE ELISION PROOF GATE for LN7 (bck_elide_dominated). WHAT IT PROVES, and why the load-bearing tooth is not the fast one. An unsound bounds-check elision does not crash and does not print anything: it removes the check that would have caught a real overrun, and the program then reads or writes memory it had no right to while still returning plausible answers. There is no downstream detector for that. So this gate's centre of gravity is the REFUSAL: a check that is not PROVABLY dominated must still be there, and the two witnesses that prove it are deliberately out-of-bounds programs whose only remaining protection is the check the pass was asked not to remove. HOW ELISION IS OBSERVED. Not from a counter the pass prints -- a pass that narrates can narrate something other than what it did. The oracle is the EMITTED ASSEMBLY: the same source compiled by the same binary with and without --bckelide. A source with a genuinely dominated re-check must produce DIFFERENT assembly; a source whose re-check is not dominated must produce BYTE-IDENTICAL assembly. Either half alone is worthless -- "identical" passes trivially on a pass that does nothing at all -- so they are also submitted together to gv_bite, which fails unless the detector fires on the one and stays silent on the other. WHY THIS GATE IS RED ON THE LIVE COMPILER. nx_compile_x86's argv loop ignores long flags it does not recognise, so a compiler without the LN7 pass accepts --bckelide and emits exactly what it would have emitted anyway. The dominated-source tooth therefore fails against it, and the refusal tooth PASSES against it -- vacuously. That asymmetry is the point, and it is why the refusal tooth is never read on its own. THE COMPILER UNDER TEST IS argv[1] AND THERE IS NO DEFAULT. A gate that forks whichever compiler happens to be installed will produce a complete, confident verdict about a binary nobody chose; the estate has paid for that mistake before. Absence is a refusal here. SCOPE STATED PLAINLY -- WHAT THIS GATE DOES NOT MEASURE. The matrix row's "unchecked band" (a build with NX_BOUNDS_CHECK_LIVE = 0) is NOT measured here. That constant lives in nx_parse.nx, which this lane does not own, and fabricating the number from anything else would be a constant wearing the shape of a measurement. What IS measured is the honest h2h available from one compiler: checked-with-elision against checked-without-elision, on the same binary, same box, same minute -- i.e. how much of the check's cost the elision actually removes. Both figures are PRINTED with the host load beside them, and NOTHING branches on them: a wall-clock comparison on a shared, loaded NAS is a measurement to report, never a threshold to gate on, and building a tooth out of it would just be a flake generator. FIXTURES ARE ASSEMBLED AT RUNTIME into a PER-RUN /tmp/nx_bck_elide_gate_<us>/ (a detector that scans source finds its own fixture, and prose is source bytes too). Products land in _build/ because NAS

dependencies 3 imports · 0 importers

nx_gate_verdict.nx nx_ccbuild_lib.nx nx_gatekit_lib.nx nx_bck_elide_gate.nx

imports: nx_gate_verdict.nxnx_ccbuild_lib.nxnx_gatekit_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 ↻ bckg_resolve_cc gv_bite gv_puts ↻ gv_need gv_puts ↻ gv_puts ↻ gv_verdict gv_note_bare_rate gv_bare_rate gv_at gv_obj_has_n gv_at ↻ gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap gv_puts ↻ gv_num ↻ gv_journal

structs

none

consts

51const BCKG_TRAP_BOUNDS: i64 = 71
52const BCKG_MODE_644: i64 = 420
53const BCKG_MODE_755: i64 = 493
54const BCKG_WAIT_SIGMASK: i64 = 128
55const BCKG_WAIT_CODESHIFT: i64 = 256
56const BCKG_SCRATCH: i64 = 64
59const BCKG_N_SOURCES: i64 = 3
60const BCKG_PATHCAP: i64 = 512

functions

68func bckg_path(pfx: *u8, name: *u8) -> *u8
called by 1: main calls 1: gk_cat
78func bckg_resolve_cc(argc: i64, argv: *i64, out: *i64) -> i64
called by 1: main
91func bckg_exit_code(st: i64) -> i64
called by 1: main
98func bckg_write_src(path: *u8, body: *u8) -> i64
called by 1: main
112func bckg_run1(elf: *u8, arg1: *u8, out_path: *u8, envp: *i64, errfd: i64) -> i64
called by 1: main calls 1: cb_run
125func bckg_kv(label: *u8, v: i64) -> i64
called by 1: main calls 2: gv_putsgv_num
134func main(argc: i64, argv: *i64) -> i64