code wiki / _hdl_build / nx_qrels_bench.nx

nx_qrels_bench.nx

buildroot/runtime/_hdl_build/nx_qrels_bench.nx

45601 B773 linesdepth 5pulls 13 transitivereach 0 importersview sourcekind bench
docsdependenciesstructsconstsfunctions

about

nx_qrels_bench.nx -- THE PER-DOCUMENT RELEVANCE RULER (Q7 runner, 2026-09-04). WHY IT EXISTS. The estate's incumbent web ruler judges by EXPECTED HOST, and that is not a detail -- it is why it could not see any defect found on 2026-09-04. "Icing (aeronautics)" at rank 1 for the query "ice cream" sits on en.wikipedia.org and therefore scored a PERFECT hit@1, while the stored document does not contain the word "cream" anywhere. A HOST IS NOT AN ANSWER. This runner scores against knowledge/search_qrels.conf, whose judgements are per URL. COMPOSED, NOT REIMPLEMENTED, ON BOTH SIDES: retrieval -- dss_search over the SAME code path /search serves, so the number describes the live engine rather than a reimplementation of it. Deliberately NO HTTP: an organ that fetches its own daemon measures the transport too, and would queue behind the serve it is grading. metrics -- nx_ir_eval (ie_ndcg_at_k, ie_mrr, ie_hits_at_k, ie_precision_at_k, ie_ap), the estate's Q16.16 integer-exact floor. A second metric implementation is the duplicate-ruler defect. SCOPE, INHERITED FROM THE QRELS FILE AND NOT WEAKENED HERE: that set is a BOOTSTRAP -- its candidates were pooled from the engine's own required-term arm, so it measures whether known-good documents rank UP and it CANNOT prove recall over documents that arm never retrieved. The recall figure is therefore recall over the JUDGED POOL, and it is emitted as judged_recall_permil so nobody reads it as the other thing. GRADE 0 IS A JUDGEMENT, NOT A GAP. A result absent from the file scores 0 deliberately: the file records every document examined per query, so "unlisted" means "examined and judged irrelevant" -- which is exactly how a stem-variant-only match (icing for ice, warring for wars) is meant to score.

dependencies 3 imports · 0 importers

nx_docportal_search_seg.nx nx_ir_eval.nx nx_gate_verdict.nx nx_qrels_bench.nx

imports: nx_docportal_search_seg.nxnx_ir_eval.nxnx_gate_verdict.nx

imported by: nobody (leaf or entry point)

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

main qb_eqz qb_main gv_head gv_puts sys_write gv_ctr sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ gv_kv gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap gv_check gv_puts ↻ gv_verdict gv_note_bare_rate gv_bare_rate gv_at gv_obj_has_n gv_at ↻ gv_puts ↻ gv_num ↻ gv_puts ↻ gv_num ↻

structs

none

consts

28const QB_PATH: *u8 = "knowledge/search_qrels.conf"
29const QB_PATH_UP: *u8 = "../knowledge/search_qrels.conf" // same file seen from a buildroot CWD
30const QB_DOMAIN: *u8 = "web"
31const QB_MAXQ: i64 = 64
32const QB_MAXREL: i64 = 1024
33const QB_K: i64 = 10 // DSS_MAXR is 30, so scoring @5 would discard two thirds of the page
34const QB_TOPN: i64 = 30
35const QB_QBUF: i64 = 128
36const QB_UBUF: i64 = 512
37const QB_PATHCAP: i64 = 1024
38const QB_BOX: i64 = 16
39const QB_PIPE: i64 = 124
40const QB_NL: i64 = 10
41const QB_CR: i64 = 13 // CRLF-generated data files leave this as the last byte of a field
42const QB_HASH: i64 = 35
43const QB_D0: i64 = 48
44const QB_D9: i64 = 57
45const QB_B10: i64 = 10
46const QB_PERMIL: i64 = 1000
47const QB_Q16: i64 = 65536 // nx_ir_eval returns Q16.16 fixed point, NOT permil (mrr=65536 == 1.0)
48const QB_FAMCAP: i64 = 32 // a family is a COARSE signal class (lexical/human/neural), not a label
49const QB_LC_AUTO: i64 = 0
50const QB_LC_HUMAN: i64 = 1
51const QB_SP: i64 = 32
52const QB_CONTENT_MIN: i64 = 3 // S4: a CONTENT term. 1-2 char tokens in these queries are
55const QB_CROSSOVER_TOKENS: i64 = 10000000 // S1: the published BM25 scale crossover, in corpus tokens
56const QB_EPOCH_FLOOR: i64 = 1750000000 // S2: below this is not a date, it is an UNSET CLOCK. A run

functions

60func qb_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
61func qb_eqz(a: *u8, b: *u8) -> i64
73func qb_cpn(dst: *u8, cap: i64, src: *u8, n: i64) -> i64
94func qb_eol(buf: *u8, n: i64, i: i64) -> i64
called by 1: qb_load
104func qb_pipe(buf: *u8, e: i64, i: i64) -> i64
called by 1: qb_load
112func qb_atoi(buf: *u8, s: i64, e: i64) -> i64
called by 1: qb_load
125func qb_isword(c: i64) -> i64
called by 1: qb_hasword
131func qb_hasword(hay: *u8, needle: *u8) -> i64
called by 1: qb_lexalign calls 2: qb_slenqb_isword
168func qb_tier(rlc: *i64, nr: i64) -> i64
called by 1: qb_main
181func qb_benchver(bench: *u8, epoch: i64) -> i64
called by 1: qb_main calls 1: qb_slen
193func qb_lexalign(orig: *u8, rewrite: *u8, doctext: *u8) -> i64
called by 1: qb_main calls 3: qb_slenqb_cpnqb_hasword
247func qb_publish_ok(judgefam: *u8, rankerfam: *u8, tier: i64) -> i64
called by 1: qb_main calls 2: qb_slenqb_eqz
258func qb_load(buf: *u8, n: i64, qtext: *u8, nq: *i64,
335func qb_grade(qi: i64, url: *u8, rqi: *i64, rgr: *i64, rurl: *u8, nr: i64) -> i64
called by 1: qb_arm calls 1: qb_eqz
353func qb_arm(h: *i64, qtext: *u8, nq: i64, rqi: *i64, rgr: *i64, rurl: *u8, nr: i64, out: *i64) -> i64
469func qb_expand_ab(h: *i64, qtext: *u8, nq: i64, rqi: *i64, rgr: *i64, rurl: *u8, nr: i64,
called by 1: qb_main calls 2: dss_set_expand_offqb_arm
484func qb_main() -> i64
767func main(argc: i64, argv: *i64) -> i64