Repository navigation
Closed as not planned
Description
ASAPQuery's greedy optimizer needs per-(sketch_type, params) atomic costs (mem, insert_cpu, merge_cpu, subtract_cpu, query_cpu) as a flat lookup table, derived from sketch-bench measurements. See ASAPQuery#524.
- Add merge/subtract as benchmarked operations —
BenchSectioncurrently hasthroughput_items_per_sec(insert) andquery_throughput_items_per_secbut no merge/subtract timing at all.- Scope correction:
mergealready exists upstream for essentially every family we wrap (asap_sketchlib'sCountMin::merge,Count::merge,HLL::merge,KLL::merge,DDSketch::merge, etc.; alsodatasketchesandsketch_oxide). Nothing to implement algorithmically for merge — sketch-bench just needsmergeadded tosketch-core::Sketch, each wrapper's passthrough to the already-existing upstream call, and theBenchSection/runner timing plumbing. subtractdoes not exist upstream for CMS/CountSketch. Blocked on asap_sketchlib#69 (addsubtract, mirroringmerge) before sketch-bench has anything to time forsubtract_cpu.query_cpusplit out to its own issue: Add CPU-time instrumentation for the query phase (query_cpu) #31 (no CPU-time instrumentation exists for the query phase today, only wall-clock query throughput).
- Scope correction:
- Add cardinality to the sweep grid —
sketch-cli's--cardinalityis a single value today (main.rs), not swept; needed so ASAPQuery can look up costs at the cardinality a given window/config actually sees. - Write a small export/derivation script (in this repo) that reads the JSONL
Recordstream and emits a flat table: one entry per (sketch_type, params) withmem,insert_cpu = total_CPU_time/item_count,merge_cpu,subtract_cpu,query_cpualready computed. ASAPQuery's loader should be a trivial deserialize of this output, not raw-Record math.memcorrectness depends on Memory measurement: add per-sketch heap tracking; tighten existing metric semantics #14 (HLL register-width bug, jemalloc field/semantics mismatch,ExactFrequencymemory undercount) — the flat table will inherit those bugs until Memory measurement: add per-sketch heap tracking; tighten existing metric semantics #14 lands.
- Grid alignment: this export's param grid should match ASAPQuery's
candidate_gen.rsparam grid (CMS_DEPTHS × CMS_WIDTHS etc.) exactly, so the optimizer's lookup is exact-key with no interpolation.
Metadata
Metadata
Assignees
Labels
No labels
Activity
milindsrivastava1997 commentedon Oct 26, 2026
Superseded: the greedy optimizer this fed was removed (ProjectASAP/ASAPQuery#807). The MILP reads the flat cost table from
study_saturation.py --phase optimizer-cost(#129, ProjectASAP/ASAPQuery#794).