code wiki / _hdl_build / nx_osbench_micro.nx

nx_osbench_micro.nx

buildroot/runtime/_hdl_build/nx_osbench_micro.nx

24724 B495 linesdepth 7pulls 10 transitivereach 0 importersview sourcekind bench
docsdependenciesstructsconstsfunctions

about

nx_osbench_micro.nx -- OSBENCH: NishiOS native-contract vs Linux host primitives, measured in the SAME process on the SAME silicon through the nx_pabi seam (backends PABI_NISHIOS / PABI_LINUX). Rung F853 (lane osbench). Operator altitude ruling 2026-07-20: native-contract-on-same-metal -- NOT emulated-guest-vs-native-host, so these rows are honestly MEASURED, not DIFFERENT-ALTITUDE. ROLE: this organ MEASURES and asserts NOTHING. It emits tab rows to knowledge/status/osbench_measured.dat; nx_osbench_judge (F855) computes every verdict from the numbers. No verdict is decided here. LIAR-KILL / anti-stale-binary: every run records the measured artifact's own byte-length and a wrapping polynomial digest (artifact identity). This is a CHANGE DETECTOR, not a cryptographic hash -- named honestly as fnv-class 'adig', not sha256. It exists because debts seq207/124/236/242 are one family: you cannot otherwise prove the binary you measured is the binary you built, and a speed verdict on byte-identical binaries measures nothing (the asm-diff-guard lesson). FAIRNESS: both backends CREATE-NEW every iteration (names carry the round index), so neither side gets a cheaper overwrite path. The NishiOS block-VFS is additive-only (vb_create REFUSES overwrite) and gets a FRESH 256KB image per round; VB_BS*VB_NB = 1024 blocks bounds N. DECLARED ENVELOPE (printed in output -- silent capping is forbidden): N=200 ops/round, ROUNDS=3, payload 64B, single-threaded, single-node, warm cache. COVERS: create+write, read, resolve. DOES NOT COVER: context-switch, IPC, thread-spawn, syscall-trap cost -- those need NishiOS running AS an OS and are gated on the bare-metal node (rung F856). They are emitted as UNMEASURED rows, never as zeros. license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 2 imports · 0 importers

nx_pabi.nx nx_itoa_lib.nx nx_osbench_micro.nx

imports: nx_pabi.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 ob_selfcheck ob_p ob_len ob_ns sys_clock_gettime_mono sys_sleep_ms sys_mmap sys_munmap ob_pn ob_wn nxi_fd sys_mmap ↻ ccz_cat_num sys_write sys_munmap ↻ ob_p ↻ ob_artifact sys_read ob_pn ↻ sys_openat_append ob_w ob_len ↻ ob_wn ↻ ob_axis_all ob_round pabi_nishios_new vb_format vb_wr vb_ino vb_nm_set vb_mount vb_rd vbj_replay vbj_hdr vb_rd ↻ vbj_sumrecs vbj_checkpoint vbj_apply vb_ino ↻

structs

none

consts

27const OB_MAGIC_4096: i64 = 4096
28const OB_MAGIC_100000: i64 = 100000
29const OB_MAGIC_1000000: i64 = 1000000
31const OB_N: i64 = 200
32const OB_ROUNDS: i64 = 15
33const OB_WARM: i64 = 20
34const OB_PAY: i64 = 64
35const OB_MODE: i64 = 420
36const OB_NSEC: i64 = 1000000000
37const OB_HMUL: i64 = 1000003
38const OB_ELFCAP: i64 = 1048576
39const OB_UNSTABLE_PERMIL: i64 = 100

functions

41func ob_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 2: ob_pob_w
42func ob_p(s: *u8) -> i64 { let n: i64 = ob_len(s); sys_write(1, s, n); return 0 }
called by 2: ob_selfcheckmain calls 1: ob_len
43func ob_w(fd: i64, s: *u8) -> i64 { let n: i64 = ob_len(s); sys_write(fd, s, n); return 0 }
called by 1: main calls 1: ob_len
49func ob_wn(fd: i64, v: i64) -> i64 { nxi_fd(fd, v); return 0 }
called by 2: ob_pnmain calls 1: nxi_fd
50func ob_pn(v: i64) -> i64 { return ob_wn(1, v) }
called by 2: ob_selfcheckmain calls 1: ob_wn
53func ob_ns(ts: *i64) -> i64
61func ob_catn(buf: *u8, o: i64, v: i64) -> i64
72func ob_cat(buf: *u8, o: i64, s: *u8) -> i64
80func ob_nname(buf: *u8, k: i64) -> i64
called by 1: ob_round calls 2: ob_catob_catn
87func ob_lname(buf: *u8, k: i64) -> i64
called by 1: ob_round calls 2: ob_catob_catn
96func ob_lnamem(buf: *u8, k: i64) -> i64
called by 1: ob_round calls 2: ob_catob_catn
105func ob_artifact(path: *u8, out: *i64) -> i64
called by 1: main calls 1: sys_read
135func ob_round(be: i64, axis: i64, round: i64) -> i64
212func ob_med(arr: *i64, n: i64) -> i64 { return ob_rank(arr, n, n/2) }
called by 3: ob_cvpob_rngpob_axis_all calls 1: ob_rank
214func ob_rank(arr: *i64, n: i64, r: i64) -> i64
called by 2: ob_medob_cvp
245func ob_cvp(arr: *i64, n: i64) -> i64
called by 1: ob_axis_all calls 2: ob_medob_rank
253func ob_rngp(arr: *i64, n: i64) -> i64
called by 1: ob_axis_all calls 1: ob_med
276func ob_axis_all(axis: i64, out: *i64) -> i64
called by 1: main calls 4: ob_roundob_medob_cvpob_rngp
308func ob_axname(axis: i64) -> *u8
called by 1: main
314func ob_bename(be: i64) -> *u8
called by 1: main
321func ob_tier(be: i64) -> *u8
called by 1: main
332func ob_selfcheck() -> i64
called by 1: main calls 4: ob_pob_nssys_sleep_msob_pn
371func main(argc: i64, argv: *i64) -> i64