code wiki / (root) / nx_bench_metrics.nx

nx_bench_metrics.nx

buildroot/runtime/nx_bench_metrics.nx

7074 B207 linesdepth 4pulls 4 transitivereach 5 importersview sourcekind benchtopic bench
docsdependenciesstructsconstsfunctions

about

nx_bench_metrics.nx -- sovereign retrieval-quality metric kernels. module: nishi-core.search.bench.metrics depends: fx.nx (Q16.16 fixed-point + fx_log2), syscalls.nx (scratch mmap) capability: CORE_COMPUTE wired_status: FULLY_WIRED The math behind the "Mount Everest of information delivery" leaderboard: score Nishi 1:1 against the real engines on a chosen turf. Built bits-up in deterministic Q16.16 fixed-point so a result is BYTE-IDENTICAL on every machine -- the two-is-one parity discipline demands that an IEEE-754 port could never satisfy (different libm log2 => different bits). All ratio/gain values are Q16.16 (FX_ONE == 1.0). Ranks + counts are plain integers. Every formula cites its source; goldens are in nx_bench_metrics_test.nx. Citations: DCG/nDCG Jarvelin & Kekalainen, ACM TOIS 2002. MAP/MRR/precision@k/recall@k Manning/Raghavan/Schutze, IIR 2008 ch.8. primary-source precision Nishi anti-Google thesis (docs/00-VISION): first-hand material (the film/photo/record itself) outranks derivative commentary. Encoded as: tier score is the graded gain; derivative results contribute zero gain even when topically relevant.

dependencies 2 imports · 2 importers

fx.nx syscalls.nx nx_bench_metrics.nx nx_bench_harness.nx nx_bench_metrics_test.nx

imports: fx.nxsyscalls.nx

imported by: nx_bench_harness.nxnx_bench_metrics_test.nx

structs

none

consts

none

functions

35func nx_bench_dcg(gains: *i64, n: i64, k: i64) -> i64
51func nx_bench_sort_desc(src: *i64, n: i64) -> *i64
called by 1: nx_bench_ndcg
80func nx_bench_ndcg(gains: *i64, n: i64, k: i64) -> i64
93func nx_bench_contains(ids: *i64, n: i64, target: i64) -> i64
103func nx_bench_precision_at_k(retr: *i64, nret: i64, rel: *i64, nrel: i64,
called by 1: main calls 2: nx_bench_containsfx_from_frac
118func nx_bench_recall_at_k(retr: *i64, nret: i64, rel: *i64, nrel: i64,
called by 1: main calls 2: nx_bench_containsfx_from_frac
133func nx_bench_reciprocal_rank(retr: *i64, nret: i64, rel: *i64,
146func nx_bench_average_precision(retr: *i64, nret: i64, rel: *i64,
168func nx_bench_primary_precision_at_k(is_primary: *i64, n: i64, k: i64) -> i64
184func nx_bench_canonical_rate(canon: *i64, n: i64) -> i64
204func nx_bench_altitude(ndcg_q16: i64, primary_prec_q16: i64) -> i64