code wiki / (root) / nx_beir_arms_lib.nx

nx_beir_arms_lib.nx

buildroot/runtime/nx_beir_arms_lib.nx

4070 B64 linesdepth 0pulls 0 transitivereach 2 importersview sourcekind librarytopic beir
docsdependenciesstructsconstsfunctions

about

nx_beir_arms_lib.nx -- THE ONE CHOOSER of the arm the BRIGHT sweep writes into search.leaderboard (search R0f, 2026-09-16). WHY A LIB: be_bright used to choose between plain BM25 and the BM25Q RRF fusion only, so the cross-encoder arm's twelve-split average was read by nobody and could never reach the row -- a whole day of rerank compute would have left the placement at the lexical floor with nothing in the receipt saying so. The choice is a pure function of the sweep's own averages so an in-process gate can hold every branch (nx_beir_arms_gate), and the harness composes it. THE RULES, each pre-declared on search.plan before the run that could benefit from it: plain the floor; always eligible fused the BM25Q RRF arm: eligible only when its own rule held in the SAME sweep (fusion beat plain on the long subset AND every no-repeat query ranked identically), and its average is at least the plain average prf RM3-style pseudo-relevance feedback (R0g): eligible only when EVERY split measured it and it EXCEEDS plain and the best so far -- the non-reasoning expansion control the R0c rewriter must beat crossenc the sovereign BERT cross-encoder rerank over a LICENSED data asset: eligible only when EVERY split measured it (a partial average is not a placement) and it EXCEEDS plain BM25 (the R0 accept rule) and the best so far cefusion RRF over the BM25 order and the cross-encoder order: same eligibility as crossenc; it displaces the pure rerank only when STRICTLY higher, so a tie keeps the simpler arm license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 0 imports · 2 importers

nx_beir_arms_lib.nx nx_beir_arms_gate.nx nx_beir_eval.nx

imports: none

imported by: nx_beir_arms_gate.nxnx_beir_eval.nx

structs

none

consts

20const BA_ARM_PLAIN: i64 = 0
21const BA_ARM_FUSED: i64 = 1
22const BA_ARM_CE: i64 = 2
23const BA_ARM_CEF: i64 = 3
24const BA_ARM_PRF: i64 = 4

functions

26func be_lb_choose(avg: i64, fq_avg: i64, fusion_ok: i64, prf_n: i64, prf_avg: i64, ce_n: i64, ce_avg: i64, cef_avg: i64, nsplits: i64) -> i64
called by 2: mainbe_bright
40func be_lb_arm_score(arm: i64, avg: i64, fq_avg: i64, prf_avg: i64, ce_avg: i64, cef_avg: i64) -> i64
called by 2: mainbe_bright
48func be_lb_arm_label(arm: i64) -> *u8
called by 2: mainbe_bright
58func be_lb_arm_org(arm: i64) -> *u8
called by 1: be_bright