code wiki / (root) / nxrun.nx

nxrun.nx

buildroot/runtime/nxrun.nx

5027 B153 linesdepth 3pulls 4 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

syscalls.nx time.nx nxrun.nx

imports: syscalls.nxtime.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main bench_one time_exec monotonic_ns sys_clock_gettime spawn_silent sys_fork sys_dup3 sys_execve sys_wait4 wait_exit_code print_cstr print_dec

structs

none

consts

28const NRUN_NULL: i64 = 0
29const NRUN_OK: i64 = 0
30const NRUN_FAIL: i64 = 1

functions

35func spawn_silent(path: *u8, argv: *i64) -> i64 {
70func time_exec(path: *u8, argv: *i64) -> i64 {
called by 1: bench_one calls 2: monotonic_nsspawn_silent
80func print_cstr(s: *u8) -> i64 {
called by 1: bench_one
88func print_dec(n: i64) -> i64 {
called by 1: bench_one
122func bench_one(name: *u8, path: *u8) -> i64 {
called by 1: main calls 3: time_execprint_cstrprint_dec
142func main(argc: i64, argv: *i64) -> i64 {
calls 1: bench_one