nx_weblatbench.nx
buildroot/runtime/nx_weblatbench.nx
about
nx_weblatbench.nx -- STANDING LATENCY BENCH for the WEB serve (operator standing order 2026-08-12:
progress claims need a referee that is not the claimant -- until this organ existed, every /search
speed number was an ad-hoc probe chosen by the seat that wanted the number to look good).
Fixed 8-query set spanning every measured shape, driven through the LIVE serve over LOOPBACK
(127.0.0.1:18456 /api/search?scope=web -- the exact production stack; fetch pattern composed from
nx_web_relevance_bench). One pass per run, SEQUENTIAL (this bench must never itself hammer the box:
envelope = 8 queries/run, beat hourly, log ~200B/run).
PRE-DECLARED ACCEPT RULE (before the first run, 2026-08-12; RATCHET DOWN as rungs land, never up):
GREEN iff ok=8/8 fetches (HTTP 200 + JSON marker) AND the did-you-mean tooth fires AND
p50 <= 3000ms AND max <= 20000ms.
WHY these numbers: in-window queries measured 0.25-2.8s on 2026-08-12 (p50 3000 = that + margin);
max 20000 deliberately TOLERATES one reopen-lottery draw (measured 10.2-11.5s, debt 1786555686)
so the bench reports the tail without being permanently RED -- a detector that is always RED is
one everyone learns to ignore. When the incremental-refresh re-lands, ratchet max to 5000.
Output: per-query ms ALWAYS printed (a gate that reports only a boolean cannot say why), last line
verdict=GREEN|RED (positional anchor), exit code carries the verdict. Appends one row per run to
knowledge/status/weblatbench.log (append-only; the DISTRIBUTION over beats is the instrument --
a single run is still just a sample and must never be quoted as the population).
license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_connect.nx
imported by: nobody (leaf or entry point)
structs
| none |
consts
| 22 | const LB_MAGIC_1000000: i64 = 1000000 |
| 23 | const LB_MAGIC_8192: i64 = 8192 |
| 25 | const LB_PORT: i64 = 18456 |
| 26 | const LB_OUTCAP: i64 = 1048576 |
| 27 | const LB_NQ: i64 = 8 |
| 28 | const LB_P50CAP: i64 = 3000 |
| 29 | const LB_MAXCAP: i64 = 20000 |
functions
| 31 | func lb_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 32 | func lb_wnum(d: *u8, off: i64, v: i64) -> i64 |
| 41 | func lb_cat(d: *u8, o: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { d[o + i] = s[i]; i = i + 1 } return o + i } |
| 42 | func lb_catb(d: *u8, o: i64, s: *u8, n: i64) -> i64 { var i: i64 = 0; while i < n { d[o + i] = s[i]; i = i + 1 } return o + n } |
| 43 | func lb_hex(v: i64) -> i64 { if v < 10 { return 48 + v } return 55 + v } |
| 44 | func lb_urlenc(src: *u8, slen: i64, dst: *u8) -> i64 |
| 63 | func lb_contains(hay: *u8, hn: i64, ndl: *u8) -> i64 |
| 76 | func lb_now_us() -> i64 |
| 83 | func lb_wall_epoch() -> i64 |
| 89 | func lb_fetch(q: *u8, resp: *u8) -> i64 |
| 120 | func main() -> i64 |