Repository navigation
Conversation
This was referenced Nov 16, 2026
…family snapshots 75 synthetic PlanningWorkloads (PromQL and SQL) where UnivMon, Count-Min or Count Sketch with a heap, or KMV is the cheapest plan that meets the target, with controls and the shapes no sketch serves yet (blocked-*). gen.py writes the files, tables.json and the index entry. Five MVP entries in sketch_plan_snapshots pin one plan per family.
…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.
zzylol
force-pushed
the
test/sketch-heavy-workloads
branch
from
November 16, 2026 23:48
58f6f46 to
62a6591
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
sketch_plan_snapshotsentries (one per family, plus a mixed dashboard), and moves the rollup test to a grouped quantile that selects a KLL.l2_over_time(dns_query_client[6h])at relative 0.05 over 4 streams is now pinned to an ingestion-time UnivMon chain (5 × 2,367).sketch_rollup_witness_costs_for_a_grouped_quantilegoes from failing to passing.Review guide
1760a69f5, where refactor: tools and snapshots over the #1207 memo, edges and contexts (#1207 PR 9) #1239 landed). The two commits were rebased fromrefactor/1207-toolswithout conflicts.crates/devtools/src/planner_fuzz/relations/mod.rs:column_projections_folded;crates/devtools/tests/planner_fuzz.rs:sketch_rollup_witness_costs_for_a_grouped_quantile;tools/dag-viewer/workloads/sketch-heavy/gen.py.tables.json, all written bygen.py;index.jsonentry, also written bygen.py;test_viewer.py(30 → 105).Behavior: before → after
The sketch-heavy set. A user opens Workload sets in the DAG viewer and picks Sketch-heavy (75). The 75 workloads are in five subsets, named by file prefix:
heavy-hitterstopk(10, sum by (url) (rate(http_requests_total[W])))at L1- or L2-normalized targetsfrequency-momentsl2_over_timedistinctCOUNT(DISTINCT user_id)and PromQLdistinct_over_timemixedblockedAll names are synthetic. The set is planned with the default deployment and guarantees enforced. The two
bug-*reproducers from the study are left out.Snapshots (MVP, Fargate cost inputs), checked under
sketch_plans_match_snapshots:sketch-heavy-univmon-l2-mvpsketch-heavy-cmsheap-topk10-mvpsketch-heavy-csheap-topk10-mvpsketch-heavy-sql-distinct-by-region-mvpsketch-heavy-edge-dashboard-mvpThe rollup test.
quantile by (job, instance) (m_gauge). That reads only 40 latest samples per group, so the plan is exact and there is no KLL to roll up.SketchRollup { labels: ["city"] }witness builds and costs.Aggregate quantile, 2.59 /s), so the test does not use it.Interfaces
None public. The one private helper is in devtools (relations/mod.rs):
root_estimateandwith_root_estimatecall it first. Before this change, no SQL grouped estimate could give aSketchRollup,QuantileRankorSmallerTopKwitness, because its root has two column-onlyProjects.Usage. In the DAG viewer, the user picks Sketch-heavy →
frequency-moments-univmon-l2__r4-10hz-6h-every60s-releps0.05-d0.05.server.pyrunsasap_planner --workload … --run-until stage3, and the viewer shows the selected UnivMon plan.The snapshot check is:
cargo test --release -p asap-devtools --test corpus_snapshots -- --ignored sketch_plans_match_snapshotsIt plans each manifest entry and compares it with
<id>.json.Algorithm changes
None in the planner. The witness change above is test tooling.
Decisions and open questions
Decided:
<subset>-<shape>__<parameters>, because the index format allows one directory level per set.Snapshot changes
After the rebase onto main, #1239's float round-trip printing changed the last digits of four
cost_per_secondvalues in three of the new snapshots (sketch-heavy-univmon-l2-mvp,sketch-heavy-csheap-topk10-mvp,sketch-heavy-edge-dashboard-mvp), for example2.6236000343500004e-12→2.62360003435e-12. They were regenerated withUPDATE_SNAPSHOTS=1. No plan changed.Note: the exact
COUNTstate reads thebytescolumnIn the SQL plans of this set, the exact
Countstate's update input names a column, for exampleweight: Column(Named("bytes"))forSELECT url, COUNT(*) … GROUP BY url. This is not a sum of bytes:Countstate adds 1 for each row and ignores the value (ScalarState::updateincrates/executor/src/summary_kernels/exact.rs). The column only tells it which rows to skip: a row whose column is NULL is not counted.counted_columnincrates/stage1-pass1-per-computation-candidates/src/summary_realization.rs): the column aCOUNT(col)filter proves non-NULL, else the first non-nullableFloat64column, else any non-nullable column. Intables.json,bytesis the only non-nullableFloat64column ofclicks.Checked end to end on the executor:
SELECT g, COUNT(*) AS c, SUM(y) AS s … GROUP BY gwithya non-nullableFloat64column and the rowsa: 100, 250, 4000andb: 7plansCountwithweight: Column(y)and returnsa 3 4350.0,b 1 7.0, the exact answer. Withynullable, theCountreadstsinstead and returns the same result.Verification
All results are at the PR head
62a6591a2(rebased onto main1760a69f5).cargo test --release -p asap-devtools --test corpus_snapshots -- --ignored sketch_plans_match_snapshotsoptimal; three new snapshots regenerated for the number printing (see Snapshot changes), the older ones unchangedcargo test -p asap-devtools --test corpus_snapshots -- manifest_entries_build_their_argumentscargo test --release -p asap-devtools --test devtools -- planner_fuzzissue_891_filtered_rate_reads_the_grouped_rateandfinds_issue_902_…, are the missing filter-the-result candidate, #891, and also failed on #1239's head.sketch_rollup_witness_costs_for_a_grouped_quantilepasses.cargo test -p asap-devtools --lib planner_fuzzcargo test -p asap-devtools --test devtools -- workload_set_index_and_files_validatePlanningWorkload.python3 -m unittest test_viewer test_server(tools/dag-viewer, planner built)node --test *.test.mjs(Node 22)cargo fmt --all --checkcargo clippy -p asap-devtools --all-targets -- -D warningsFollow-ups
materialized_views_error: "the executor cannot refresh materialized view 1 from its inputs: … per-entity update requires a projected value column". The UnivMon value-stream chain is not yet executable. The fix belongs in the executor; the planner keeps this plan.