code wiki / _hdl_build / nx_builder.nx

nx_builder.nx

buildroot/runtime/_hdl_build/nx_builder.nx

10513 B196 linesdepth 4pulls 8 transitivereach 0 importersview sourcekind tooltopic builder
docsdependenciesstructsconstsfunctions

about

nx_builder.nx -- the NISHI BUILDER. A sovereign orchestrator that runs the whole closed self-sufficiency loop ITSELF, so the ecosystem builds + races + banks without a human driving each step. For every target it: GENERATES the optimal machine code (the team's chain superoptimizer + emitter), VERIFIES it 1:1 BY EXECUTION (the Engineer), RACES the NEWEST gcc on the box (the team's own gcc-race capability, picking gcc-16/15/14/13), and CLASSIFIES win/tie/loss -- then BANKS the verified-optimal code and FLAGS any loss as the next capability to build. That flag is the loop closing on itself: the builder tells the team where to grow. license_tier: ORIGINAL RACI: GENERATOR authors, ENGINEER verifies, RACER measures the incumbent, the builder orchestrates + banks; it does not fake a result (every banked entry is exec-verified).

dependencies 5 imports · 0 importers

nx_mulchain.nx nx_itoa_lib.nx nx_superopt_emit.nx nx_engineer_crash.nx nx_gcc_race.nx nx_builder.nx

imports: nx_mulchain.nxnx_itoa_lib.nxnx_superopt_emit.nxnx_engineer_crash.nxnx_gcc_race.nx

imported by: nobody (leaf or entry point)

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

main bd_main bd_puts gr_newest_gcc gr_exists sys_openat_rd sys_close bd_run bd_build_one mulchain_find mc_abs mc_enum mc_avslot mc_abs ↻ mc_enum ↻ se_emit_full se_str se_num se_emit_synth so_is_shift se_str ↻ se_rn se_num ↻ se_slot_isreg se_slot se_opmn bd_write sys_openat_wr eng_link sys_mmap sys_fork sys_openat_wr ↻ sys_dup3 sys_close ↻ sys_execve sys_exit sys_wait4 eng_run sys_mmap ↻ sys_fork ↻

structs

none

consts

18const K_MAGIC_8192: i64 = 8192
19const K_MAGIC_999999: i64 = 999999

functions

21func bd_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
26func bd_num(v: i64) -> i64 { nxi_out(v); return 0 }
called by 2: bd_reportbd_diagnose calls 1: nxi_out
27func tally(r: *i64, n: i64) -> i64 { var ec: i64 = 0; var i: i64 = 0; while i < n { if r[i] != 1 { if ec == 0 { ec = i + 1 } } i = i + 1 } return ec }
called by 1: main
28func bd_write(path: *u8, buf: *u8, len: i64) -> i64 { let fd: i64 = sys_openat_wr(path, 0x1a4); if fd < 0 { return 0 - 1 } sys_write(fd, buf, len); sys_close(fd); return 0 }
30func bd_build_c(c: i64, path: *u8) -> i64
called by 2: bd_build_onebd_diagnose calls 1: bd_write
45func bd_build_one(c: i64, gccpath: *u8, res: *i64) -> i64
80func bd_run(ks: *i64, nk: i64, gccpath: *u8, mat: *i64, r: *i64) -> i64
called by 1: bd_main calls 1: bd_build_one
94func bd_report(ks: *i64, nk: i64, mat: *i64) -> i64
called by 1: bd_main calls 2: bd_putsbd_num
121func bd_team_has(buf: *u8, s: i64, e: i64) -> i64
called by 1: bd_diagnose calls 1: gr_match
133func bd_diagnose(c: i64, gccpath: *u8) -> i64
168func bd_diagnose_losses(ks: *i64, nk: i64, mat: *i64, gccpath: *u8) -> i64
called by 1: bd_main calls 2: bd_putsbd_diagnose
175func bd_main(r: *i64) -> i64
189func main() -> i64
calls 2: bd_maintally