code wiki / (root) / nx_inc_compile_gate.nx

nx_inc_compile_gate.nx

buildroot/runtime/nx_inc_compile_gate.nx

27090 B455 linesdepth 5pulls 9 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_inc_compile_gate.nx -- VERDICT gate for rung LN10 of /compare/lang: the per-module incremental build cache in nx_inc_compile (watch symbol inc_cache_lookup). DONE-RULE UNDER TEST (lang.plan LN10, verbatim): "gate proves a one-file edit rebuilds only its dependents and the output equals a full build". EVERYTHING RUNS IN AN ISOLATED FIXTURE TREE under <buildroot>/_build/nx_inc_compile_gate/ -- its own runtime/, its own _offc/ copy of the live toolchain AND of the closure ruler, its own _build/ and its own knowledge/ -- so nothing here touches the estate's cache, its toolchain, its confs or its serving root. The fixture is wiped at SETUP, never at teardown: a teardown does not run when a run crashes, and a gate that is not idempotent reports on its first run and lies about every run after. FIXTURE ROOT IS DERIVED, NOT /tmp: measured on this NAS, a byte-identical copy of the compiler placed under /tmp returns execve 127 -- the mount refuses execution -- so every builder run would fail with an empty .s and read as a compiler defect. Build-artifact territory is executable by construction. THE ZERO-COMPILE WITNESS IS STATE, NOT A MESSAGE: nx_sov_build_run writes _build/<t>.s only inside its compile loop. The gate deletes that file before a rebuild; if the artifact is still current and the .s is still ABSENT, no compiler ran. A tooth asserts the .s IS present after a real build, so the absence witness cannot pass vacuously. THE FIXTURE'S OWN buildcache.conf SETS cache_enabled=0 so that B2's whole-target cache cannot serve the hit this gate is attributing to LN10 -- without that, every "zero compile" tooth would measure B2. license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 5 imports · 0 importers

nx_syscalls.nx nx_sha256.nx nx_gate_verdict.nx nx_gatekit_lib.nx nx_tool_run.nx nx_inc_compile_gate.nx

imports: nx_syscalls.nxnx_sha256.nxnx_gate_verdict.nxnx_gatekit_lib.nxnx_tool_run.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main gv_head gv_puts sys_write 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 ↻ sys_mmap ↻ gv_need gv_puts ↻ gk_corpus_root sys_mmap ↻ gk_cat gk_exists sys_openat_rd sys_close 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

structs

none

consts

29const IG_PATH: i64 = 4096
30const IG_OUT: i64 = 1048576
31const IG_SHA_HEX: i64 = 64
32const IG_MODE_X: i64 = 493 // 0755
33const IG_MODE_R: i64 = 420 // 0644
34const IG_TMO: i64 = 900000 // the builder's own SBR_BUILD_DEADLINE_MS, inherited not re-chosen
35const IG_VAL_A: i64 = 11 // icfx_lib v1 return value
36const IG_VAL_B: i64 = 19 // icfx_lib v2 -- ONE line differs
37const IG_VAL_C: i64 = 23 // icfx_lib v3
38const IG_SHOW: i64 = 3000 // how much captured output to echo when a tooth fails

functions

55func igp_mk(base: *u8, tail: *u8) -> i64
62func igp_init(buildroot: *u8) -> i64
called by 1: main calls 1: igp_mk
79func igp(v: i64) -> *u8 { return v as *u8 }
80func ig_p(s: *u8) -> i64 { sys_write(1, s, gk_len(s)); return 0 }
called by 2: ig_showmain calls 2: sys_writegk_len
81func ig_nl() -> i64 { let b: *u8 = sys_mmap(2); b[0] = 10 as u8; sys_write(1, b, 1); sys_munmap(b, 2); return 0 }
82func ig_n(v: i64) -> i64 { gv_num(v); return 0 }
calls 1: gv_num
83func ig_sub(dir: i64, name: *u8) -> *u8 { return igp_mk(igp(dir), name) as *u8 }
called by 2: ig_write_libmain calls 2: igp_mkigp
85func ig_sha(path: *u8, out: *u8) -> i64
105func ig_hexeq(a: *u8, b: *u8) -> i64
called by 1: main
112func ig_copy(src: *u8, dst: *u8, mode: i64) -> i64
127func ig_append_byte(path: *u8) -> i64
140func ig_write_lib(v: i64) -> i64
153func ig_write_prog(name: *u8, letter: *u8, uses_lib: i64) -> i64
178func ig_run(subject: *u8, a1: *u8, a2: *u8, a3: *u8, a4: *u8, a5: *u8, a6: *u8, out: *u8, ol: *i64) -> i64
called by 1: main calls 2: sys_mmaptr_run_capture_to
192func ig_show(cond: i64, out: *u8, n: i64) -> i64
called by 1: main calls 3: ig_pig_nlsys_write
202func ig_after_key(out: *u8, n: i64, needle: *u8, keyout: *u8) -> i64
called by 1: main calls 2: gk_out_posgk_len
212func ig_wipe_index() -> i64 { return sys_unlinkat(igp(igp_idx)) }
called by 1: main calls 2: sys_unlinkatigp
213func ig_rm_asm(name: *u8) -> i64 { return sys_unlinkat(igp_mk(igp(igp_bld), name) as *u8) }
215func main(argc: i64, argv: *i64) -> i64