Repository navigation
Conversation
…tput as text Adds asap_devtools::planning_stages_text and the print_planning_stages bin: the frontends' roots, the memo groups, Pass 1's PerComputationLogicalMemoCandidates, the memo after Pass 2's local window composition, LogicalASAPMemoCandidates, PhysicalASAPMemoCandidates and Stage 3's Selection for one PromQL workload. node_label moves from stage_pipeline to candidate_labels so both share it, and now names a pane chain's layout (pane_width_ms, pane_count). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One binary plans the workload; --text writes the run as text instead of the viewer document, so both outputs come from the same inputs and flags. The text output, now in the aligned format (G1: TimeRange 60s <- G0), also covers what tools/dag-viewer/print_stages.py (#1158) prints: candidates new at each memo step, the selected memo choice, Stage 3's search outcome, cost per plan node and accepted accuracy per query, and with --enumerated the memo choices with their DAGs. --out - writes to standard output. node_label prints a time range as 60s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Float parameters in candidate labels print with full round-trip precision. Running The same string repeats on every KLL pane candidate and on every Stage 2 operator node that uses this KLL, so the lines get very long and hard to compare. The value is a computed The viewer document uses the same labels ( |
Why
Reading what each planner stage hands the next took either the DAG viewer or raw JSON. The JSON document has no listing of Stage 2's
PhysicalASAPMemoCandidates(Stage 3's input), only its pruned candidates. A text dump is easier to diff, grep and paste into issues; #1160 was written from it.The text comes from the same binary as the viewer document, so both outputs share one planning run, one set of inputs and flags, and cannot drift apart. This consolidates #1158 (a Python printer of the JSON document) into Rust.
What
stage_pipeline --textwrites the run as text instead of the viewer document.--out -writes to standard output. The text has:Stage 0: the frontends' DAG.
The memo after each step:
DagOfLogicalMemoGroups);PerComputationLogicalMemoCandidates, with computation targets and pruned ways to compute;LogicalASAPMemoCandidates, Stage 2's input.Each group is one line with the groups it reads; each candidate shows its origin,
newwhen the step added it, its own operator chain and its input groups. The selected memo choice follows.Stage 2's
PhysicalASAPMemoCandidates: every operator node (the candidates it implements, and whether it is an implementation root or private), every physical candidate (timing, materialization, whether it may produce a query output, and the producer candidates per input), the reader constraints and the pruned candidates.Stage 3's
Selection: search status and MILP size, the selected DAG (each node's candidate, operator and producer nodes), the cost per second with each plan node's charge and detail, and each query's accepted accuracy.With
--enumerated: the first--max-enumeratedmemo choices, each with its composed DAG and the selected one marked.Shared label change:
node_labelmoves fromstage_pipelineintocandidate_labels. It now names a pane chain's layout (PaneChain pane_count=6 pane_width_ms=10000) and prints a time range as60s, so the viewer document's memo labels change the same way.How
stage_pipelinealready plans withPlanSearchSettings::inspect, which keeps every stage's memo. With--text, it passes the resultingPlanningStagesRuntoplanning_stages_textand returns before building the JSON document. The text module prints aligned columns (write_rows) from the run's own types, not from the JSON document.Key code interfaces added / modified
crates/devtools/src/planning_stages_text.rs(new module)crates/devtools/src/candidate_labels.rscrates/devtools/src/bin/stage_pipeline.rs: new flags--text,--enumerated(needs--text), and--out -.Usage
A workload file
rate1m.jsonwith one exact panel, every 10 s, over a counter with 1,000,000 series at 66,667 rows/s:{"query_workload": {"language": "promql", "query_batch": null, "repeating_queries": [ {"query": "sum by (job) (rate(http_requests_total[1m]))", "demand": {"fixed_interval": 10000}, "requirements": {"accuracy": {"max_error": 0.0, "failure_probability": 0.0}}, "predictability": {"predictable": {"known_at": null}}}]}, "data_workload": {"arrival": {"ingesting": {"rows_per_second": 66666.67}}, "sources": {"http_requests_total": {"series_count": 1000000, "sample_interval": 15000, "metric_type": "counter"}}}}Excerpt of its 468 lines at this commit:
Major algorithm changes
None. This is a devtool output mode plus label changes; planning is unchanged.
Before this PR
Stage boundaries were visible only through the viewer document. #1158 proposed a separate Python script that reads that document, so it could not show Stage 2's physical candidates, and a second implementation had to track the document format.
After this PR
One binary plans the workload and writes either the viewer document (the default) or the text (
--text). Both outputs label pane chains with their layout and time ranges as60s.Verification
cargo test -p asap-devtools --lib --bins: passed. This includesplanning_stages_text::tests::prints_every_stage_of_a_repeating_rate_query, which checks every section, the exact group and pane-candidate lines, thenewmarker, the ingestion-time pane chain, the selected choice and a two-choice enumeration.cargo test -p asap-devtools --test devtools -- text_output enumerated_needs_text: 2 passed. These cover--text --out -on Example 1, and the usage error for--enumeratedwithout--text.cargo test -p asap-devtools --test devtools -- stage_pipeline:: viewer_contract::: 50 passed, run after thenode_labelchange to60sranges.cargo clippy -p asap-devtools --all-targetsandcargo fmt: clean.Follow-up
stage_pipeline(e.g. toexplain_workload_plan) is left to the separate rename PR that devtools: print a stage_pipeline document as text #1158 mentions.🤖 Generated with Claude Code