code wiki / _hdl_build / nx_bench_vs_c.nx
nx_bench_vs_c.nx
buildroot/runtime/_hdl_build/nx_bench_vs_c.nx
about
nx_bench_vs_c.nx -- HORIZONTAL benchmark organ (Referee/Engineer-owned): races the sovereign
toolchain against the C toolchain (gcc) on the SAME .s artifact -- the operator-sanctioned use
of C ("benchmarking only"). For argv[1]=<name> (expects /tmp/<name>.s from nx_sov_build_run):
lane A: nxasm_x86_main .s -> ELF (ours) timed ms
lane B: gcc -nostdlib .s -> ELF (C oracle) timed ms
then RUNS both ELFs and compares exit codes (differential correctness, csmith-lite).
Emits one parseable line appended to /tmp/nishi_ladder.log for the wiki ladder:
BENCH name= sov_ms= gcc_ms= sov_exit= gcc_exit= agree=
license_tier: ORIGINAL (fork/exec spine reused from nx_sov_build_run)
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_itoa_lib.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
| 13 | func bv_w(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd,s,n); return 0 } |
| 18 | func bv_n(fd: i64, v: i64) -> i64 { nxi_fd(fd, v); return 0 } |
| 19 | func bv_cat(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){dst[off+i]=s[i];i=i+1} return off+i } called by 1: main |
| 21 | func bv_run(path: *u8, argv: *i64, envp: *i64) -> i64 |
| 31 | func main(argc: i64, argv: *i64) -> i64 |