code wiki / _hdl_build / nx_web_relevance_bench.nx

nx_web_relevance_bench.nx

buildroot/runtime/_hdl_build/nx_web_relevance_bench.nx

13861 B225 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind benchtopic web
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_connect.nx nx_intlog.nx nx_web_relevance_bench.nx

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

main sys_mmap wrb_puts wrb_out wrb_slen wrb_one wrb_rank sys_mmap ↻ wrb_fetch sys_mmap ↻ wrb_slen ↻ wrb_urlenc wrb_hex wrb_cat wrb_catb sys_socket nx_connect_bounded nx_fcntl sys_connect sys_mmap ↻ sys_poll sys_close sys_write sys_read wrb_puts ↻ wrb_qend wrb_num sys_mmap ↻ wrb_out ↻ wrb_out ↻ wrb_contains wrb_slen ↻ ilog2_1024 wrb_clsname wrb_num ↻ sys_write ↻ sys_openat_wr sys_close ↻

structs

none

consts

14const WRB_MAGIC_1024: i64 = 1024
15const WRB_MAGIC_262144: i64 = 262144
17const WRB_PORT: i64 = 18456
18const WRB_OUTCAP: i64 = 1048576
126const WRB_NCLS: i64 = 5
127const WRB_C_NAV: i64 = 0 // navigational: an official site is the unambiguous answer
128const WRB_C_ENT: i64 = 1 // entity: a person/org, canonical profile or encyclopedia entry
129const WRB_C_NL: i64 = 2 // natural language: informational questions -- the measured semantic weak spot
130const WRB_C_INTL: i64 = 3 // multilingual: non-Latin scripts (regression fence for the UTF-8 tokenizer)
131const WRB_C_TECH: i64 = 4 // long-tail technical: narrow subjects, tests depth not popularity

functions

23func 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 }
24func wrb_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
25func wrb_puts(s: *u8) -> i64 { wrb_out(s, wrb_slen(s)); return 0 }
called by 2: wrb_rankmain calls 2: wrb_outwrb_slen
26func wrb_num(v: i64) -> i64
called by 2: wrb_rankmain calls 2: sys_mmapwrb_out
35func wrb_hex(v: i64) -> i64 { if v < 10 { return 48 + v } return 55 + v }
called by 1: wrb_urlenc
36func 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
37func 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
38func wrb_urlenc(src: *u8, slen: i64, dst: *u8) -> i64
called by 1: wrb_fetch calls 1: wrb_hex
56func wrb_contains(hay: *u8, hn: i64, ndl: *u8) -> i64
called by 1: wrb_rank calls 1: wrb_slen
67func wrb_qend(resp: *u8, start: i64, bn: i64) -> i64
called by 1: wrb_rank
73func wrb_fetch(q: *u8, resp: *u8) -> i64
97func wrb_rank(q: *u8, ehost: *u8) -> i64
132func wrb_clsname(c: i64) -> *u8
called by 1: main
139func wrb_one(q: *u8, ehost: *u8, cls: i64, mrr: *i64, dcg: *i64, h1: *i64, h10: *i64, nq: *i64) -> i64
called by 1: main calls 2: wrb_rankilog2_1024
150func main(argc: i64, argv: *i64) -> i64