Skip to content

feat(bench): exact-delta-set row and HydraKLL in the rqe-optimizer cost export - #149

Merged
milindsrivastava1997 merged 3 commits into
mainfrom
s5-cost-rows
Oct 6, 2026
Merged

milindsrivastava1997 merged 3 commits into
mainfrom
s5-cost-rows

Conversation

@milindsrivastava1997

@milindsrivastava1997 milindsrivastava1997 commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Part of #143 (S5). The export itself hasn't been run yet; it will be run after review.

Changes

  • exact-delta-set: mirrors ASAPQuery's DeltaSetAggregatorAccumulator, but without churn. Only the added set is kept (a key per group, as Vec<String>), so removed stays empty and merging is a union. It reuses the exact Multiple<C> wrapper with an empty Present cell. A new key-set comparator (the Presence aggregate: 1 for every key) scores it, and a missing key counts as infinitely wrong. Capability: KeySet.
    • Memory is divided by key count through the existing groups_per_instance normalization in atomic_costs.rs.
    • Our memory counts the label string bytes. ASAPQuery's memory_usage_bytes reports only size_of::<KeyByLabelValues>() (24 bytes) per key.
  • HydraKLL: 5 configs on the new hydra_kll_disjoint_labels.yaml, using comparator subpop-rank-error. The new spec is hydra_columns_f64.yaml with a separate alphabet per label column (Overlapping label-column domains alias into one Hydra cell, and the comparator scores it as sketch error #74). On the shared alphabet, even the exact polars baseline shows a max rank error of 0.036; on the disjoint spec it scores 0. These rows are whole-sketch: memory and merge cost aren't divided per group, so they must not become optimizer candidates until rqe-optimizer: support shared multi-subpopulation sketches (HydraKLL) in the cost model #142 lands, or they'd be overpriced by card(G). Accuracy is measured at this spec's group count only.
  • Export script: one measure helper runs both passes (point for inline zipf data, point_spec for spec files), replacing three near-copies. Every swept parameter is now in one block at the top of scripts/export_rqe_optimizer_costs.sh, and the expected row count goes from 18 to 24.

Swept parameters

Variant Swept
kll-percall k ∈ {200, 500}
dd alpha ∈ {0.01, 0.02}
hydra-kll rows=3 cols=128/256/512 cell_k=200, rows=5 cols=256 cell_k=200, rows=3 cols=256 cell_k=500
hll lg_k ∈ {12, 14}
univmon-cardinality, univmon-topk (heap 1000, rows 5, cols 2048, layers 8), (500, 3, 1024, 6)
cms-heap-topk, countsketch-heap-topk rows ∈ {3, 5} × cols ∈ {2048}
exact-sum, exact-min, exact-max, exact-increase, exact-delta-set none

Smoke run (1 run each, through flatten and atomic-costs)

  • exact-delta-set: relative_error 0, 0 missing groups, about 104 B per key over 9,950 groups.
  • hydra-kll (rows=3 cols=128 cell_k=200): 3.4 MB for the whole sketch, max rank error about 0.047 on the disjoint spec (0.042 on the shared one, where label collisions were part of the error).

For later sessions

rqe-optimizer doesn't reference either new variant yet. Adding them as candidates and costing the key tracker is S4b.

🤖 Generated with Claude Code

…st export

Add exact-delta-set, mirroring ASAPQuery's DeltaSetAggregatorAccumulator
without churn (added set only, merge is a union), scored by a new key-set
comparator. Add a HydraKLL helper with five configs to
export_rqe_optimizer_costs.sh and gather every swept parameter at the top.

Part of #143 (S5).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@milindsrivastava1997
milindsrivastava1997 marked this pull request as ready for review October 6, 2026 17:01
Comment thread scripts/export_rqe_optimizer_costs.sh Resolved
Comment thread scripts/export_rqe_optimizer_costs.sh Resolved
Comment thread scripts/export_rqe_optimizer_costs.sh Resolved
…bets

Fold point_exact, point_univmon and point_hydra_kll into point_spec over a
shared measure(), so the cost and accuracy flags live in one place. Price
hydra-kll on hydra_kll_disjoint_labels.yaml, whose label columns use
separate alphabets (#74): the polars baseline scores 0 there (0.036 max rank
error on hydra_columns_f64.yaml). Note that HydraKLL rows are whole-sketch
and must not become candidates until #142.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread aqpbm-core/src/accuracy/aggregate.rs Resolved
An exact row that misses a group scores an infinite error, which serde_json
writes as null, so atomic-costs skips the row and the table came out short
without failing. Make the export script fail on any skipped row, and say so
in the Presence doc comment instead of promising an infinite score.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@milindsrivastava1997
milindsrivastava1997 merged commit a991502 into main Oct 6, 2026
2 checks passed
@milindsrivastava1997
milindsrivastava1997 deleted the s5-cost-rows branch October 6, 2026 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant