Conversation
#509 defines a Stage 1 candidate as one logical ASAP DAG for the whole workload. #561 lists local alternatives per target but builds no DAG. compose_logical_candidate(inventory, choice) replaces each chosen target aggregate with SummaryAgg -> SummaryEstimate (sketch) or SummaryAgg -> FinalizeExactAccumulator (exact accumulator). Pass-through targets and untouched sub-DAGs keep their identity. Each SummaryAgg declares trusted whole-source coverage (#570). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`stage_pipeline --example planner-layering-1 --out <file>` (or `--promql <q>...`) lowers the workload, runs Pass 1, enumerates the Cartesian product of local alternatives (capped by --max-candidates and recorded as `capped`), and writes an asap-stage-pipeline/v1 document with stage0_logical and stage1_logical_asap only. Generated fixture for #509 Example 1 is committed; a test regenerates it and validates every DAG. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…valuation naming Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…alizes FinalizeExactAccumulator kept the state column's name (`state`), so a consumer reading the sample value (e.g. sum by (job) over a finalized per-series rate) found no `value` column at runtime. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…column Rows that carry the full series identity are closed; Pass 1 rejected them and the runtime needs explicit item columns for keyed summaries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r naming fix The finalized exact accumulator now names its column after the aggregate it realizes (value/sum instead of state). Point the stage_pipeline test at the renamed fixture. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
#509 defines a Stage 1 candidate as one logical ASAP DAG for the whole workload. #561 only lists the alternatives for each target aggregate. It builds no DAG, so nothing after Pass 1 has a candidate to work on, and nobody can look at what Stage 0 and Stage 1 produce.
What
logical_candidates::compose_logical_candidate(inventory, choice)builds one whole-workload candidate from one choice per Pass 1 target.stage_pipelinedevtool: lowers a workload, runs Pass 1, enumerates the Cartesian product of local choices (capped with--max-candidatesand recorded ascapped), and writes anasap-stage-pipeline/v1document withstage0_logicalandstage1_logical_asap.tools/dag-viewer/examples/planner-layering-example1.json, which a test regenerates and checks.FinalizeExactAccumulatornamed its outputstate, so a consumer that reads the sample value (for examplesum by (job)over a finalized per-seriesrate) found novaluecolumn. It now takes the name of the aggregate it replaces.How
compose_logical_candidatereplaces each chosen target:SummaryAgg → SummaryEstimate;SummaryAgg → FinalizeExactAccumulator;Untouched sub-DAGs keep their
Rcidentity. EachSummaryAggdeclares trusted whole-source coverage (#570). No timing is assigned; with #543 everything defaults to query time later.Example 1 (#509 planner-layering)
Q1
sum by (job) (rate(http_requests_total[1m]))(exact), Q2topk by (job) (10, sum_over_time(http_requests_total[1m]))(ε = 0.01, δ = 0.001).Before this PR: Pass 1 returns four target inventories (rate, sum, sum_over_time, topk). There is no Stage 1 candidate and no way to view one.
After this PR:
cargo run -p asap-devtools --bin stage_pipeline -- --example planner-layering-1 --out out.jsonwrites Stage 0 (1 workload DAG, two roots) and Stage 1 (24 candidates):So the counts are 1 → 24, for example
L20 = Q1 exact (Sum acc, Rate acc) · Q2 exact (Sum acc).Known gaps (tracked in #577's acceptance tests)
🤖 Generated with Claude Code