code wiki / _hdl_build / nx_osbench_judge.nx

nx_osbench_judge.nx

buildroot/runtime/_hdl_build/nx_osbench_judge.nx

17379 B363 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind bench
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_itoa_lib.nx nx_osbench_judge.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 oj_span_eq oj_len oj_selftest oj_p oj_w oj_len ↻ sys_write oj_classify oj_pn oj_wn nxi_fd sys_mmap ccz_cat_num sys_write ↻ sys_munmap sys_exit oj_p ↻ sys_mmap ↻ oj_read sys_openat_rd sys_read sys_close oj_lineend oj_col oj_span_cpy oj_span_num oj_pn ↻ oj_classify ↻ sys_write ↻ oj_vname oj_scored sys_openat_append oj_w ↻ oj_wn ↻ sys_close ↻

structs

none

consts

28const OJ_MAGIC_1643: i64 = 1643
29const OJ_MAGIC_1541: i64 = 1541
31const OJ_DAT: *u8 = "knowledge/status/osbench_measured.dat"
32const OJ_WTS: *u8 = "knowledge/registry/osbench_weights.tsv"
33const OJ_LOG: *u8 = "knowledge/status/osbench_judge.log"
34const OJ_CAP: i64 = 262144
35const OJ_TAB: i64 = 9
36const OJ_NL: i64 = 10
37const OJ_HASH: i64 = 35
38const OJ_MODE: i64 = 420
39const OJ_SLOTS: i64 = 24
40const OJ_SLOTW: i64 = 40
42const OJ_CV_MAX: i64 = 100
43const OJ_PAR_LO: i64 = 950
44const OJ_PAR_HI: i64 = 1050
45const OJ_IMPL_LO: i64 = 100
46const OJ_IMPL_HI: i64 = 10000
48const OJ_EXCEEDS: i64 = 0
49const OJ_PARITY: i64 = 1
50const OJ_BEHIND: i64 = 2
51const OJ_R_UNSTABLE: i64 = 3
52const OJ_R_XTIER: i64 = 4
53const OJ_R_IMPL: i64 = 5
54const OJ_R_BADSTAT: i64 = 6

functions

56func oj_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 2: oj_wmain
57func oj_w(fd: i64, s: *u8) -> i64 { let n: i64 = oj_len(s); sys_write(fd, s, n); return 0 }
called by 2: oj_pmain calls 2: oj_lensys_write
58func oj_p(s: *u8) -> i64 { return oj_w(1, s) }
called by 2: oj_selftestmain calls 1: oj_w
63func oj_wn(fd: i64, v: i64) -> i64 { nxi_fd(fd, v); return 0 }
called by 2: oj_pnmain calls 1: nxi_fd
64func oj_pn(v: i64) -> i64 { return oj_wn(1, v) }
called by 2: oj_selftestmain calls 1: oj_wn
67func oj_read(path: *u8, buf: *u8) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
86func oj_lineend(q: *u8, i: i64, n: i64) -> i64
called by 1: main
93func oj_col(q: *u8, ls: i64, le: i64, c: i64, out: *i64) -> i64
called by 1: main
109func oj_span_eq(q: *u8, s: i64, e: i64, lit: *u8) -> i64
called by 1: main
115func oj_span_num(q: *u8, s: i64, e: i64) -> i64
called by 1: main
128func oj_span_cpy(q: *u8, s: i64, e: i64, dst: *u8) -> i64
called by 1: main
136func oj_classify(ratio: i64, cv: i64, tierok: i64) -> i64
called by 2: oj_selftestmain
151func oj_vname(v: i64) -> *u8
called by 1: main
160func oj_scored(v: i64) -> i64
called by 1: main
169func oj_selftest() -> i64
called by 1: main calls 3: oj_poj_classifyoj_pn
211func main(argc: i64, argv: *i64) -> i64