Skip to content

HydraKLL: the costed sketch (sketch-bench Hydra framework) is not the deployed one (portable HydraKllSketch) #799

Open

Description

@milindsrivastava1997

Found while working on ProjectASAP/ASAPBench#165.

Problem

The optimizer's cost table prices HydraKLL from sketch-bench's hydra-kll row, but that row measures a different implementation than the one ASAPQuery deploys.

sketch-bench hydra-kll (costed) ASAPQuery HydraKllSketchAccumulator (deployed)
Type asap_sketchlib::Hydra framework, HydraCounter::KLL cells portable asap_sketchlib::HydraKllSketch (message_pack_format/portable/hydra_kll.rs)
Hashing hash_for_matrix_seeded(HYDRA_SEED, …) xxh32(key, row)
Cell framework KLL::init_kll(cell_k) the portable type's own KLL, k: u16
k cell_k 200 / 500 planner default DEFAULT_HYDRA_K = 20 (asap-planner-rs/src/planner/sketch.rs)

Neither one fans out to label subsets (after sketch-bench#165, both insert one key per full label set), but memory, insert/merge/query CPU and rank error can still differ between them. So the optimizer may cost one sketch and deploy another.

Deployed path: asap-query-engine/src/precompute_operators/hydra_kll_accumulator.rs (update → HydraKllSketch::update(&key.to_semicolon_str(), value)).

Fix (open)

Make the costed and deployed sketches the same. Options:

  • sketch-bench measures the portable HydraKllSketch for hydra-kll (available in asap_sketchlib 0.2.2), including ASAPQuery's k values;
  • ASAPQuery deploys the framework Hydra with KLL cells;
  • more generally, align every family ASAPQuery deploys with the implementation sketch-bench measures (kll, cms, hll, … likely have the same split).

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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