code wiki / (root) / nx_rrf.nx

nx_rrf.nx

buildroot/runtime/nx_rrf.nx

1816 B48 linesdepth 4pulls 4 transitivereach 15 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_rrf.nx -- Reciprocal Rank Fusion (bits-up, Q16.16). module: nishi-core.search.rrf depends: fx.nx, syscalls.nx capability: CORE_COMPUTE wired_status: FULLY_WIRED genealogy_id: cormack_clarke_buettcher_2009_rrf WHY: the leaderboard needs to combine multiple ranking signals -- the source- tier PRIOR and the BM25 content score (nx_bm25), later novelty (nx_simhash) and provenance -- without tuning weights or breaking determinism. RRF fuses rankings by rank position alone: score(item) = sum over rankers of 1/(k + rank). It is parameter-free (k=60), monotone, and integer-exact in Q16.16. Crucially it neutralizes SEO: an item must rank well in BOTH the tier and the content ranker to top the fused list, so thin junk cannot ride domain authority and a unique low-tier page with strong content relevance still rises.

dependencies 2 imports · 6 importers

fx.nx syscalls.nx nx_rrf.nx nx_rank_fused.nx nx_recall_fuse.nx nx_researcher_fuse_gate.nx nx_rrf_test.nx rf_authored.nx rf_authored2.nx

imports: fx.nxsyscalls.nx

imported by: nx_rank_fused.nxnx_recall_fuse.nxnx_researcher_fuse_gate.nxnx_rrf_test.nxrf_authored.nxrf_authored2.nx

structs

none

consts

22const NX_RRF_K: i64 = 60 // Cormack-Clarke-Buettcher SIGIR 2009 default

functions

27func nx_rrf_add(order: *i64, m: i64, scores_out: *i64) -> i64
39func nx_rrf_argmax(scores: *i64, n: i64) -> i64