Repository navigation
Tracking: end-to-end use case support for ASAPPlanner (inputs, missing components, adding summaries) #685
Copy link
Copy link
Open
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationenhancementNew feature or requestNew feature or requesttracking issue
Description
End-to-end use case support for ASAPPlanner. Design doc: #684 (docs/design_docs/proposals/asapplanner-e2e-use-case.md).
Status as of origin/main at 58999df2 (2026-10-18). The mapping from the original plan to the merged work is in the comments.
Inputs (doc: Detailed Design, one subsection per input)
- Query workload: queries, language, accuracy targets (
AccuracyTarget) — on main, refactor!: AccuracyTarget builders, AccuracyMetric naming, simpler Stage 3 interfaces and unread workload fields removed #722 - Latency requirements enforced in selection (
max_latency_ms) and a reason for every losing candidate (Rejection.cause) — feat(planner)!: Stage 2 materialization, the latency check and simplified query requirements (Example 4) #717, feat(planner)!: Stage 3 resource usage and cost models 1-3 (usage over time, provisioned capacity, own cluster) #723, refactor!: rename AccuracyTarget.error, Rejection.valid, accuracy CLI flags, execution_timed_dag and accuracy_target #740; Selection per #509: latency bounds and reasons for losing candidates — after #511 #526 closed - Recurrence and predictability consumed by Stage 2 — feat(planner)!: Stage 2 materialization, the latency check and simplified query requirements (Example 4) #717
- Window segments shared across queries (the time-selection input was removed) — Pass 2: shared window grids (group-wide panes and long-window segments) #731 (draft references feat(pass2): shared year-aligned window segments (Q60) #628, Stage 3: price TimeShift as free and TimeRange by the rows it keeps #632, Pass 2: the planner chooses the segment grid #634)
- Data workload: arrival, rate, cardinality used in Stage 2/3 (
DataWorkload) — refactor(types)!: DataWorkload as arrival plus per-source facts; G bound per source #728, feat(planner)!: Stage 2 materialization, the latency check and simplified query requirements (Example 4) #717 - Raw-data retention — feat(asap-aware-mapping)!: deployment capabilities (supported summaries, raw-data and query-time retention) #730
- Counter semantics declared per source (
metric_type) — feat(planner): Example 1 completion — identical-expression CSE, whole-expression top-k heaps, counter-sample weights, per-second plan-selection cost #692 - Declared value domains and sign — proposed
- Distinct-count bounds and HLL confidence — feat(planner): HLL confidence from a deployment distinct-count bound (#678) #693, feat(planner): certify distinct counts at scale: HLL sized from (ε, δ), provable KMV (#694) #715
- Cost model: deployment prices (
ResourceUnitCost) and state pricing — fix(planner): price state by its size; size KLL for δ #682, feat(planner)!: Stage 3 resource usage and cost models 1-3 (usage over time, provisioned capacity, own cluster) #723 - Cost models 1/2/3 (usage over time, provisioned capacity, cluster capacity) — feat(planner)!: Stage 3 resource usage and cost models 1-3 (usage over time, provisioned capacity, own cluster) #723; provider price presets Plan selection: provider price presets for cost models 1 and 2 (#683 follow-up) #742; Stage 3: memory, disk and latency trade-offs per candidate, and cost models beyond cloud billing #660 keeps the remaining parts (disk budget)
- Measured costs from sketch-bench — feat(asap-aware-mapping)!: price sketch nodes from measured operation costs in Stage 3 #734
- Validation of analytical vs measured cost — cost model: validate analytical estimates against empirical benchmark evidence #347
- Accuracy: guarantee composition through arithmetic, error-budget allocation — feat(planner): compose accuracy guarantees through arithmetic over approximate values (#669, part a) #687, feat(planner): error-budget allocation and whole-result δ scaling (#669, part b) #712; comparison and top-k band guarantees Accuracy: guarantees for comparisons and top-k bands over estimates (#669 follow-up) #743
- Deployment capabilities (supported summaries, raw-data and query-time retention) — feat(asap-aware-mapping)!: deployment capabilities (supported summaries, raw-data and query-time retention) #730
- One bundle for all deployment inputs — Deployment inputs: one bundle for cost model, accuracy model and capabilities — after #511 #525
- Storage I/O, handoff and cache pricing from deployment evidence — Plan selection: price storage I/O, handoffs and cache, from deployment evidence with provenance #733
Missing components (doc: Detailed Design, Missing components)
- Early search-space pruning — Prune the candidate search space early without discarding a possibly-best valid plan #673
- Plan search strategies — Planning roadmap: move ASAPQuery planning into ASAPPlanner, MILP plan selection over shared DAGs, benchmark-based accuracy #671
- DataFusion rules in SQL lowering — Run selected DataFusion optimizer rules in SQL lowering; a rule-list API for ASAPPlanner rewrites #670
- Filter/HAVING push-down — Pass 1: push down filters and HAVING across levels to create more candidates (and reuse DataFusion's filter push-down) #664
- Pass 2 reuse rules (rollup, exact top-k reuse, nested sum merge) — feat(planner): Pass 2 reuse rules (rollup, exact top-k reuse) and nested sum merge in Pass 1 (#680) #716
- Pass 2 ASAP-aware CSE: identical expressions and whole-expression top-k (feat(planner): Example 1 completion — identical-expression CSE, whole-expression top-k heaps, counter-sample weights, per-second plan-selection cost #692), summary capability and UnivMon statistics (feat(planner): certify UnivMon L2 and distinct count on the certifiable sketchlib estimators #702, feat(logical-asap-optimization): Example 2 — summary-capability rule and UnivMon frequency statistics #707, feat(types): three error metrics, a shared AccuracySpec and metric-aware satisfies (#690) #708), tumbling panes (feat(planner): tumbling-pane window composition as a Pass 2 rule (Example 3) #713)
- Pass 2 shared window grids and long-window segments — Pass 2: shared window grids (group-wide panes and long-window segments) #731
- Pass 2 sliding windows / Exponential Histogram — Pass 2: sliding-window and Exponential Histogram composition — after #511 #522
- Stage 2 materialization (ingestion time, query time, query time kept across evaluations) — feat(planner)!: Stage 2 materialization, the latency check and simplified query requirements (Example 4) #717, feat(asap-aware-mapping)!: deployment capabilities (supported summaries, raw-data and query-time retention) #730
- Maintained-population top-k — Offer maintained-population top-k candidates in Pass 1 #681
- Top-k output schema — Top-k results drop the item columns (port/job); heavy-hitter candidates resolve columns by name #672
- Executing scalar operator references — Execute scalar operator references in Project/Filter expressions of the physical DAG #668
- Hydra grouped counts in Pass 1 and the executor — on main, feat(asap-physical-operators): execute HydraCms grouped counts and filtered aggregates #695; follow-ups in Hydra follow-ups: group totals in the executor, Pass 1 HydraCms candidates, Hydra top-k #703
- Docs after consolidation — docs: describe the planning stages, devtools and types now on main #732
- Viewer on the stage pipeline — feat(dag-viewer): plan through stage_pipeline in the live viewer; delete dag_export #686, feat(dag-viewer): show the stage pipeline as three stacked lanes #698
- Capabilities lost with the legacy search — Capabilities lost with the legacy replacement search: maintenance-time exact operations, extension intents, nested folds, rate-maintained summaries and guards #735
- Selected-plan handoff envelope (guarantees, costs, input digest, version compatibility) — proposed
- Plan executability validation: capability checks done (feat(asap-aware-mapping)!: deployment capabilities (supported summaries, raw-data and query-time retention) #730); per-operator timing PhysicalASAPDAG::validate does not check per-operator timing #656; deployment dry bind proposed
- Re-planning on workload/data change and state transition — proposed
- Runtime feedback into accuracy/cost models — Feed observed posterior sketch error back into re-planning (execution-time → planning-time loop) #250, cost model: validate analytical estimates against empirical benchmark evidence #347, rest proposed
- Latency estimation per candidate: query-time work only (feat(planner)!: Stage 2 materialization, the latency check and simplified query requirements (Example 4) #717); a full estimate — Selection per #509: latency bounds and reasons for losing candidates — after #511 #526, Stage 3: memory, disk and latency trade-offs per candidate, and cost models beyond cloud billing #660
- User-facing plan explanations — proposed
- End-to-end acceptance on a real deployment (Examples 1–4) — ASAPQuery-backend draft stack #818–#822, pinned at an old Planner revision; needs a re-pin to main
Known bugs and gaps
- Query-time summary build reads unstored ingestion-time rows and still validates — Query-time summary build reads unstored ingestion-time rows and still validates #738 (fix in progress)
- Grouped CASE over L2 sized as absolute error — Grouped CASE over a frequency-L2 statistic is sized as absolute error; the ungrouped one as relative #739
- Stage 3 sizes sketch memory by full capacity — [Bug] Stage 3 sizes a sketch's memory by its full capacity, not by the samples it holds #726
- Plain Count-Min on the portable sketch — Plain Count-Min still uses the portable CountMinSketch: drops nonpositive weights, reuses row seeds past 20 rows #725
- CountSketch offered for counts the executor cannot evaluate — Pass 1 offers CountSketch for a count, but the executor cannot evaluate a CountSketch total #727
Adding a summary family (doc: Adding a new summary family end to end, Algorithm 3)
- (a) Capability declaration: intents, statistics, input types, weight domain, grouping, mergeability, windows
- (b) Pass 1 offer in
summary_candidates, unsized - (c) Sizing (
default_size_params) and theoretical bound, or evidence viaoutput_guarantee - (d) Stage 2 physical operator implementation
- (e) Stage 3 state size and pricing (
summary_shape) - (f) Executor kernel via asap_sketchlib; coverage (docs: ASAP primitive schema and summary coverage (definition + selection) #573)
- (g) sketch-bench accuracy and cost measurements
- (h) Tests: catalog, composition, Stage 3, executor vs exact, acceptance example
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationenhancementNew feature or requestNew feature or requesttracking issue
Activity
docs: link the e2e use-case tracking issue #685
zzylol commentedon Oct 14, 2026
Work items → PRs/issues (moved out of the design doc)
The design doc
docs/design_docs/proposals/asapplanner-e2e-use-case.mdno longer names PRs or issues. This is the mapping it carried (as oforigin/mainat6665fcc3), so status stays tracked here.Design docs cited
planner-layering.md(stages, Assumptions 1–8, Examples, Scenarios)asap-primitive-schema.md(summary coverage, maintained populations)decoupling_op_and_expr.md(operators vs scalar expressions)Inputs not read by the pipeline on main
MatAtIngestion/MatAtQuery, media) (G8)Cost model
PlanningModels.costwith the legacy searchAccuracy model
Tracked missing components
stage_pipeline(G11)validateProposed components (no issue yet when the doc was written)
docs: link the e2e use-case tracking issue #685
zzylol commentedon Oct 18, 2026
Status update (2026-10-18,
origin/mainat58999df2)The consolidation groups landed as new PRs; the draft PRs the earlier table cites were closed as superseded. Where each item went:
ResourceUsage,ResourceUnitCost, cost models 1–3)COUNT(*), HydraCms in Pass 1, measure filters); executor #695PlanningModels.cost, legacy search)New issues opened since: #703, #725–#727, #731, #733, #735, #738, #739. They are added to the checklist above.