code wiki / _hdl_build / nx_osbench_kern.nx

nx_osbench_kern.nx

buildroot/runtime/_hdl_build/nx_osbench_kern.nx

10246 B205 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind bench
docsdependenciesstructsconstsfunctions

about

nx_osbench_kern.nx -- rung F853b (lane osbench): the KERNEL-AXIS harness. WHY THIS EXISTS: the operator mission is RAW KERNEL PERFORMANCE, and 750 of 1000 permille of that mission (syscall_trap, ipc, thread_spawn, context_switch) was UNMEASURED -- we did not even know what LINUX costs on this hardware, so we had no target to aim at. This organ measures the LINUX side of the kernel axes so the number NishiOS must beat is on record. ★ HONEST SCOPE, STATED UP FRONT: these are REFERENCE rows, not comparisons. NishiOS does not run as an OS on this substrate -- it is hosted, so it has no syscall-trap or scheduler of its own here. There is therefore NO NishiOS counterpart to pair against, and the judge scores NOTHING from this file. Emitting a one-sided number as if it were a head-to-head would be exactly the no-wave violation this lane exists to prevent. The NishiOS halves stay UNMEASURED, with the rung that unblocks them named (F856 bare-metal node). ★ A STRUCTURAL NOTE THAT MUST NOT BE SCORED AS A WIN: NishiOS's native contract has no syscall trap on the store path at all (capability call, not a ring transition). That is a FLOOR/design difference, and the gap ledger's rule applies -- "we own it" is never printed as "we beat it". It is recorded as prose here, never as a ratio. AXES (Linux, this host): syscall_trap -- minimal round trip into the kernel and back (close on an invalid fd: a real trap, EBADF immediately, near-zero kernel work = trap floor) pipe_write_read -- a byte through a real pipe buffer, same process. NAMED HONESTLY: this is the pipe-buffer cost, NOT an inter-process IPC round trip and NOT a context switch. Calling it ipc_roundtrip would be a lie by label. license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_itoa_lib.nx nx_osbench_kern.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 ok_p ok_w ok_len sys_write sys_mmap sys_pipe2 ok_pn ok_wn nxi_fd sys_mmap ↻ ccz_cat_num sys_write ↻ sys_munmap sys_openat_append sys_exit ok_w ↻ ok_round sys_mmap ↻ sys_close sys_write ↻ sys_read ok_ns sys_clock_gettime_mono ok_med ok_rank sys_mmap ↻ ok_iqr ok_med ↻ ok_rank ↻ ok_rng ok_med ↻ ok_axname ok_wn ↻ sys_close ↻

structs

none

consts

30const OK_N: i64 = 2000
31const OK_ROUNDS: i64 = 15
32const OK_WARM: i64 = 200
33const OK_MODE: i64 = 420
34const OK_NSEC: i64 = 1000000000
35const OK_BADFD: i64 = 0 - 1
36const OK_UNSTABLE: i64 = 100

functions

38func ok_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: ok_w
39func ok_w(fd: i64, s: *u8) -> i64 { let n: i64 = ok_len(s); sys_write(fd, s, n); return 0 }
called by 2: ok_pmain calls 2: ok_lensys_write
40func ok_p(s: *u8) -> i64 { return ok_w(1, s) }
called by 1: main calls 1: ok_w
45func ok_wn(fd: i64, v: i64) -> i64 { nxi_fd(fd, v); return 0 }
called by 2: ok_pnmain calls 1: nxi_fd
46func ok_pn(v: i64) -> i64 { return ok_wn(1, v) }
called by 1: main calls 1: ok_wn
48func ok_ns(ts: *i64) -> i64
called by 1: ok_round calls 1: sys_clock_gettime_mono
58func ok_rank(arr: *i64, n: i64, r: i64) -> i64
called by 2: ok_medok_iqr calls 1: sys_mmap
78func ok_med(arr: *i64, n: i64) -> i64 { return ok_rank(arr, n, n/2) }
called by 3: ok_iqrok_rngmain calls 1: ok_rank
79func ok_iqr(arr: *i64, n: i64) -> i64
called by 1: main calls 2: ok_medok_rank
86func ok_rng(arr: *i64, n: i64) -> i64
called by 1: main calls 1: ok_med
102func ok_round(axis: i64, rfd: i64, wfd: i64) -> i64
125func ok_axname(axis: i64) -> *u8
called by 1: main
130func main() -> i64