code wiki / _hdl_build / nx_superopt_race_test.nx
nx_superopt_race_test.nx
buildroot/runtime/_hdl_build/nx_superopt_race_test.nx
about
nx_superopt_race_test.nx -- the team SYNTHESIZES + SUPEROPTIMIZES + EMITS real machine
code, proven 1:1 by EXECUTION, ready to race gcc -O2. For each kernel x*C:
1. so_find synthesizes the SHORTEST program (provably minimal over its ISA)
2. se_emit_full emits competitive x86-64 (lea fusion + in-place reuse)
3. eng_link + eng_run assemble and RUN it; the exit byte is sum(synth(d)) over
HELD-OUT inputs d -- compared to (sum d*C)&255, so a match proves BOTH that the
synthesis generalizes (not overfit) AND that the emit is faithful.
Prints the team's instruction count per kernel (the number for the gcc -O2 race).
Gate: every kernel verifies 1:1 -> exit 0.
dependencies 2 imports · 0 importers
imports: nx_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
structs
| none |
consts
| none |
functions
| 14 | func rp_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 15 | func rp_num(v: i64) -> i64 |
| 24 | 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 |
| 27 | func doc_emit_write(path: *u8, buf: *u8, len: i64) -> i64 |
| 34 | func race_one(c: i64, res: *i64) -> i64 |
| 70 | func main() -> i64 |