code wiki / _hdl_build / nx_osbench_micro.nx
nx_osbench_micro.nx
buildroot/runtime/_hdl_build/nx_osbench_micro.nx
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
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
structs
| none |
consts
| 27 | const OB_MAGIC_4096: i64 = 4096 |
| 28 | const OB_MAGIC_100000: i64 = 100000 |
| 29 | const OB_MAGIC_1000000: i64 = 1000000 |
| 31 | const OB_N: i64 = 200 |
| 32 | const OB_ROUNDS: i64 = 15 |
| 33 | const OB_WARM: i64 = 20 |
| 34 | const OB_PAY: i64 = 64 |
| 35 | const OB_MODE: i64 = 420 |
| 36 | const OB_NSEC: i64 = 1000000000 |
| 37 | const OB_HMUL: i64 = 1000003 |
| 38 | const OB_ELFCAP: i64 = 1048576 |
| 39 | const OB_UNSTABLE_PERMIL: i64 = 100 |
functions
| 41 | func ob_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 42 | func ob_p(s: *u8) -> i64 { let n: i64 = ob_len(s); sys_write(1, s, n); return 0 } |
| 43 | func ob_w(fd: i64, s: *u8) -> i64 { let n: i64 = ob_len(s); sys_write(fd, s, n); return 0 } |
| 49 | func ob_wn(fd: i64, v: i64) -> i64 { nxi_fd(fd, v); return 0 } |
| 50 | func ob_pn(v: i64) -> i64 { return ob_wn(1, v) } |
| 53 | func ob_ns(ts: *i64) -> i64 |
| 61 | func ob_catn(buf: *u8, o: i64, v: i64) -> i64 |
| 72 | func ob_cat(buf: *u8, o: i64, s: *u8) -> i64 |
| 80 | func ob_nname(buf: *u8, k: i64) -> i64 |
| 87 | func ob_lname(buf: *u8, k: i64) -> i64 |
| 96 | func ob_lnamem(buf: *u8, k: i64) -> i64 |
| 105 | func ob_artifact(path: *u8, out: *i64) -> i64 |
| 135 | func ob_round(be: i64, axis: i64, round: i64) -> i64 |
| 212 | func ob_med(arr: *i64, n: i64) -> i64 { return ob_rank(arr, n, n/2) } |
| 214 | func ob_rank(arr: *i64, n: i64, r: i64) -> i64 |
| 245 | func ob_cvp(arr: *i64, n: i64) -> i64 |
| 253 | func ob_rngp(arr: *i64, n: i64) -> i64 |
| 276 | func ob_axis_all(axis: i64, out: *i64) -> i64 |
| 308 | func ob_axname(axis: i64) -> *u8 called by 1: main |
| 314 | func ob_bename(be: i64) -> *u8 called by 1: main |
| 321 | func ob_tier(be: i64) -> *u8 called by 1: main |
| 332 | func ob_selfcheck() -> i64 |
| 371 | func main(argc: i64, argv: *i64) -> i64 |