code wiki / (root) / sketch_tdigest_v2_vs_v1_bench.nx

sketch_tdigest_v2_vs_v1_bench.nx

buildroot/runtime/sketch_tdigest_v2_vs_v1_bench.nx

4006 B113 linesdepth 5pulls 7 transitivereach 0 importersview sourcekind benchtopic sketch
docsdependenciesstructsconstsfunctions

about

sketch_tdigest_v2_vs_v1_bench.nx -- paired measurement, T-Digest v2 vs v1. CLAIM TO VALIDATE: v2 (Dunning arcsin k1) uses fewer centroids than v1 (simplified parabolic 4q(1-q)) at comparable global accuracy. The memory efficiency is the headline T-Digest property; v2 is supposed to honor it; v1 over-allocates centroids near tails. SHARED WORKLOAD: - Stream: integers 1..2000 in order - Both alloc with delta=100 MEASUREMENT AXES: ACCURACY: median + p10 + p90 errors; both should hit ~1% rank; v2 may be slightly worse (looser tail) but must stay within tolerance band MEMORY: n_centroids_used. v2 < v1 expected. TIME: INCONCLUSIVE (no in-program clock) HARD-WIN GATE: MEMORY axis must BEAT v1 by >5% (50000 ppm). Accuracy on median must be EQUIVALENT (not LOSES).

dependencies 5 imports · 0 importers

syscalls.nx sketch_tdigest.nx sketch_tdigest_v2.nx sketch_comparator.nx sketch_types.nx sketch_tdigest_v2_vs_v1_bench.

imports: syscalls.nxsketch_tdigest.nxsketch_tdigest_v2.nxsketch_comparator.nxsketch_types.nx

imported by: nobody (leaf or entry point)

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

main nx_tdigest_alloc nx_tdv2_alloc nx_tdigest_add nx_tdigest_merge nx_tdigest_sort_buffer nx_tdigest_centroid_at nx_tdigest_w_max nx_tdv2_add nx_tdv2_merge nx_tdv2_sort_buffer nx_tdv2_centroid_at nx_tdv2_w_max nx_tdv2_isqrt nx_tdigest_quantile nx_tdigest_merge ↻ nx_tdigest_centroid_at ↻ nx_tdv2_quantile nx_tdv2_merge ↻ nx_tdv2_centroid_at ↻ nx_tdigest_n_centroids nx_tdv2_n_centroids nx_cmp_memory nx_cmp_accuracy nx_cmp_iabs nx_cmp_composite

structs

none

consts

none

functions

30func main() -> i64