nx_queries_merge.nx
buildroot/runtime/nx_queries_merge.nx
about
nx_queries_merge.nx -- REWRITE ENSEMBLE AS TERM UNION (search R0l+, 2026-09-16): join K BEIR query files row by row
into ONE queries file whose text is the space-joined union of every file's text for that query id.
WHY. Every reasoning rewrite of a query is one sample of the vocabulary the answer lives in; two rewrites of the same
query from different engines or seeds cover different terms. With the BM25Q query-term saturation already in
nx_beir_eval (S5), the union of K rewrites scores as one long query whose repeated terms saturate instead of piling
up, so a K-rewrite ensemble needs NO evaluator change: it is a queries file. This organ makes that file, and nothing
else (rank fusion of the K rankings is the next arm, and it lives in the evaluator when it comes).
CONTRACT. Every input carries the same query ids in the same order (the rewrite driver preserves the split's order),
and the organ REFUSES BY NAME on the first row whose id differs or on a row-count mismatch -- a silently misaligned
merge would score one query's rewrite against another's judgments and look like a real number. The output is
truncate-written to <out>.tmp and renamed, so a killed run leaves no half file.
nx_queries_merge <out.tsv> <in1.tsv> <in2.tsv> [<in3.tsv> ...]
exit 0 MERGED / 2 usage / 3 REFUSED (mismatch named) / 4 io
license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_queries_merge_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
| none |
functions
| 20 | func main(argc: i64, argv: *i64) -> i64 |