code wiki / _hdl_build / nx_buildmode_gate.nx

nx_buildmode_gate.nx

buildroot/runtime/_hdl_build/nx_buildmode_gate.nx

6248 B112 linesdepth 3pulls 5 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_buildmode_gate.nx -- THE REFEREE for nx_buildmode_lib (LN44, 2026-09-03). The subject decides which flags the build lane hands the compiler, so its failure modes are expensive in both directions: too eager and it silently changes every artifact in the estate on adoption day; too quiet and the estate keeps shipping its slowest mode. The load-bearing tooth here is therefore the SAFETY property, not the feature: with NO conf present the reader must return ZERO flags and an EMPTY cache-key token, so adopting the lib cannot change one byte of one artifact until somebody writes a row. THE CACHE-KEY TOOTH IS NOT DECORATION. nx_sov_build_run caches artifacts under a key that today encodes the compiler sha, the assembler sha and the debug flag. A mode that changes emitted code without entering that key would serve an artifact compiled under the OTHER mode and present it as a cache hit -- silently correct-looking and wrong. So the gate asserts two different modes yield two different tokens, and that no mode yields an empty one. Fixture is PER-RUN via gk_fixture_dir, so two concurrent runs cannot clobber each other into a false SKIP -- the defect measured on nx_bck_elide_gate the same day this shipped. exit: 0 GREEN . 1 RED license_tier: ORIGINAL No hw writes.

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_gatekit_lib.nx nx_buildmode_lib.nx nx_buildmode_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_gatekit_lib.nxnx_buildmode_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 ↻ sys_mmap ↻ gk_fixture_dir gk_cat gk_catn sys_mmap ↻ sys_clock_now_us sys_now_us sys_mmap ↻ sys_clock_gettime_mono gk_mkdir sys_mkdir gk_cat ↻ gk_mkdir ↻ sys_getcwd sys_mmap ↻ sys_chdir sys_mmap ↻ bm_flags_for sys_mmap ↻ bm_read

structs

none

consts

23const BG_PATH: i64 = 1024
24const BG_CAP: i64 = 512
25const BG_SLOTS: i64 = 16

functions

27func bg_write(path: *u8, text: *u8) -> i64
38func main(argc: i64, argv: *i64) -> i64