code wiki / _hdl_build / nx_osbench_judge.nx
nx_osbench_judge.nx
buildroot/runtime/_hdl_build/nx_osbench_judge.nx
about
nx_osbench_judge.nx -- rung F855 (lane osbench). The JUDGE: reads knowledge/status/osbench_measured.dat
and COMPUTES every verdict from the numbers. It asserts nothing and it trusts nothing.
Mirrors the proven nx_container_bench judge contract (measure elsewhere, grade here, refuse a
different-config axis as an exceed) and adds the TIER rule that eats debt seq285.
★ THE THREE LIAR-KILLERS ARE NOT HYPOTHETICAL -- each one is a defect this lane actually shipped
and had to catch by hand on 2026-07-20. The judge exists so the NEXT one is caught mechanically:
L1 IMPLAUSIBLE a like-for-like store ratio beyond 10x either way is refused, not scored.
The harness really did emit a 30-permille (33x) "win" that was pure leak-bias
(Linux dir grew every run, NishiOS got a fresh image). This tooth catches that
class WITHOUT needing anyone to notice a trend across runs.
L2 CROSS-TIER only the sanctioned same-tier pair scores. An in-memory store compared against
an on-disk one is durability-asymmetric (the original seq285 18x artifact).
L3 UNSTABLE a ratio whose own cv exceeds the threshold is refused. Measured noise is not a
result, and on a noisy host EVERYTHING must refuse -- that is the tooth working.
★ MISSION COVERAGE: weights live in knowledge/registry/osbench_weights.tsv (rule 11, data not code).
The operator mission is RAW KERNEL PERFORMANCE, so context_switch/ipc/thread_spawn/syscall_trap
carry 750 of 1000 -- and none of them is measurable yet. The judge therefore reports what share of
the MISSION WEIGHT it could actually score, so a good number on the cheap axes can never be
mistaken for a good number on the mission. An index without its coverage is a gap in a costume.
VERBS: judge (default) | selftest (runs L1/L2/L3 against synthetic rows, in-process)
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
| 28 | const OJ_MAGIC_1643: i64 = 1643 |
| 29 | const OJ_MAGIC_1541: i64 = 1541 |
| 31 | const OJ_DAT: *u8 = "knowledge/status/osbench_measured.dat" |
| 32 | const OJ_WTS: *u8 = "knowledge/registry/osbench_weights.tsv" |
| 33 | const OJ_LOG: *u8 = "knowledge/status/osbench_judge.log" |
| 34 | const OJ_CAP: i64 = 262144 |
| 35 | const OJ_TAB: i64 = 9 |
| 36 | const OJ_NL: i64 = 10 |
| 37 | const OJ_HASH: i64 = 35 |
| 38 | const OJ_MODE: i64 = 420 |
| 39 | const OJ_SLOTS: i64 = 24 |
| 40 | const OJ_SLOTW: i64 = 40 |
| 42 | const OJ_CV_MAX: i64 = 100 |
| 43 | const OJ_PAR_LO: i64 = 950 |
| 44 | const OJ_PAR_HI: i64 = 1050 |
| 45 | const OJ_IMPL_LO: i64 = 100 |
| 46 | const OJ_IMPL_HI: i64 = 10000 |
| 48 | const OJ_EXCEEDS: i64 = 0 |
| 49 | const OJ_PARITY: i64 = 1 |
| 50 | const OJ_BEHIND: i64 = 2 |
| 51 | const OJ_R_UNSTABLE: i64 = 3 |
| 52 | const OJ_R_XTIER: i64 = 4 |
| 53 | const OJ_R_IMPL: i64 = 5 |
| 54 | const OJ_R_BADSTAT: i64 = 6 |
functions
| 56 | func oj_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 57 | func oj_w(fd: i64, s: *u8) -> i64 { let n: i64 = oj_len(s); sys_write(fd, s, n); return 0 } |
| 58 | func oj_p(s: *u8) -> i64 { return oj_w(1, s) } |
| 63 | func oj_wn(fd: i64, v: i64) -> i64 { nxi_fd(fd, v); return 0 } |
| 64 | func oj_pn(v: i64) -> i64 { return oj_wn(1, v) } |
| 67 | func oj_read(path: *u8, buf: *u8) -> i64 |
| 86 | func oj_lineend(q: *u8, i: i64, n: i64) -> i64 called by 1: main |
| 93 | func oj_col(q: *u8, ls: i64, le: i64, c: i64, out: *i64) -> i64 called by 1: main |
| 109 | func oj_span_eq(q: *u8, s: i64, e: i64, lit: *u8) -> i64 called by 1: main |
| 115 | func oj_span_num(q: *u8, s: i64, e: i64) -> i64 called by 1: main |
| 128 | func oj_span_cpy(q: *u8, s: i64, e: i64, dst: *u8) -> i64 called by 1: main |
| 136 | func oj_classify(ratio: i64, cv: i64, tierok: i64) -> i64 |
| 151 | func oj_vname(v: i64) -> *u8 called by 1: main |
| 160 | func oj_scored(v: i64) -> i64 called by 1: main |
| 169 | func oj_selftest() -> i64 |
| 211 | func main(argc: i64, argv: *i64) -> i64 |