You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bench: measure hydra-kll without subset fan-out (one key per grouping) #165
The optimizer models hydra-kll as one sketch keyed by the grouping G: each sample hashes its joined G value into the grid and updates the KLL cell there, so the sketch holds exactly card(G) subpopulations. S4b's eligibility gate (card(G) ≤ subpopulations) assumes this.
The measured rows fan out instead. aqpbm-cli/src/rows/materialise.rs:30 joins the label columns with ;, and asap_sketchlib 0.2.2's Hydra::update splits on ; and inserts into all 2^D − 1 non-empty subsets. On hydra_kll_disjoint_labels.yaml (D = 2) that means 3 inserts per sample: key1, key2, key1;key2. Compared with the intended sketch, the rows:
overstate insert CPU by about 3×;
understate accuracy: the cells carry N·(2^D−1) units of mass instead of N, so there is more collision noise in the same r×c;
misreport load: subpopulations counts only the probed key1 groups, not what the sketch held.
Fix
Measure hydra-kll with one subkey per sample. Any of these works:
0.2.2: join the grouping values with a separator other than ;, so update sees one part (D = 1);
asap_sketchlib 0.3 framework Hydra::with_schema(r, c, ["series"], kll) with the joined label set as the single column;
the portable HydraKllSketch (message_pack_format/portable/hydra_kll.rs), which never fans out.
Then re-measure the hydra-kll rows (ideally at several group counts too, per the S5 note on #143), with subpopulations equal to the number of distinct joined keys.
Also check that ASAPQuery's HydraKLL engine path keys by the joined grouping without fan-out. Otherwise the deployed sketch won't match the costed one.
Only hydra-kll changes. It is the only Hydra variant the optimizer prices. The hydra-cms, hydra-cs, hydra-hll and hydra-univmon rows keep the library's subset fan-out: they benchmark asap_sketchlib's Hydra as it ships, and nothing consumes them.
One insert per sample, on the framework Hydra. The hydra-kll rows join label values with \u{1f} (SERIES_SEPARATOR), which Hydra::update doesn't split on, instead of ;. Queries join with the same separator. The join happens at materialisation, off the timed insert path.
Scored over the full label set.subpop-rank-error for hydra-kll groups by every label column, not just key1. The polars baseline groups by the full key (no fan_out), so subpopulations is the number of distinct label sets, which is what the optimizer's card(G) ≤ subpopulations gate assumes.
Sweep group counts in this PR. Three specs differ only in key1's population, 2 / 20 / 200 values, so with key2 (zipf over 50) the sketch holds about 100 / 1k / 10k groups. Row count, key2 and the value distribution don't change. The export script runs every HYDRA_KLL_CONFIGS entry on each spec, merge-accuracy runs included. No pipeline change is needed: same_cell keys on the full table description, so the specs are separate cells, and the optimizer's gate already takes the smallest measured group count ≥ card(G). The stale comments in the existing spec (key1 as "the column the comparator groups by", key2 skew for "subset fan-out") get fixed.
Activity
fix(rqe-optimizer): decide shared-sketch validity in is_eligible, one…
feat(rqe-optimizer): family properties, shared fixed-size sketches an…
milindsrivastava1997 commentedon Oct 7, 2026
Scope decisions
asap_sketchlib's Hydra as it ships, and nothing consumes them.Hydra. The hydra-kll rows join label values with\u{1f}(SERIES_SEPARATOR), whichHydra::updatedoesn't split on, instead of;. Queries join with the same separator. The join happens at materialisation, off the timed insert path.subpop-rank-errorfor hydra-kll groups by every label column, not just key1. The polars baseline groups by the full key (nofan_out), sosubpopulationsis the number of distinct label sets, which is what the optimizer'scard(G) ≤ subpopulationsgate assumes.measured_at_group_countcomment inrqe-optimizer/src/candidates.rs, which cites this issue.HYDRA_KLL_CONFIGSentry on each spec, merge-accuracy runs included. No pipeline change is needed:same_cellkeys on the full table description, so the specs are separate cells, and the optimizer's gate already takes the smallest measured group count ≥card(G). The stale comments in the existing spec (key1 as "the column the comparator groups by", key2 skew for "subset fan-out") get fixed.Out of scope
HydraKllSketch(xxh32, its own KLL,k=20by default), not the frameworkHydrameasured here. Neither fans out, but costs can differ. Tracked in HydraKLL: the costed sketch (sketch-bench Hydra framework) is not the deployed one (portable HydraKllSketch) ASAPQuery#799. We decided to keep measuring the frameworkHydrahere.🤖 Generated with Claude Code
hydra-kll: insert one key per label set, not every label subset (#165)
hydra-kll: measure at ~100, ~1k and ~10k groups (#165)
zzylol commentedon Oct 10, 2026
Closing: the scope here (measure hydra-kll with one key per grouping, no subset fan-out) contradicts the Hydra admission design in #193.
(decided by @zzylol)
🤖 Generated with Claude Code