code wiki / _hdl_build / nx_bless_compiler.nx
nx_bless_compiler.nx
buildroot/runtime/_hdl_build/nx_bless_compiler.nx
about
nx_bless_compiler.nx -- TEAM-OWNED self-deploy for the sovereign compiler
(GAME arc G2, operator: "keep building the team to handle this
autonomously"). The whole win-win-win update gate from
[[project-pm-plan-maintainer-winwinwin-2026-06-05]] mechanized:
1. BUILD the candidate SOVEREIGNLY: current _offc compiler compiles
runtime/nx_compile_x86.nx (retry-guarded), nxasm_x86_main assembles.
nxasm crash/refusal -> REFUSE "BLOCKED-BY-G1" (today's state: the
2.4MB-.s capacity segfault). NO gcc anywhere on this path.
2. MEASURE: nx_game_gate runs twice -- candidate vs live _offc.
Verdict is DATA (fails counts), not opinion.
3. BLESS only if candidate is STRICTLY better (fewer fails). The live
compiler is backed up to _offc/nx_cc_sovereign.elf.bak first.
4. POST-VERIFY: gate the freshly blessed _offc; if it does not match the
candidate's measurement, ROLL BACK from the .bak and re-verify.
5. The gate-loop daemon is STOPPED before measuring and RESTARTED after
(two concurrent gates corrupt each other's /tmp artifacts -- learned
live 2026-06-09).
Exit: 0 blessed+verified, 1 refused (candidate not better), 2 blocked at
build (G1), 3 rolled back (post-verify mismatch), 4 internal error.
license_tier: ORIGINAL
dependencies 3 imports · 0 importers
imports: nx_pm_review_log.nxnx_itoa_lib.nxnx_syscalls.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 26 | const BC_MAGIC_65536: i64 = 65536 |
| 27 | const BC_MAGIC_4095: i64 = 4095 |
| 28 | const BC_MAGIC_4096: i64 = 4096 |
| 30 | const BC_MIN_ASM_BYTES: i64 = 128 |
| 31 | const BC_MAX_RETRIES: i64 = 12 |
functions
| 33 | func bc_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 38 | func bc_putn(v: i64) -> i64 { nxi_out(v); return 0 } |
| 39 | func bc_cat(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { dst[off+i] = s[i]; i = i + 1 } return off + i } |
| 40 | func bc_cat_n(dst: *u8, off: i64, v: i64) -> i64 calls 1: sys_mmap |
| 53 | func bc_run(path: *u8, argv: *i64, envp: *i64, redir_out: i64, redir_err: i64) -> i64 |
| 68 | func bc_run1(path: *u8, arg1: *u8, envp: *i64, devnull: i64) -> i64 |
| 74 | func bc_filesize(path: *u8) -> i64 |
| 86 | func bc_copy(src: *u8, dst: *u8) -> i64 |
| 102 | func bc_read_pidfile(path: *u8) -> i64 |
| 120 | func bc_substr(buf: *u8, n: i64, needle: *u8) -> i64 called by 1: bc_equiv_green |
| 137 | func bc_equiv_green() -> i64 |
| 160 | func main(argc: i64, argv: *i64) -> i64 |