code wiki / _hdl_build / nx_qabench.nx
nx_qabench.nx
buildroot/runtime/_hdl_build/nx_qabench.nx
about
nx_qabench.nx -- the QA-benchmark LADDER (operator 2026-07-07: "use others like beerqa, climb the ladder to
the top"). Runs the sovereign researcher's mechanical retrieve+extract+multi-hop pipeline (shared engine =
nx_qabench_engine, extracted from nx_drbench) across a DIFFICULTY GRADIENT and prints ONE scoreboard:
RUNG 1-hop = SQuAD v1.1 (single context paragraph -> isolates EXTRACTION from retrieval; should score HIGH)
RUNG 2-hop = HotpotQA distractor (retrieve 2 of 10 paras + bridge reasoning -> the reasoning wall)
Same F1/EM metric (nx_qa_score_lib, integer permille), same extractor -> the F1 DROP as hops rise is the
honest, MEASURED "where mechanical ends and reasoning/LLM begins" signal. Each benchmark: T-parse + T-negctl
(rotated-gold F1 ~0 = metric not rigged). Formats dispatched by `fmt` (0=hotpot distractor, 1=squad single).
expect_exit: 0 license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_qabench_engine.nxnx_qwen_extract.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
| 12 | const SEM_MAGIC_260000: i64 = 260000 |
| 13 | const SEM_MAGIC_32760: i64 = 32760 |
| 14 | const SEM_MAGIC_4096: i64 = 4096 |
| 15 | const SEM_MAGIC_536870912: i64 = 536870912 |
| 16 | const SEM_MAGIC_262144: i64 = 262144 |
| 17 | const SEM_MAGIC_4000: i64 = 4000 |
| 18 | const SEM_MAGIC_200000: i64 = 200000 |
| 19 | const SEM_MAGIC_2000: i64 = 2000 |
| 20 | const SEM_MAGIC_8000: i64 = 8000 |
| 21 | const SEM_MAGIC_1024: i64 = 1024 |
| 22 | const SEM_MAGIC_2000000000: i64 = 2000000000 |
| 23 | const SEM_MAGIC_16777216: i64 = 16777216 |
| 24 | const SEM_MAGIC_402653184: i64 = 402653184 |
| 25 | const SEM_MAGIC_10000: i64 = 10000 |
| 26 | const SEM_MAGIC_2026: i64 = 2026 |
| 27 | const SEM_MAGIC_2500: i64 = 2500 |
| 28 | const SEM_MAGIC_1000000: i64 = 1000000 |
| 29 | const SEM_MAGIC_2048: i64 = 2048 |
| 30 | const SEM_MAGIC_32768: i64 = 32768 |
| 31 | const SEM_MAGIC_1048576: i64 = 1048576 |
| 32 | const SEM_MAGIC_524288: i64 = 524288 |
| 33 | const SEM_MAGIC_8192: i64 = 8192 |
| 34 | const SEM_MAGIC_65536: i64 = 65536 |
| 35 | const SEM_MAGIC_8388608: i64 = 8388608 |
| 36 | const SEM_MAGIC_16384: i64 = 16384 |
| 37 | const SEM_MAGIC_3999: i64 = 3999 |
| 267 | const SEM_VMAX: i64 = 1024 |
| 268 | const SEM_W: i64 = 6 |
| 842 | const RD_NF: i64 = 14 |
| 1227 | const DUMP_NF: i64 = 17 |
functions
| 44 | func qa_is_prose(src: *u8, start: i64, ln: i64) -> i64 called by 1: qa_split_prose |
| 74 | func qa_clean_sentence(src: *u8, start: i64, ln: i64, dst: *u8) -> i64 called by 1: qa_split_prose |
| 97 | func qa_split_prose(g: *i64, src: *u8, slen: i64) -> i64 |
| 137 | func qab_split_ctx(g: *i64, src: *u8, slen: i64) -> i64 called by 1: qab_load_squad |
| 184 | func db_match_bracket(g: *i64, pos: i64) -> i64 |
| 207 | func qab_split_append(g: *i64, src: *u8, slen: i64, para: i64, st: *i64) -> i64 called by 1: qab_load_musique |
| 270 | func sem_isqrt(v: i64) -> i64 |
| 279 | func sem_vfind(g: *i64, buf: *u8, off: i64, len: i64) -> i64 |
| 292 | func sem_vadd(g: *i64, buf: *u8, off: i64, len: i64) -> i64 |
| 311 | func sem_build_vocab(g: *i64) -> i64 |
| 342 | func sem_build_cooc(g: *i64) -> i64 |
| 389 | func sem_addrow(g: *i64, vec: *i64, t: i64) -> i64 |
| 399 | func sem_qvec(g: *i64, vec: *i64) -> i64 |
| 419 | func sem_svec(g: *i64, s: i64, vec: *i64) -> i64 |
| 440 | func sem_cos(a: *i64, b: *i64, vc: i64) -> i64 |
| 459 | func ppmi_load(g: *i64) -> i64 |
| 514 | func ppmi_cos(g: *i64, a: i64, b: i64) -> i64 |
| 541 | func ppmi_wid(g: *i64, buf: *u8, off: i64, len: i64) -> i64 |
| 551 | func ppmi_best_sentence(g: *i64, pa: i64, pb: i64) -> i64 |
| 619 | func sem_best_sentence(g: *i64, pa: i64, pb: i64) -> i64 |
| 624 | func sem_best_sentence_perrow(g: *i64) -> i64 |
| 650 | func qab_load_musique(g: *i64) -> i64 called by 1: qab_load_row calls 7: db_find_keydb_skip_wsdb_bdb_match_bracketdb_dec_strqab_split_append+1 |
| 709 | func qab_load_squad(g: *i64) -> i64 |
| 745 | func qab_load_hotpot(g: *i64) -> i64 |
| 790 | func qab_load_row(g: *i64, fmt: i64) -> i64 called by 3: rd_train_filerd_dump_fileqab_run calls 3: qab_load_squadqab_load_musiqueqab_load_hotpot |
| 797 | func qab_f1(g: *i64, fmt: i64, pred: *u8) -> i64 |
| 812 | func qab_em(g: *i64, fmt: i64, pred: *u8) -> i64 |
| 844 | func rd_wants_entity(g: *i64) -> i64 |
| 860 | func rd_wants_place(g: *i64) -> i64 |
| 881 | func rd_candwc(g: *i64, ci: i64) -> i64 called by 1: rd_feat |
| 893 | func rd_feat(g: *i64, ci: i64, s: i64, best_s: i64, feat: *i64) -> i64 |
| 942 | func rd_score(g: *i64, feat: *i64) -> i64 |
| 953 | func rd_candstr(g: *i64, s: i64, ci: i64, out: *u8) -> i64 |
| 974 | func rd_setgold(g: *i64, gold: *u8) -> i64 |
| 983 | func rd_f1(g: *i64, cand: *u8) -> i64 |
| 1004 | func rd_enumerate(g: *i64, top1: i64, top2: i64, best_s: i64) -> i64 |
| 1036 | func rd_oracle(g: *i64, top1: i64, top2: i64, best_s: i64, gold: *u8) -> i64 |
| 1057 | func rd_pick(g: *i64, top1: i64, top2: i64, best_s: i64, pred: *u8) -> i64 |
| 1079 | func rd_train_row(g: *i64, gold: *u8, top1: i64, top2: i64, best_s: i64) -> i64 |
| 1118 | func rd_train_file(g: *i64, path: *u8, fmt: i64) -> i64 called by 1: rd_train calls 9: db_read_rawdb_body_startqab_load_rowdb_norm_rowdb_score_rowdb_top_para+3 |
| 1155 | func rd_persist(g: *i64) -> i64 |
| 1174 | func rd_train(g: *i64) -> i64 |
| 1202 | func rd_load(g: *i64) -> i64 |
| 1231 | func embed_load(g: *i64) -> i64 |
| 1260 | func dense_cos_int(g: *i64, a: i64, b: i64) -> i64 |
| 1288 | func rd_setqppmi(g: *i64) -> i64 |
| 1308 | func rd_emb_feats(g: *i64, candstr: *u8, out: *i64) -> i64 |
| 1350 | func rd_setqemb(g: *i64) -> i64 |
| 1377 | func rd_emb_vec(g: *i64, candstr: *u8, out: *i64) -> i64 |
| 1425 | func rd_dump_text_row(g: *i64, gold: *u8, fd: i64) -> i64 |
| 1460 | func rd_dump_texts(g: *i64) -> i64 |
| 1479 | func rd_dump_texts_xl(g: *i64) -> i64 |
| 1506 | func rd_dump_row(g: *i64, gold: *u8, top1: i64, top2: i64, best_s: i64, fd: i64) -> i64 called by 1: rd_dump_file calls 9: rd_dump_text_rowrd_enumeraterd_setgoldrd_candstrrd_f1rd_setqppmi+3 |
| 1549 | func rd_dump_file(g: *i64, path: *u8, fmt: i64, fd: i64, cap: i64) -> i64 |
| 1576 | func rd_dump_feats(g: *i64) -> i64 |
| 1600 | func qab_run(g: *i64, path: *u8, fmt: i64, label: *u8, res: *i64, base: i64) -> i64 |
| 1751 | func main(argc: i64, argv: *i64) -> i64 |
| 1934 | func qab_max4(a: i64, b: i64, c: i64, d: i64) -> i64 called by 1: main |
| 1944 | func qab_bind(rdr: i64, orc: i64) -> i64 |
| 1951 | func qa_read_file(path: *u8, buf: *u8, cap: i64) -> i64 |
| 1973 | func qa_read_source(g: *i64, ctxpath: *u8, pred: *u8) -> i64 called by 2: qa_answerqa_research calls 16: qa_read_fileqa_split_prosedb_norm_rowdb_score_rowdb_top_paradb_best_sentence+10 |
| 2027 | func qa_streq(a: *u8, b: *u8) -> i64 |
| 2034 | func qa_lc(c: i64) -> i64 { if c >= 65 { if c <= 90 { return c + 32 } } return c } called by 1: qa_contains_ci |
| 2035 | func qa_slen(s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { i = i + 1 } return i } |
| 2038 | func qa_contains_ci(hay: *u8, needle: *u8) -> i64 |
| 2055 | func qa_answer_agree(a: *u8, b: *u8) -> i64 |
| 2064 | func qa_answer(g: *i64, question: *u8, ctxpath: *u8) -> i64 |
| 2088 | func qa_research(g: *i64, question: *u8, argv: *i64, cstart: i64, argc: i64) -> i64 |
| 2141 | func qa_strcpy(dst: *u8, src: *u8) -> i64 called by 1: qa_research |