Skip to content

docs: Hydra admission design (accuracy, cost, candidates, sketch-bench needs) - #193

Merged
zzylol merged 2 commits into
mainfrom
docs/hydra-admission
Oct 11, 2026
Merged

zzylol merged 2 commits into
mainfrom
docs/hydra-admission

Conversation

@zzylol

@zzylol zzylol commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

Builds on #190's cost table (docs/rqe_optimizer_cost_model.md §3). Docs and comments only; no behavior change.

Adds docs/rqe_optimizer_hydra.md, the design for admitting Hydra into the rqe-optimizer, and links it from the other optimizer docs. Hydra is not a candidate today: hydra-kll has FamilyProperties but is in no capability's family list, and the other four variants have none.

Contents

  1. Hydra as sketch-bench runs it (asap_sketchlib 0.3.0):
    • an R × W grid;
    • every record is inserted into all 2^d − 1 label subsets;
    • the answer is the median over rows;
    • no keys are stored, and merges are cell by cell;
    • the wrapper only queries prefix groupings;
    • per-variant footprints for hydra-cms, cs, hll, kll and univmon.
  2. Accuracy per combination. These are derived bounds, checked against the paper's Theorem 2 (VLDB 2022, arXiv:2208.04927) and against the library.
    • Contamination is additive in the global fanned-out mass, β·M/W.
    • Inner errors are correlated across rows, because every cell shares seeds. The confidence is therefore P[Bin(R, 1−1/β) > R/2] − R·δ_in, about 0.69 at the canonical R = 3.
    • The column hash has one fixed seed. hydra-univmon's 2 × 8 grid makes even the form of its bound vacuous.
    • CMS, CountSketch and HLL have closed forms that are vacuous for small groups. UnivMon has a form only. KLL and entropy have none. So admission has to be empirical, via a measured predicate.
  3. Cost model. The cost doc's §3 table with I_d = I_r = 1, c_probe,h(G_r) per probe, and the key tracker as a part.
  4. Candidates and MILP.
    • The MILP is unchanged.
    • Candidates are keyed by an ordered schema Λ.
    • An edge exists for ∅ ≠ G_i ⊆ Λ when a measurement covers it.
    • Accuracy is a property of each edge, so the MILP stays linear.
  5. What sketch-bench must add (10 items). hydra-kll is measured in the same rerun as the other four variants.
  6. Open decisions (6).

Consolidated with what was already on main (second commit)

🤖 Generated with Claude Code

https://claude.ai/code/session_01FhcWJExZcmVqS6r6rEtjis

@zzylol
zzylol force-pushed the 187-rqe-optimizer-let-mergeable-finer-group-deployments-serve-coarser-raqes branch from ad069f1 to 6b1637a Compare October 10, 2026 03:09
@zzylol
zzylol force-pushed the docs/hydra-admission branch 2 times, most recently from 2f0ce60 to 89f07ea Compare October 10, 2026 03:12
…h needs)

docs/rqe_optimizer_hydra.md: Hydra as sketch-bench runs it; accuracy
bounds per combination (CMS, CountSketch, HLL, UnivMon, KLL), checked
against the paper's Theorem 2 and the library; cost model as the cost
doc's §3 table with I_d = I_r = 1; candidates and MILP edges (MILP
unchanged, still linear); what sketch-bench must add, hydra-kll
included in the same rerun; open decisions. Links from the other
optimizer docs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FhcWJExZcmVqS6r6rEtjis
@zzylol
zzylol force-pushed the docs/hydra-admission branch from 89f07ea to 72688a7 Compare October 10, 2026 03:17
@zzylol
zzylol changed the base branch from 187-rqe-optimizer-let-mergeable-finer-group-deployments-serve-coarser-raqes to main October 10, 2026 03:17
- cost model: the Shared + Fixed bullet no longer presents the
  subpopulations gate as Hydra's rule or fan-out as a deviation; it is a
  necessary check only, and admission is the measured predicate of
  rqe_optimizer_hydra.md §2.4. The HydraKLL column of the side-by-side
  table moves to Hydra §3; the key tracker's grouping is open (§6.1).
- candidates.rs: measured_at_group_count's comment says the same.
- configs/datagen hydra yamls: since asap_sketchlib 0.3.0 the sketch keys
  subsets by column; only the polars baseline still aliases (#74).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FhcWJExZcmVqS6r6rEtjis
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