code wiki / (root) / nx_sh_race.nx

nx_sh_race.nx

buildroot/runtime/nx_sh_race.nx

1695 B42 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tooltopic sh
docsdependenciesstructsconstsfunctions

about

nx_sh_race.nx -- prove the sovereign shell nx_sh is an S-class EXCEED over bash on the one thing a shell does most: spawn commands. Measures per-spawn overhead 1:1 (spawn /bin/true N times) so it's comparable to a bash oracle (`time (for i in $(seq N); do /bin/true; done)`). The child cost is identical either way; the delta is the SHELL's own overhead -- where nx_sh (raw fork/exec, no parse/job-control) beats bash. license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_sh.nx nx_sh_race.nx

imports: nx_syscalls.nxnx_sh.nx

imported by: nobody (leaf or entry point)

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

main nx_sh_argv sys_mmap nx_sh_run_quiet sys_fork sys_openat_wr sys_dup3 sys_mmap ↻ sys_execve sys_exit sys_wait4 wait_exit_code sys_now_us sys_mmap ↻ sys_clock_gettime_mono rputs sys_write rputn sys_write ↻ sys_mmap ↻

structs

none

consts

12const K_MAGIC_2000: i64 = 2000

functions

14func rputs(s: *u8) -> i64 { var n: i64 = 0; while s[n] != 0 as u8 { n = n + 1 } sys_write(1, s, n); return 0 }
called by 1: main calls 1: sys_write
15func rputn(n: i64) -> i64
called by 1: main calls 2: sys_writesys_mmap
25func main() -> i64