code wiki / _hdl_build / nx_bootstrap_gate.nx

nx_bootstrap_gate.nx

buildroot/runtime/_hdl_build/nx_bootstrap_gate.nx

8026 B161 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_bootstrap_gate.nx -- BOOTSTRAPPABILITY: can the sovereign toolchain still be rebuilt from this tree? WHY THIS EXISTS. On 2026-07-31 the answer was NO and nobody knew. ~170 sources -- including nxc.nx, nxld.nx and nxasm_main.nx, i.e. the compiler, the linker and the assembler themselves -- imported "../nxasm/<module>.nx", and the entire nxasm/ directory was ABSENT from the build root. Three independent builds died identically with `nx_compile_x86: expand_imports failed`. The toolchain kept WORKING, because it runs from prebuilt ELFs in _offc/, so nothing ever surfaced the gap: what was broken was REBUILDING it, and a system that cannot rebuild its own compiler cannot ship a change to it. BOOTSTRAPPABILITY IS A TRACKED PROPERTY, NOT AN ASSUMPTION. This mirrors the reproducible-builds bootstrapping discipline and the 2026 hermetic-build rule that a build is a PURE FUNCTION OF ITS DECLARED INPUTS: an input that has silently vanished must fail LOUDLY at declaration time, not years later when someone finally tries to rebuild. The fix restored the modules; THIS gate is what stops the regression, because the fix without a tooth is just a good day. WHAT IT MEASURES (mechanical, no compilation -- so it finishes well inside the ~14.5s edge window that KILLS any longer gate outright; measured that day: sync died at 14486ms and _async=1 at 14140ms with deadline_ms=60000 ignored, and a self-recorded verdict never even got written because the process was killed before reaching its own emit): T1 the five recovered assembler/linker modules EXIST and are non-empty T2 ZERO sources still reference the absent ../nxasm/ path (the exact regression shape) T3 the toolchain trio's own sources are present and each declares at least one import T4 NON-VACUITY: the same predicate applied to a name that cannot exist must REPORT MISSING, proving the check can fail. A gate never observed to fail is not an instrument. license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_bootstrap_gate.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main bg_w sys_write bg_present sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close sys_munmap bg_n sys_mmap ↻ sys_write ↻ bg_contains sys_mmap ↻ sys_read_file ↻ sys_munmap ↻ sys_mkdir sys_openat_wr sys_mmap ↻ sys_write ↻ sys_close ↻ sys_exit

structs

none

consts

29const BG_LOG: *u8 = "knowledge/status/bootstrap_gate.log"

functions

31func bg_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 1: main calls 1: sys_write
32func bg_n(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
43func bg_present(path: *u8) -> i64
54func bg_contains(path: *u8, needle: *u8) -> i64
75func main() -> i64