nx_nxrun.nx
buildroot/runtime/nx_nxrun.nx
about
nxrun.nx -- sovereign replacement for bench/run.sh.
Compiles each benchmark's C baseline with gcc, times its
execution, compiles the NishiLang variant with nxc2, times its
execution, prints a tab-separated comparison. Uses the
process-control syscalls (sys_fork / sys_execve / sys_wait4)
shipped earlier in this session.
Removes bash from one more pathway in the nishi-core build
chain. Pair with f6_gate.nx (F6 reproducibility gate) to cover
every shell script currently in the repo except the gcc build
(Makefile, driven by host `make`).
Four invariants:
NR1 Same gcc / nxc2 invocation as run.sh; numbers comparable
across the bash-driven and .nx-driven runs.
NR2 Timing uses sys_clock_gettime (monotonic, ns precision)
not wall-clock -- resilient to NTP adjustments mid-run.
NR3 Each bench's child process spawned via fork + execve;
output redirected to /dev/null via dup3 so measurements
aren't I/O-bottlenecked.
NR4 Exit codes propagate: if any child exits non-zero, the
whole harness exits non-zero (CI-friendly).
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_time_canonical.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
| 33 | const NRUN_MAGIC_1000000: i64 = 1000000 |
| 35 | const NRUN_NULL: i64 = 0 |
| 36 | const NRUN_OK: i64 = 0 |
| 37 | const NRUN_FAIL: i64 = 1 |
functions
| 42 | func spawn_silent(path: *u8, argv: *i64) -> i64 |
| 77 | func time_exec(path: *u8, argv: *i64) -> i64 |
| 87 | func print_cstr(s: *u8) -> i64 |
| 95 | func print_dec(n: i64) -> i64 |
| 129 | func bench_one(name: *u8, path: *u8) -> i64 |
| 149 | func main(argc: i64, argv: *i64) -> i64 |