code wiki / (root) / nx_bck_iv_gate.nx

nx_bck_iv_gate.nx

buildroot/runtime/nx_bck_iv_gate.nx

16598 B261 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

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

nx_gate_verdict.nx nx_ccbuild_lib.nx nx_bck_iv_gate.nx

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

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 ↻ ivg_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

27const IVG_TRAP_BOUNDS: i64 = 71
28const IVG_F1_EXIT: i64 = 88 // sum_{i<1024}(3i+1) = 1572352; 1572352 mod 251 = 88, a closed form the fixture returns
29const IVG_MODE_644: i64 = 420
30const IVG_MODE_755: i64 = 493
31const IVG_WAIT_SIGMASK: i64 = 128
32const IVG_WAIT_CODESHIFT: i64 = 256
33const IVG_SCRATCH: i64 = 64
34const IVG_N_SOURCES: i64 = 5

functions

36func ivg_resolve_cc(argc: i64, argv: *i64, out: *i64) -> i64
called by 1: main
44func ivg_exit_code(st: i64) -> i64
called by 1: main
48func ivg_write_src(path: *u8, body: *u8) -> i64
called by 1: main
58func ivg_run0(elf: *u8, out_path: *u8, envp: *i64, errfd: i64) -> i64
called by 1: main calls 1: cb_run
70func ivg_count_trap(path: *u8) -> i64
called by 1: main
87func ivg_kv(label: *u8, v: i64) -> i64
called by 1: main calls 2: gv_putsgv_num
92func main(argc: i64, argv: *i64) -> i64