code wiki / _hdl_build / nx_search_bench.nx
nx_search_bench.nx
buildroot/runtime/_hdl_build/nx_search_bench.nx
about
nx_search_bench.nx -- REAL head-to-head onsite-search benchmark (operator: benchmark vs a real
incumbent, get baseline from Google Scholar). BASELINE = Google Scholar's actual ranked results for
"web development" (fetched live via the browse tool) with real citation counts as the authority
signal. METRIC = citation-graded nDCG@10 (standard IR), discount table as DATA. Compares Scholar's
relevance ranking vs OUR BM25 ranker over the SAME 10 results. HONEST SCOPE: 1 query, 10 docs (a real
slice, not full BEIR -- W-BENCH-DATA-001); data + metric REAL, nothing fabricated. Hand-written =
motivates X-AUT-GATE-001 (team authors benchmarks). license_tier: ORIGINAL
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
| 10 | const K_MAGIC_22000000: i64 = 22000000 |
| 11 | const K_MAGIC_1269: i64 = 1269 |
| 12 | const K_MAGIC_1717: i64 = 1717 |
functions
| 14 | func sb_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 19 | func sb_n(v: i64) -> i64 { nxi_out(v); return 0 } |
| 21 | func sb_doclen(s: *u8) -> i64 { var n: i64=0; var t: i64=0; var inw: i64=0; while s[n]!=(0 as u8){ if s[n]==(32 as u8){inw=0} else { if inw==0{t=t+1;inw=1} } n=n+1 } return t } called by 1: sb_score_all |
| 23 | func sb_tok_end(s: *u8, start: i64) -> i64 { var e: i64=start; var fe: i64=1; while fe==1 { if s[e]==(0 as u8){fe=0} else { if s[e]==(32 as u8){fe=0} else {e=e+1} } } return e } called by 1: sb_tf |
| 25 | func sb_tf(s: *u8, term: *u8) -> i64 |
| 44 | func sb_bm25(tf: i64, doclen: i64, avgdl: i64) -> i64 called by 1: sb_score_all |
| 53 | func sb_score_all(titles: *i64, n: i64, score: *i64) -> i64 |
| 69 | func sb_rank(score: *i64, n: i64, ord: *i64) -> i64 |
| 84 | func sb_dcg(gain: *i64, order: *i64, disc: *i64, n: i64) -> i64 called by 1: main |
| 90 | func main() -> i64 |