Repository navigation
test(devtools): planner_fuzz under the measured unit costs: a KLL rollup case; filter-on-group-key cases ignored on #891 - #1416
Merged
Conversation
This was referenced Nov 18, 2026
Contributor
Author
|
Gate: |
…lects a KLL The generated PromQL grouped quantile now plans exact, so there was no sketch to roll up. Use SQL p90 per (city, host) over 1 h at 100,000 rows/s, which reads a KLL chain, and fold nested column-only projections so the witness finds SQL's estimate under two Projects.
… with the measured costs that break them The planner has no candidate that filters a finished grouped result on a group key. Before the measured unit costs, its closest candidates came within the relation's tolerance; at the measured costs the rollup's regrouping sum (891) and the KLL state merge and readout (902) do not.
…ct; folded projections keep the inner alias when the outer has none
zzylol
force-pushed
the
test/planner-fuzz-measured-costs
branch
from
November 18, 2026 15:05
4450927 to
46135a6
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.
Summary
planner_fuzztests inasap-devtoolsfail on main. All three started failing at14308fd2c(the measured unit costs): they pass at its parentfacaec8b2and fail from14308fd2con (checked by merging each main commit into the tools branch that last passed and runningplanner_fuzz::only).sketch_rollup_witness_costs_for_a_grouped_quantileis inconclusive ("q's result is not a summary estimate"): its generated PromQLquantile by (job, instance)now plans exact, so there is no KLL to roll up.issue_891_filtered_rate_reads_the_grouped_rateandfinds_issue_902_filter_on_group_key_not_reading_the_grouped_result: the filtered query pays about 0.09/s (891) and 0.08/s (902) more than a witness that filters the grouped query's finished result.devtoolstest binary has no failures and, with test: update six tests made stale by the Stage 3 refactor and measured unit costs; ignore slower_repeat on #1385 #1389 merged, the whole workspace suite passes.Review guide
main. Not stacked. Tests and one test helper inasap-devtoolsonly; no planner change.crates/devtools/tests/planner_fuzz.rs.Behavior: before → after
sketch_rollup_witness_costs_for_a_grouped_quantileroot_estimatefolds SQL's two column-onlyProjects so the witness finds the estimate.issue_891_filtered_rate_reads_the_grouped_rate#[ignore = "planner bug: #891"]finds_issue_902_filter_on_group_key_not_reading_the_grouped_result#[ignore = "planner bug: #891"]Worked example (891). W =
sum by (cluster, namespace, pod, container) (rate(container_cpu_usage_seconds_total[5m])), 1,000 counter series, every 30 s; q' adds{cluster="cluster1"}. Stage 3's plan for W ∪ {q'} (fromasap_planner --run-until stage3 --verbose):Filterover W's finished result: 1,000 rows, one run every 30 sAggregatesum by the same four labels: 1,000 rows x 104 operations into 1,000 groups, one run every 30 sThe
Aggregateis the rollup candidate's regrouping, and it regroups into the same 1,000 groups, so it computes nothing. The witness is theFilteralone (+0.000039/s). No rule offers that candidate; before the measured unit costs, the plan the planner chose (filter the Sum's states, merge, finalize) came within the 1% tolerance, and now the cheapest candidate it has is 0.0925/s over.Interfaces
None changed (
column_projections_foldedis private toplanner_fuzz::relations).Decisions and open questions
Filteralone over a finished grouped result when the filtered query groups by the same keys. A narrow version inside the rollup rule (equal keys → no regrouping) fixes 891 but not 902, whose grouped result is a quantile estimate, not a rollup member.Verification
cargo test -p asap-devtools --test devtools -- planner_fuzz::facaec8b2: 16 passed;14308fd2cand4cb4110c1: 3 failedcargo nextest run --workspace --no-fail-fastcargo fmt --all -- --check