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
Tracking: use sketch-bench rqe-optimizer MILP in asap-planner-rs #790
asap-planner-rs calls sketch-bench's rqe-optimizer MILP (minimize_cost) as a library instead of carrying its own optimizer. The planner converts its query workload into Raqes, passes facts, costs, scrape interval, allowed families and machine family, and converts the returned plan into StreamingConfig / InferenceConfig. A full refactor (moving the model into ASAPQuery) can come later.
Variant + sketch_config → AggregationType + params. Extend sketch_bench_key (asap-planner-rs/src/optimizer/atomic_costs.rs): it maps only CMS, HLL and KLL today. Add cms-heap-topk-fastpath-vector2d → CountMinSketchWithHeap, which sketch-bench's DEPLOYABLE_FAMILIES already plans (sketch-bench#148), plus the exact families (exact-sum → MultipleSum, exact-min/exact-max → MultipleMinMax with sub_type, exact-increase → MultipleIncrease).
Paired DeltaSet key aggregation where the plan flags a key tracker.
Direct (n = 1) / Merge{n}; retention from the deployment's retained instance count; cleanup; aggregation ids.
By default sketch-bench plans only its hardcoded DEPLOYABLE_FAMILIES (sketch-bench#148), and a plan variant without a mapping is an error. --allow-undeployable-families passes allow_undeployable_families: true to build_all_candidates, then prints the plan and $/h and writes no YAML.
As the engine gains DD / CountSketch / UnivMon: add the AggregationType and the variant mapping here, and the family to sketch-bench's DEPLOYABLE_FAMILIES, together.
S4b+S7 (one PR: same per-deployment memory/CPU formulas)
S4a, S5, S1
3
S8 plan output → pin sketch-bench rev in ASAPQuery
S4b, S7, S6
4
A2b and A3 in parallel; then A4+A5 (one PR, keeps CLI runnable); then A5′ --planner milp
S1, S2, S4a, S6 / S8
any
A6 housekeeping
—
Critical path: S1+S2 → S4b+S7 → S8 → A3 → A4+A5. Pin the sketch-bench rev only after S8; until then ASAPQuery uses a [patch] path dependency.
Sessions (for agents)
If you are an agent told "you are session X": find your row, check that the PRs for everything in Needs are merged (gh pr list --state merged, and the ticked boxes above), read the merged PRs' descriptions for interface changes, then do Items. Don't edit files belonging to other sessions' items.
Session
Phase
Start in
Items
Needs
0a
0
sketch-bench
finish + merge sketch-bench#144 (S4a), then S3
—
0b
0
sketch-bench
S5 remainder: run the export, DeltaSet benchmark, HydraKLL benchmark (benchmark part of sketch-bench#142)
—
0c
0
ASAPQuery
A1, A2a, A6
—
1a
1
parent dir with both repos
S1+S2, then S6
0a
2a
2
sketch-bench
S4b+S7 (includes the cost-model part of sketch-bench#142)
1a, 0b
2b
2
ASAPQuery, [patch] path dep on local sketch-bench
A2b
1a, 0c
3a
3
parent dir with both repos
S8 + A3, then pin the sketch-bench rev in ASAPQuery
2a, 2b
4a
4
ASAPQuery
A4+A5, then A5′ (--planner legacy|milp)
3a
Done means: tests and clippy pass; one PR per item group; Conventional Commit title; tick the item here; describe any interface change later sessions depend on in the PR description. Use a git worktree per session. Follow ASAPQuery AGENTS.md. Never git commit --amend after a failed pre-commit hook; re-run the commit.
Decisions (don't revisit)
ASAPQuery calls sketch-bench's rqe-optimizer as a library: git dependency pinned to a rev (pin after S8); [patch] path dependency during development.
Objective: minimize_cost (EC2 machine family) only; minimize_tco and the peak-memory bound are removed.
The Freq capability was removed on purpose. CMS/CountSketch appear only as top-k heaps.
Subtract is deferred: query methods are Direct (L == x) and Merge only.
Spatial filters: ASAPQuery errors on them for now; sharing across filters is later.
Arrival rate is an explicit per-metric input (not derived from cardinality). Units are milliseconds.
x and y must be multiples of the scrape interval (sketch-bench input).
Families the engine can't deploy are excluded by sketch-bench's hardcoded DEPLOYABLE_FAMILIES (not a caller input; sketch-bench#148). --allow-undeployable-families lifts the filter: it prints the plan and $/h and writes no YAML.
Exact families report their accuracy metrics as 0.
Accuracy: ASAPQuery maps accuracy_sla to one (accuracy_metric, accuracy_direction) per capability; families within a capability share metric names.
Every family has properties: mergeable, subtractable, subpopulation-aware, needs key tracker. Non-mergeable → only L == x. HydraKLL needs a DeltaSet key tracker, costed in the MILP.
Merged instance countn = L/x is per Raqe (query CPU, Direct/Merge, read counts). Retained instance count is per deployment: open x/y plus closed (L−x)/y + 1 for the longest L it serves (memory cost, store retention).
ASAPQuery's old optimizer modules (candidate_gen, cost_model, sketch_properties, constants, greedy) are commented out, not deleted, for now.
Goal
asap-planner-rscalls sketch-bench'srqe-optimizerMILP (minimize_cost) as a library instead of carrying its own optimizer. The planner converts its query workload intoRaqes, passes facts, costs, scrape interval, allowed families and machine family, and converts the returned plan intoStreamingConfig/InferenceConfig. A full refactor (moving the model into ASAPQuery) can come later.sketch-bench side: ProjectASAP/sketch-bench#143
Supersedes the port plan in #753.
TODO
rqe-optimizer, pinned rev (local[patch]for development).cmake, maybeclang) inasap-planner-rs/Dockerfileand CI.avgintosum/countitems before buildingRaqes.ControllerConfigquery groups → items →Raqe.accuracy_sla→ (accuracy_metric,accuracy_direction) per capability;latency_sla; lookback / interval in ms.arrival_rate_per_sec), cardinality per (metric, label set).aqpbm_core::AtomicCostEntryand drop ASAPQuery's copy.--ec2-pricing <snapshot.json>and--machine-family <name>forminimize_cost.sketch_config→AggregationType+ params. Extendsketch_bench_key(asap-planner-rs/src/optimizer/atomic_costs.rs): it maps only CMS, HLL and KLL today. Addcms-heap-topk-fastpath-vector2d→CountMinSketchWithHeap, which sketch-bench'sDEPLOYABLE_FAMILIESalready plans (sketch-bench#148), plus the exact families (exact-sum→ MultipleSum,exact-min/exact-max→ MultipleMinMax with sub_type,exact-increase→ MultipleIncrease).n = 1) / Merge{n}; retention from the deployment's retained instance count; cleanup; aggregation ids.DEPLOYABLE_FAMILIES(sketch-bench#148), and a plan variant without a mapping is an error.--allow-undeployable-familiespassesallow_undeployable_families: truetobuild_all_candidates, then prints the plan and $/h and writes no YAML.avgquery maps to two assignments (sum and count), but the translator pins each query to oneaggregation_id. Decide how anavgquery is emitted (engine has no Avg yet, Support Avg (and other multi-statistic aggregations) in query engine #463).candidate_gen,cost_model,sketch_properties,constants,greedy(delete later).asap-optimizer-cli(feat(planner): build rqe-optimizer Raqes and facts from the workload config #798, feat(planner): emit streaming and inference configs from the MILP plan #803:--milp,--output-dir,--allow-undeployable-families)asap-planner --planner legacy|milp(defaultlegacy)AggregationTypeand the variant mapping here, and the family to sketch-bench'sDEPLOYABLE_FAMILIES, together.Order and dependencies (both repos)
Labels: S1–S8 = sketch-bench ProjectASAP/sketch-bench#143 items in order (S1 Raqe model, S2 facts, S3 objective cleanup, S4a capabilities, S4b properties + key tracker, S5 cost rows, S6 candidate inputs, S7 retained memory, S8 plan output). A1–A6 = ASAPQuery #790 items (A1 dependency/build, A2a avg rewrite, A2b inputs → Raqe, A3 plan → configs, A4 disable old optimizer, A5 wiring, A6 housekeeping).
[patch]path dep); A2a--planner milpCritical path: S1+S2 → S4b+S7 → S8 → A3 → A4+A5. Pin the sketch-bench rev only after S8; until then ASAPQuery uses a
[patch]path dependency.Sessions (for agents)
If you are an agent told "you are session X": find your row, check that the PRs for everything in Needs are merged (
gh pr list --state merged, and the ticked boxes above), read the merged PRs' descriptions for interface changes, then do Items. Don't edit files belonging to other sessions' items.[patch]path dep on local sketch-bench--planner legacy|milp)Done means: tests and clippy pass; one PR per item group; Conventional Commit title; tick the item here; describe any interface change later sessions depend on in the PR description. Use a git worktree per session. Follow ASAPQuery
AGENTS.md. Nevergit commit --amendafter a failed pre-commit hook; re-run the commit.Decisions (don't revisit)
rqe-optimizeras a library: git dependency pinned to a rev (pin after S8);[patch]path dependency during development.minimize_cost(EC2 machine family) only;minimize_tcoand the peak-memory bound are removed.L == x) and Merge only.xandymust be multiples of the scrape interval (sketch-bench input).DEPLOYABLE_FAMILIES(not a caller input; sketch-bench#148).--allow-undeployable-familieslifts the filter: it prints the plan and $/h and writes no YAML.accuracy_slato one (accuracy_metric,accuracy_direction) per capability; families within a capability share metric names.L == x. HydraKLL needs a DeltaSet key tracker, costed in the MILP.n = L/xis per Raqe (query CPU, Direct/Merge, read counts). Retained instance count is per deployment: openx/yplus closed(L−x)/y + 1for the longestLit serves (memory cost, store retention).candidate_gen,cost_model,sketch_properties,constants,greedy) are commented out, not deleted, for now.🤖 Generated with Claude Code