nx_bck_elide_gate.nx
buildroot/runtime/nx_bck_elide_gate.nx
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
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
structs
| none |
consts
| 51 | const BCKG_TRAP_BOUNDS: i64 = 71 |
| 52 | const BCKG_MODE_644: i64 = 420 |
| 53 | const BCKG_MODE_755: i64 = 493 |
| 54 | const BCKG_WAIT_SIGMASK: i64 = 128 |
| 55 | const BCKG_WAIT_CODESHIFT: i64 = 256 |
| 56 | const BCKG_SCRATCH: i64 = 64 |
| 59 | const BCKG_N_SOURCES: i64 = 3 |
| 60 | const BCKG_PATHCAP: i64 = 512 |
functions
| 68 | func bckg_path(pfx: *u8, name: *u8) -> *u8 |
| 78 | func bckg_resolve_cc(argc: i64, argv: *i64, out: *i64) -> i64 called by 1: main |
| 91 | func bckg_exit_code(st: i64) -> i64 called by 1: main |
| 98 | func bckg_write_src(path: *u8, body: *u8) -> i64 called by 1: main |
| 112 | func bckg_run1(elf: *u8, arg1: *u8, out_path: *u8, envp: *i64, errfd: i64) -> i64 |
| 125 | func bckg_kv(label: *u8, v: i64) -> i64 |
| 134 | func main(argc: i64, argv: *i64) -> i64 |