code wiki / _hdl_build / nx_cost_race_test.nx

nx_cost_race_test.nx

buildroot/runtime/_hdl_build/nx_cost_race_test.nx

6195 B118 linesdepth 4pulls 7 transitivereach 0 importersview sourcekind gate/prooftopic cost
docsdependenciesstructsconstsfunctions

about

nx_cost_race_test.nx -- the team judges by COST, not just instruction count, reading the latency of BOTH its own emitted code and the competitors' (gcc, clang) straight from the machine code. This is the team applying, ITSELF, the "count != cost" judgment I used to supply by hand: clang's x*100 imul is 1 insn but ~3 cycles, vs the team's 3 one-cycle leas, so by COST it is a TIE, not a loss. Gate: every team sequence verified by execution AND both competitors costed -> the team raced correctly on the honest metric. exit 0.

dependencies 4 imports · 0 importers

nx_mulchain.nx nx_superopt_emit.nx nx_engineer_crash.nx nx_gcc_race.nx nx_cost_race_test.nx

imports: nx_mulchain.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 cr_main cr_puts gr_newest_gcc gr_exists sys_openat_rd sys_close run_all cr_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 cr_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

none

functions

13func cr_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 3: cr_numreportcr_main
14func cr_num(v: i64) -> i64
called by 1: report calls 1: cr_puts
23func 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
24func cr_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 }
called by 2: cr_build_ccr_one calls 1: sys_openat_wr
25func cr_build_c(c: i64, path: *u8) -> i64
called by 1: cr_one calls 1: cr_write
37func cr_min(a: i64, b: i64) -> i64 { if b > 0 { if b < a { return b } } return a }
called by 1: cr_one
40func cr_one(c: i64, gccpath: *u8, res: *i64) -> i64
68func run_all(ks: *i64, nk: i64, gccpath: *u8, mat: *i64, r: *i64) -> i64
called by 1: cr_main calls 1: cr_one
81func report(ks: *i64, nk: i64, mat: *i64) -> i64
called by 1: cr_main calls 2: cr_putscr_num
100func cr_main(r: *i64) -> i64
112func main() -> i64
calls 2: cr_maintally