code wiki / (root) / nx_bench_metrics_test.nx

nx_bench_metrics_test.nx

buildroot/runtime/nx_bench_metrics_test.nx

4024 B106 linesdepth 5pulls 5 transitivereach 0 importersview sourcekind gate/prooftopic bench
docsdependenciesstructsconstsfunctions

about

nx_bench_metrics_test.nx -- KAT for the retrieval-quality kernels. Native sovereign lane: nx_compile_x86_native.elf -> as -> ld -> run. Exit 0 = all pass; exit N = assertion N failed. Goldens (Q16.16, FX_ONE = 65536): DCG[3,2,3,0,1,2]@6 = 6.8610 * 65536 ~= 449640 IDCG (sorted desc) = 7.1410 * 65536 ~= 467989 nDCG = 0.96081 * 65536 ~= 62968 precision@4 (2 rel) = 0.5 -> 32768 (exact) recall@4 (2 of 3) = 0.6667 -> 43690 (exact, truncated) RR (first rel @ 2) = 0.5 -> 32768 (exact) AP [a,b,c,d] rel{a,c}= (1 + 2/3)/2 = 0.8333 -> 54613 (exact, trunc) primary@4 [1,0,1,1] = 0.75 -> 49152 (exact) canonical_rate[1,1,2,3]= 0.75 -> 49152 (exact)

dependencies 2 imports · 0 importers

fx.nx nx_bench_metrics.nx nx_bench_metrics_test.nx

imports: fx.nxnx_bench_metrics.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main fx_from_int nx_bench_dcg fx_div fx_log2_int fx_log2 fx_mul fx_from_int ↻ fx_mul ↻ within nx_bench_ndcg nx_bench_dcg ↻ nx_bench_sort_desc fx_div ↻ nx_bench_precision_at_k nx_bench_contains fx_from_frac nx_bench_recall_at_k nx_bench_contains ↻ fx_from_frac ↻ nx_bench_reciprocal_rank nx_bench_contains ↻ fx_from_frac ↻ nx_bench_average_precision nx_bench_contains ↻ fx_from_frac ↻ nx_bench_primary_precision fx_from_frac ↻ nx_bench_canonical_rate fx_from_frac ↻ nx_bench_altitude

structs

none

consts

none

functions

20func within(a: i64, b: i64, tol: i64) -> i64
called by 1: main
27func main() -> i64