Skip to content

Saturation study records DDSketch max relative value error; optimizer reads mean #175

Closed

Description

@milindsrivastava1997

Problem

The saturation study and rqe-optimizer read different accuracy values for DDSketch (dd):

This is more than a different name. RelativeValueErrorGT::score (aqpbm-core/src/accuracy/quantile.rs:137-138) scores the same 100 quantile probes once and records both values. The study keeps one and the optimizer reads the other.

Values each sketch is read by

Sketch Values the comparator records Saturation study reads Optimizer reads Match?
kll-percall mean_rank_err and max_rank_err mean mean yes
hydra-kll same as KLL not studied mean n/a
dd mean_relative_value_error and max_relative_value_error max mean no
hll relative_error (one value) relative_error relative_error yes
top-k (CMS/CountSketch heap) precision_at_k precision_at_k precision_at_k yes
exact-* relative_error (worst group) and relative_error_mean not studied relative_error (worst group) n/a

Impact

SaturationCurves::accuracy asserts that each curve point's error_metric matches the family's metric. With #173, dd is in DEPLOYABLE_FAMILIES, so every default MILP/AutoSketch run with a Quantile RAQE evaluates DD and panics on the mismatch. Rerunning the study as it stands won't help, because the script still writes max_*.

Decision

Switch the study to the mean for DD, so KLL and DD (the two sketches that can answer the same quantile query) are both judged on average error.

Fix

  1. scripts/study_saturation.py:57-59: change DD's metric to mean_relative_value_error, and replace the comment "DDSketch's bound holds per quantile, so its curve is the worst one" with the new reason.
  2. Rerun the DD saturation study and regenerate its curves.
  3. Check that small_problem runs with a Quantile RAQE and no panic.

🤖 Generated with Claude Code

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions