code wiki / _hdl_build / nx_build_gate.nx

nx_build_gate.nx

buildroot/runtime/_hdl_build/nx_build_gate.nx

3370 B52 linesdepth 2pulls 2 transitivereach 1 importersview sourcekind gate/prooftopic build
docsdependenciesstructsconstsfunctions

about

nx_build_gate.nx -- the team's BUILD-CAPABILITY GATE: honestly know what it CAN and CANNOT build with the toolchain it has, and route the gap (operator: "have the nishi team build it, and if they cant, build the nishi team's capabilities to build it" -- step 0 of that is the team KNOWING it can't, and why). Diagnosed real gap: the file-based TLS daemon needs the server-side TLS-1.3 crypto, which uses the G2 wide-multiply intrinsic __umulhi64; the deployed nx_cc_known_good.elf is PRE-G2 and rejects it ('unhandled __ intrinsic: __umulhi64'). So the daemon is NOT directly buildable. Compiler feature levels: BASE (pre-G2, no __umulhi64) < G2 (knows __umulhi64, needed for x25519 field math). A target needing G2 is BUILDABLE only on a G2 compiler; otherwise NEEDS_BOOTSTRAP (if a G2 compiler's source is in the repo AND that source does not itself require G2 -- no chicken-and-egg) or BLOCKED. And bootstrapping+trusting a fresh compiler carries the team's hard-won MISCOMPILE risk, so a pinned/known-good build env is preferred. license_tier: ORIGINAL Pairs with nx_auditor + the Engineer.

dependencies 1 imports · 1 importers

nx_syscalls.nx nx_build_gate.nx nx_build_gate_test.nx

imports: nx_syscalls.nx

imported by: nx_build_gate_test.nx

structs

none

consts

15const BG_FEAT_BASE: i64 = 0 // pre-G2 known-good compiler
16const BG_FEAT_G2: i64 = 1 // knows __umulhi64 (wide multiply) -- required by the TLS crypto
18const BG_BLOCKED: i64 = 0 // cannot build with what we have, and cannot bootstrap
19const BG_NEEDS_BOOTSTRAP: i64 = 1 // not directly buildable, but a G2 compiler is bootstrappable
20const BG_BUILDABLE: i64 = 2 // directly buildable with the available compiler
45const BG_ROUTE_NONE: i64 = 0
46const BG_ROUTE_BUILD_ENV: i64 = 1 // get access to the build container (G2 compiler + source) -- low risk
47const BG_ROUTE_BOOTSTRAP: i64 = 2 // bootstrap a G2 compiler here -- higher risk

functions

23func bg_directly_buildable(target_needs: i64, available_has: i64) -> i64 { if available_has >= target_needs { return 1 } return 0 }
called by 2: bg_verdictmain
27func bg_bootstrappable(higher_source_in_repo: i64, higher_source_self_needs_higher: i64) -> i64
called by 1: main
34func bg_verdict(target_needs: i64, available_has: i64, bootstrappable: i64) -> i64
called by 1: main calls 1: bg_directly_buildable
41func bg_carries_miscompile_risk(verdict: i64) -> i64 { if verdict == BG_NEEDS_BOOTSTRAP { return 1 } return 0 }
called by 1: main
48func bg_route(verdict: i64, build_env_reachable: i64) -> i64
called by 1: main