code wiki / (root) / sketch_ddsketch_vs_tdigest_tail_bench.nx

sketch_ddsketch_vs_tdigest_tail_bench.nx

buildroot/runtime/sketch_ddsketch_vs_tdigest_tail_bench.nx

4923 B128 linesdepth 5pulls 7 transitivereach 0 importersview sourcekind benchtopic sketch
docsdependenciesstructsconstsfunctions

about

sketch_ddsketch_vs_tdigest_tail_bench.nx -- multiplicative-error tail. CLAIM TO VALIDATE: DDSketch (Masson-Rim-Lee 2019) provides MULTIPLICATIVE relative error on every quantile: |est/true - 1| <= 1/bpo. T-Digest provides empirical tail-tight ADDITIVE error. On a HEAVY-TAIL stream where the tail values span multiple orders of magnitude, DDSketch's multiplicative guarantee wins on extreme quantiles. WORKLOAD: 500 small values (in [1, 100]) + 50 huge values (geometric in [1000, 100000]) -- the heavy tail. Total N=550. True p99 ~ 60000 (top 1% are the huge values). True median ~ 50 (middle of small values). MEASUREMENT: DDSketch bpo=64 -> rel err 1/64 = 1.56% per quantile. T-Digest delta=100 -> ~1% global rank error, but at p99 of a heavy-tail the absolute value error scales with quantile value. HARD-WIN GATE: On p99 with truth ~ 60000: - DDSketch should be within ~2-3% (1000-1500 absolute) - T-Digest may be much further off due to centroid quantization at the tail ACCURACY axis BEATS by >5%.

dependencies 5 imports · 0 importers

syscalls.nx sketch_ddsketch.nx sketch_tdigest.nx sketch_comparator.nx sketch_types.nx sketch_ddsketch_vs_tdigest_tai

imports: syscalls.nxsketch_ddsketch.nxsketch_tdigest.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_dd_alloc nx_tdigest_alloc nx_dd_add nx_dd_bucket nx_dd_bitlen nx_tdigest_add nx_tdigest_merge nx_tdigest_sort_buffer nx_tdigest_centroid_at nx_tdigest_w_max nx_dd_quantile nx_dd_value_at_bucket nx_tdigest_quantile nx_tdigest_merge ↻ nx_tdigest_centroid_at ↻ nx_cmp_accuracy nx_cmp_iabs iabs_d nx_dd_total

structs

none

consts

none

functions

34func iabs_d(x: i64) -> i64
called by 1: main
39func main() -> i64