code wiki / _hdl_build / nx_beir_eval.nx

nx_beir_eval.nx

buildroot/runtime/_hdl_build/nx_beir_eval.nx

22111 B505 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_beir_eval.nx -- SOVEREIGN BEIR harness: real external ground truth (BEIR/nfcorpus) scored by our own integer BM25 -> mean nDCG@10 (the standard BEIR metric). The HONEST external row the maturity ladder is gated on (F236): real 3633-doc corpus + 323 test queries + 12335 graded qrels, vs the published BEIR BM25 baseline (nfcorpus nDCG@10 ~0.32, Anserini). BM25 k1=0.9 b=0.4 (BEIR defaults). IDF=log2 (ranking-invariant vs ln -> identical nDCG). Integer/fixed-point throughout (no float) = bit-reproducible. Forward index (per-doc sorted term,tf). Tokenizer = lowercase [a-z0-9] runs, NO stem / NO stopwords (v1 -- the gap to the stemmed 0.32 baseline IS the stemming rung, honestly, not a defect). expect_exit: 0 license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_qabench_engine.nx nx_ppmi_lib.nx nx_beir_eval.nx

imports: nx_qabench_engine.nxnx_ppmi_lib.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main be_read_fb be_read sys_read db_w be_find db_semhash be_tok db_semhash ↻ be_qs1 be_qs1 ↻ db_bsearch_i64 be_qs2 be_qs2 ↻ ppl_load sys_openat_rd sys_mmap sys_read ↻ sys_close be_disc be_log2_1024 ppl_tokenize_ids ppl_wid_range sys_mmap ↻ db_bsearch_i64 ↻ db_semhash ↻ ppl_maxsim_idf ppl_idf_w ppl_dcos ppl_cos ppl_isqrt db_n nxi_out nxi_fd sys_mmap ↻ ccz_cat_num sys_write sys_munmap

structs

none

consts

17const BE_KCAND: i64 = 50
19const BE_IDCAP: i64 = 4096
20const K_MAGIC_1024: i64 = 1024
21const K_MAGIC_8192: i64 = 8192
22const K_MAGIC_4096: i64 = 4096
23const K_MAGIC_1900: i64 = 1900
25const MAXDOC: i64 = 4096
26const CAPFILE: i64 = 67108864
27const NTCAP: i64 = 2000000
28const DTCAP: i64 = 2000000
29const NJCAP: i64 = 20000

functions

31func be_read(path: *u8, slot: *i64) -> i64
called by 1: be_read_fb calls 1: sys_read
49func be_read_fb(pa: *u8, pb: *u8, slot: *i64) -> i64
called by 1: main calls 1: be_read
56func be_find(buf: *u8, from: i64, limit: i64, ch: i64) -> i64
called by 1: main
69func be_tok(buf: *u8, start: i64, end: i64, out: *i64, noff: *i64, scr: *u8) -> i64
called by 1: main calls 1: db_semhash
96func be_qs1(a: *i64, lo: i64, hi: i64) -> i64
called by 2: be_qs1main calls 1: be_qs1
114func be_qs2(key: *i64, pay: *i64, lo: i64, hi: i64) -> i64
called by 2: be_qs2main calls 1: be_qs2
134func be_log2_1024(q: i64) -> i64
called by 1: main
146func be_disc(r: i64) -> i64
called by 1: main
160func main() -> i64