code wiki / _hdl_build / nx_bench_vs_c.nx

nx_bench_vs_c.nx

buildroot/runtime/_hdl_build/nx_bench_vs_c.nx

4310 B78 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind benchtopic bench
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_itoa_lib.nx nx_bench_vs_c.nx

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

main bv_w sys_write sys_exit sys_mmap bv_cat sys_now_ms sys_mmap ↻ sys_clock_gettime_mono bv_run sys_fork sys_execve sys_exit ↻ sys_mmap ↻ sys_wait4 sys_openat_append bv_n nxi_fd sys_mmap ↻ ccz_cat_num sys_write ↻ sys_munmap sys_close

structs

none

consts

none

functions

13func 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 }
called by 1: main calls 1: sys_write
18func bv_n(fd: i64, v: i64) -> i64 { nxi_fd(fd, v); return 0 }
called by 1: main calls 1: nxi_fd
19func 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
21func bv_run(path: *u8, argv: *i64, envp: *i64) -> i64
31func main(argc: i64, argv: *i64) -> i64