code wiki / _hdl_build / nx_osbench_kern.nx
nx_osbench_kern.nx
buildroot/runtime/_hdl_build/nx_osbench_kern.nx
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
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
structs
| none |
consts
| 30 | const OK_N: i64 = 2000 |
| 31 | const OK_ROUNDS: i64 = 15 |
| 32 | const OK_WARM: i64 = 200 |
| 33 | const OK_MODE: i64 = 420 |
| 34 | const OK_NSEC: i64 = 1000000000 |
| 35 | const OK_BADFD: i64 = 0 - 1 |
| 36 | const OK_UNSTABLE: i64 = 100 |
functions
| 38 | func 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 |
| 39 | func ok_w(fd: i64, s: *u8) -> i64 { let n: i64 = ok_len(s); sys_write(fd, s, n); return 0 } |
| 40 | func ok_p(s: *u8) -> i64 { return ok_w(1, s) } |
| 45 | func ok_wn(fd: i64, v: i64) -> i64 { nxi_fd(fd, v); return 0 } |
| 46 | func ok_pn(v: i64) -> i64 { return ok_wn(1, v) } |
| 48 | func ok_ns(ts: *i64) -> i64 |
| 58 | func ok_rank(arr: *i64, n: i64, r: i64) -> i64 |
| 78 | func ok_med(arr: *i64, n: i64) -> i64 { return ok_rank(arr, n, n/2) } |
| 79 | func ok_iqr(arr: *i64, n: i64) -> i64 |
| 86 | func ok_rng(arr: *i64, n: i64) -> i64 |
| 102 | func ok_round(axis: i64, rfd: i64, wfd: i64) -> i64 |
| 125 | func ok_axname(axis: i64) -> *u8 called by 1: main |
| 130 | func main() -> i64 |