code wiki / _hdl_build / nx_web_relevance_bench.nx
nx_web_relevance_bench.nx
buildroot/runtime/_hdl_build/nx_web_relevance_bench.nx
about
nx_web_relevance_bench.nx -- MEASURED RELEVANCE for the WEB engine (the SOTA RULER the operator asked for:
"state of the art from the first byte up" = MEASURE quality, then climb the rungs the ruler demands). A judged
query set driven through the LIVE serve over LOOPBACK (127.0.0.1:18456 /api/search?scope=web) -- exercises the
exact production stack (BM25 + R1c title + R1b proximity + R1d coordination + R1e search-page + PageRank
authority + host-diversity) as a small HTTP client (no in-process shard mmap -> no fork-RLIMIT wall). Judged by
the expected canonical HOST appearing in a result URL. Metrics (integer, Q10=v/1024):
hit@1, hit@10, MRR@10 (1024/rank), meanDCG@10 (1024*1024/ilog2_1024(rank+1)).
Output goes to BOTH stdout AND knowledge/status/webrelbench.txt (so the result survives even if the edge drops
the tools/call response on a >15s run -- read the file via nx_fs). RATCHET: GREEN floor MRR@10>=500; RAISE it as
the engine improves, NEVER lower it. license_tier: ORIGINAL
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_connect.nxnx_intlog.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
| 14 | const WRB_MAGIC_1024: i64 = 1024 |
| 15 | const WRB_MAGIC_262144: i64 = 262144 |
| 17 | const WRB_PORT: i64 = 18456 |
| 18 | const WRB_OUTCAP: i64 = 1048576 |
| 126 | const WRB_NCLS: i64 = 5 |
| 127 | const WRB_C_NAV: i64 = 0 // navigational: an official site is the unambiguous answer |
| 128 | const WRB_C_ENT: i64 = 1 // entity: a person/org, canonical profile or encyclopedia entry |
| 129 | const WRB_C_NL: i64 = 2 // natural language: informational questions -- the measured semantic weak spot |
| 130 | const WRB_C_INTL: i64 = 3 // multilingual: non-Latin scripts (regression fence for the UTF-8 tokenizer) |
| 131 | const WRB_C_TECH: i64 = 4 // long-tail technical: narrow subjects, tests depth not popularity |
functions
| 23 | func wrb_out(s: *u8, n: i64) -> i64 { var i: i64 = 0; while i < n { wrb_buf[wrb_bo] = s[i]; wrb_bo = wrb_bo + 1; i = i + 1 } return 0 } |
| 24 | func wrb_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 25 | func wrb_puts(s: *u8) -> i64 { wrb_out(s, wrb_slen(s)); return 0 } |
| 26 | func wrb_num(v: i64) -> i64 |
| 35 | func wrb_hex(v: i64) -> i64 { if v < 10 { return 48 + v } return 55 + v } called by 1: wrb_urlenc |
| 36 | func wrb_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 } called by 1: wrb_fetch |
| 37 | func wrb_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 } called by 1: wrb_fetch |
| 38 | func wrb_urlenc(src: *u8, slen: i64, dst: *u8) -> i64 |
| 56 | func wrb_contains(hay: *u8, hn: i64, ndl: *u8) -> i64 |
| 67 | func wrb_qend(resp: *u8, start: i64, bn: i64) -> i64 called by 1: wrb_rank |
| 73 | func wrb_fetch(q: *u8, resp: *u8) -> i64 |
| 97 | func wrb_rank(q: *u8, ehost: *u8) -> i64 |
| 132 | func wrb_clsname(c: i64) -> *u8 called by 1: main |
| 139 | func wrb_one(q: *u8, ehost: *u8, cls: i64, mrr: *i64, dcg: *i64, h1: *i64, h10: *i64, nq: *i64) -> i64 |
| 150 | func main(argc: i64, argv: *i64) -> i64 |