code wiki / (root) / nx_nxrun.nx

nx_nxrun.nx

buildroot/runtime/nx_nxrun.nx

5192 B160 linesdepth 2pulls 3 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_time_canonical.nx nx_nxrun.nx

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

main sys_write bench_one sys_mmap time_exec monotonic_ns sys_clock_gettime spawn_silent sys_openat_rd sys_fork sys_close sys_dup3 sys_execve sys_exit sys_mmap ↻ sys_wait4 wait_exit_code print_cstr sys_write ↻ print_dec sys_mmap ↻ sys_write ↻

structs

none

consts

33const NRUN_MAGIC_1000000: i64 = 1000000
35const NRUN_NULL: i64 = 0
36const NRUN_OK: i64 = 0
37const NRUN_FAIL: i64 = 1

functions

42func spawn_silent(path: *u8, argv: *i64) -> i64
77func time_exec(path: *u8, argv: *i64) -> i64
called by 1: bench_one calls 2: monotonic_nsspawn_silent
87func print_cstr(s: *u8) -> i64
called by 1: bench_one calls 1: sys_write
95func print_dec(n: i64) -> i64
called by 1: bench_one calls 2: sys_mmapsys_write
129func bench_one(name: *u8, path: *u8) -> i64
149func main(argc: i64, argv: *i64) -> i64