Conversation
zzylol
added a commit
that referenced
this pull request
Oct 4, 2026
stage_pipeline now prices every plan and writes the cheapest --max-candidates (#613); the Stages view says "showing N of M plans" from the document's shown_of section. The README shows how to generate all six #509 examples into an ignored out/ directory. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4 of 5 tasks
Example 2 is the SQL workload over `flows` (distinct, entropy, L2), lowered with the SQL frontend; workload queries report their language. Example 4b is the Q49 crossover: Pattern B's hourly p99 every 10 min over 1,000 series sampled every second, on a deployment that does not keep raw data, where the ingestion-time tumbling KLL (B1) is selected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e plans written stage_pipeline selected among the first --max-candidates combinations, so a cap below the combination count could select a costlier plan (Examples 3a and 4a selected P122 at 128 of 486; the cheapest is P365). Stage 3 now prices up to 4096 combinations, and the document carries the cheapest --max-candidates plans with their logical candidates, then invalid ones, and a shown_of section with the totals when not every plan is written. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
zzylol
force-pushed
the
stack/509-q49-example4-invariants
branch
from
October 5, 2026 06:21
d28b006 to
a23ab1a
Compare
zzylol
force-pushed
the
stack/509-demo-examples
branch
from
October 5, 2026 06:21
e3d77b0 to
727cf89
Compare
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.
Rebased on main d4869a7 (DF 54).
Problem
The DAG viewer's
stage_pipelinebuilt in #509 Examples 1, 3a, 3b and 4a only. It could not show Example 2, which is SQL, because the tool lowered only PromQL and labeled every query "promql". It also could not show the Q49 crossover from #612, where B1 wins. That example needs a deployment that does not keep raw data, but the tool always usedasap_executor::capabilities()unchanged.Before this PR:
--example planner-layering-2and--example planner-layering-4bfail with "unknown example".After this PR: both write valid
asap-stage-pipeline/v1documents. 4b selectsP4-m1"Q1 Kll · tumbling 10m panes · ingestion time: Kll ×6 panes", and itsdeployment.capabilities.raw_data_retainedisfalse.Changes
stage_pipelinelowers SQL workloads withasap_frontend_sql::lower_sql_batchover Example 2'sflowscatalog, using a current-thread tokio runtime. PromQL workloads go throughasap_frontend_promqlas before.workload.queries[].languageis now"sql"or"promql".planner-layering-2: Q1 is COUNT DISTINCT (ε=0.02), Q2 is entropy (ε=0.05) and Q3_FLOAT is L2 (ε=0.01), all with δ=0.01 as one-time batch entries. The data is ContinuouslyIngesting at 100,000/s with cardinality 10M, as inplanner_layering_example2.rs.planner-layering-4b: Pattern B'squantile_over_time(0.99, latency_ms[60m])every 10 min, over 1,000 series sampled every 1 s. It runs onDeploymentCapabilities { raw_data_retained: false, ..asap_executor::capabilities() }.mainpicks the capabilities for the example and passes them tostage_pipeline.Example 2 selects the exact plan,
P86"Q1 exact · Q2 exact (Count acc) · Q3 exact (Count acc) · shared summary". The built-in models have no UnivMon accuracy model ("no accuracy model for UnivMon"), so every UnivMon candidate is rejected. The test records this outcome but the design does not require it.--max-candidatesnow only limits how many plans the document carries: the cheapest first, then the invalid ones. Before this, the selection was made over the first N combinations only, so at 128 of 486, Examples 3a and 4a selected P122 (60,853 and 84.5 cost/s) instead of the cheapest plan, P365 (39,128 and 54.3). When not every plan is written, ashown_ofsection gives the totals.candidate_cap_is_recordednow checks that the selection with--max-candidates 5matches the uncapped run.Test plan
After the cap fix (
e3d77b00): fmt and clippy are clean;cargo test --workspace1,668 passed, 0 failed; at the default cap, 3a and 4a select P365 and Example 2 selects P86.New
example2_plans_the_sql_workload: the document validates, every query's language issql, and the selected label is recorded.New
example4b_selects_ingestion_time_panes_without_raw_data: the document validates,raw_data_retainedis false, and the selected label contains "ingestion time" and "tumbling 10m panes".cargo fmt --all --check,cargo clippy --workspace --all-targets -- -D warnings,cargo test -p asap-devtools(45 passed) andcargo test --workspace(1668 passed, 0 failed, 21 ignored) all pass.🤖 Generated with Claude Code