code wiki / _hdl_build / nx_mulchain_test.nx

nx_mulchain_test.nx

buildroot/runtime/_hdl_build/nx_mulchain_test.nx

4080 B87 linesdepth 4pulls 6 transitivereach 0 importersview sourcekind gate/prooftopic mulchain
docsdependenciesstructsconstsfunctions

about

nx_mulchain_test.nx -- the team ESCALATES its own search to close its own gaps. The raw-op superopt timed out past 3 ops; the multiplier-space chain search (nx_mulchain) reaches deep constants fast. For each C it finds the shortest shift-add chain, EMITS machine code, and the ENGINEER verifies it 1:1 BY EXECUTION on held-out inputs. Includes the two gaps the autonomous loop flagged (x*11, x*13) plus far-bigger constants the old search never reached (x*45/100/255). Gate: every kernel verified by execution -> exit 0.

dependencies 3 imports · 0 importers

nx_mulchain.nx nx_superopt_emit.nx nx_engineer_crash.nx nx_mulchain_test.nx

imports: nx_mulchain.nxnx_superopt_emit.nxnx_engineer_crash.nx

imported by: nobody (leaf or entry point)

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

main mt_puts run_all mc_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_str ↻ se_rn ↻ se_opmn mc_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 ↻ sys_openat_wr ↻ sys_dup3 ↻ sys_close ↻

structs

none

consts

none

functions

12func mt_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: mt_numreportmain
13func mt_num(v: i64) -> i64
called by 1: report calls 1: mt_puts
22func 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
23func mc_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 1: mc_one calls 1: sys_openat_wr
26func mc_one(c: i64, res: *i64) -> i64
50func run_all(ks: *i64, nk: i64, mat: *i64, r: *i64) -> i64
called by 1: main calls 1: mc_one
62func report(ks: *i64, nk: i64, mat: *i64) -> i64
called by 1: main calls 2: mt_putsmt_num
73func main() -> i64