code wiki / (root) / nx_ir_eval.nx

nx_ir_eval.nx

buildroot/runtime/nx_ir_eval.nx

4576 B139 linesdepth 4pulls 4 transitivereach 5 importersview sourcekind librarytopic ir
docsdependenciesstructsconstsfunctions

about

nx_ir_eval.nx -- sovereign IR evaluation metrics: THE RULER for search SOTA. module: nishi-core.search.ir_eval depends: fx.nx, syscalls.nx capability: CORE_COMPUTE wired_status: LIBRARY genealogy_id: jarvelin_kekalainen_2002_ndcg ; voorhees_trec_mrr ; trec_map WHY: "state of the art" is a MEASURED claim, never an asserted one. Before any fusion/rerank rung may claim a lift it must move a number on a FIXED ruler. This organ is that ruler -- nDCG@k, MRR, Recall@k, Precision@k, and Average Precision -- computed bit-exact in Q16.16 (fx.nx) so a score is reproducible on every target and a faked improvement cannot hide. The rank discount is 1/log2(rank+1) via fx_log2_int (Jarvelin & Kekalainen 2002), the exact use fx.nx's fixed-point log2 was built for. Conventions: gains[i] = graded relevance of the doc at 0-based rank i (>= 0). rels[i] = 1 if the doc at rank i is relevant, else 0. n = number of ranked results; k = cutoff. All ratio outputs are Q16.16 in [0, FX_ONE(=65536)]; 0 means undefined/empty.

dependencies 2 imports · 5 importers

fx.nx syscalls.nx nx_ir_eval.nx nx_ir_eval_gate.nx nx_recall_bench.nx nx_recall_eval.nx nx_recall_fuse_gate.nx nx_recall_rerank_gate.nx

imports: fx.nxsyscalls.nx

imported by: nx_ir_eval_gate.nxnx_recall_bench.nxnx_recall_eval.nxnx_recall_fuse_gate.nxnx_recall_rerank_gate.nx

structs

none

consts

none

functions

31func ie_dcg_at_k(gains: *i64, n: i64, k: i64) -> i64
49func ie_sort_desc(src: *i64, n: i64, dst: *i64) -> i64
called by 1: ie_ndcg_at_k
72func ie_ndcg_at_k(gains: *i64, n: i64, k: i64) -> i64
86func ie_mrr(rels: *i64, n: i64) -> i64
called by 2: mainmain calls 1: fx_from_frac
98func ie_hits_at_k(rels: *i64, n: i64, k: i64) -> i64
111func ie_recall_at_k(rels: *i64, n: i64, k: i64, total_relevant: i64) -> i64
called by 2: mainmain calls 2: fx_from_fracie_hits_at_k
117func ie_precision_at_k(rels: *i64, n: i64, k: i64) -> i64
called by 2: mainmain calls 2: fx_from_fracie_hits_at_k
126func ie_ap(rels: *i64, n: i64, total_relevant: i64) -> i64