nx_bck_iv_gate.nx
buildroot/runtime/nx_bck_iv_gate.nx
about
nx_bck_iv_gate.nx -- THE ELISION PROOF GATE for LN7b (bck_elide_induction) and for the compiler's
data-driven MODES (--mode=<name>, knowledge/lang_modes.conf). Sibling of nx_bck_elide_gate and
built from the same parts (nx_ccbuild_lib, gv_*): sources assembled at RUNTIME under /tmp, compiled
two ways by the compiler named in argv[1] (there is NO default compiler -- a gate that forks whatever
is installed reports on a binary nobody chose), the emitted ASSEMBLY as the oracle for "fired" /
"did not fire", and out-of-bounds witnesses whose only remaining protection is the check the pass
was asked to keep.
WHAT MUST FIRE: the receipt loop's own shape -- a counter initialised to a constant, incremented by a
constant inside a `while k < N` whose N is the array's length, indexing that array. WHAT MUST NOT:
F2 the guard is WIDER than the array (`while k < 2048` over [1024]i64) -- and it traps 71 under
both builds, so the refusal is measured on a program that really does go out of range;
F3 the counter is incremented by a value that is not a constant -- its range is unknowable here;
F4 a constant reset (`k = 4000`) sits on the path between the guard and the access -- the guard's
fact is dead by the time the access runs, and the program traps 71 under both builds;
F5 the counter's address ESCAPES (`let p: *i64 = &k`) -- a store through p is invisible to the
pass, and the program traps 71 under both builds.
gv_bite ties the two halves: the detector must change F1 and leave F2 byte-identical.
MODES: `--mode=f1` must produce assembly byte-identical to `--bckelide` (the bundle is exactly its
flags, no more), and `--mode=nonesuch` must REFUSE the build (a silent default is a mode wearing
the wrong name).
Products land in _build/ because NAS /tmp is mounted noexec (the sibling gate's measured lesson).
license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 2 imports · 0 importers
imports: nx_gate_verdict.nxnx_ccbuild_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
| 27 | const IVG_TRAP_BOUNDS: i64 = 71 |
| 28 | const IVG_F1_EXIT: i64 = 88 // sum_{i<1024}(3i+1) = 1572352; 1572352 mod 251 = 88, a closed form the fixture returns |
| 29 | const IVG_MODE_644: i64 = 420 |
| 30 | const IVG_MODE_755: i64 = 493 |
| 31 | const IVG_WAIT_SIGMASK: i64 = 128 |
| 32 | const IVG_WAIT_CODESHIFT: i64 = 256 |
| 33 | const IVG_SCRATCH: i64 = 64 |
| 34 | const IVG_N_SOURCES: i64 = 5 |
functions
| 36 | func ivg_resolve_cc(argc: i64, argv: *i64, out: *i64) -> i64 called by 1: main |
| 44 | func ivg_exit_code(st: i64) -> i64 called by 1: main |
| 48 | func ivg_write_src(path: *u8, body: *u8) -> i64 called by 1: main |
| 58 | func ivg_run0(elf: *u8, out_path: *u8, envp: *i64, errfd: i64) -> i64 |
| 70 | func ivg_count_trap(path: *u8) -> i64 called by 1: main |
| 87 | func ivg_kv(label: *u8, v: i64) -> i64 |
| 92 | func main(argc: i64, argv: *i64) -> i64 |