code wiki / _hdl_build / nx_builder.nx
nx_builder.nx
buildroot/runtime/_hdl_build/nx_builder.nx
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
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
structs
| none |
consts
| 18 | const K_MAGIC_8192: i64 = 8192 |
| 19 | const K_MAGIC_999999: i64 = 999999 |
functions
| 21 | func 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 } |
| 26 | func bd_num(v: i64) -> i64 { nxi_out(v); return 0 } |
| 27 | func 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 |
| 28 | func 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 } |
| 30 | func bd_build_c(c: i64, path: *u8) -> i64 |
| 45 | func bd_build_one(c: i64, gccpath: *u8, res: *i64) -> i64 |
| 80 | func bd_run(ks: *i64, nk: i64, gccpath: *u8, mat: *i64, r: *i64) -> i64 |
| 94 | func bd_report(ks: *i64, nk: i64, mat: *i64) -> i64 |
| 121 | func bd_team_has(buf: *u8, s: i64, e: i64) -> i64 |
| 133 | func bd_diagnose(c: i64, gccpath: *u8) -> i64 called by 1: bd_diagnose_losses calls 7: bd_build_cgr_race_cvgr_existsgr_func_mnemonicsbd_putsbd_num+1 |
| 168 | func bd_diagnose_losses(ks: *i64, nk: i64, mat: *i64, gccpath: *u8) -> i64 |
| 175 | func bd_main(r: *i64) -> i64 |
| 189 | func main() -> i64 |