refactor: call the operator IR a DAG, not a graph or tree - #544
Merged
Merged
Conversation
QueryExpr and SummaryNode children are Rc-shared, so the IR is a DAG. Rename types, functions, locals, tests, comments and docs accordingly: - ExportDAG/NamedDAG/WorkloadDAG/SummaryDAG (was DagGraph/NamedGraph/ WorkloadGraph/SummaryDagGraph), ReferenceDAG, ResolveDAGError, SharedSubDAG(Strategy), share_common_sub_dags, *_sub_dag test names. - Export JSON keys: graph -> dag, post_graph -> post_dag, pre_asap_subgraph -> pre_asap_sub_dag; dag-viewer and fixtures follow. Exports written before this change no longer load in the viewer. Unchanged: BTreeMap/BTreeSet, DataFusion TreeNode, the vendored MetricsQL parser, git "working tree", `cargo tree`, URLs, and Mermaid keywords. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PostAsapDag -> PostAsapDAG, CompiledPhysicalDag -> CompiledPhysicalDAG, PhysicalDag(Node) -> PhysicalDAG(Node), DagNode -> DAGNode, and every other type/trait name containing `Dag`, plus their doc and comment references. A test-local `type Dag` becomes `InventoryDAG` (an all-caps `DAG` alias would trip clippy::upper_case_acronyms). `cytoscapeDagre` is the vendored dagre plugin's name and stays. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 2, 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.
Summary
QueryExprandSummaryNodeshare children throughRc, so the operator IR is a DAG. This PR renames everything that called it a graph or a tree: types, functions, local variables, test names, comments and docs, includingold_docs/.Type renames:
DagGraph→ExportDAG,NamedGraph→NamedDAG,WorkloadGraph→WorkloadDAG,SummaryDagGraph→SummaryDAG,ReferenceGraph→ReferenceDAG,ResolveTreeError→ResolveDAGError,SharedSubtree(Strategy)→SharedSubDAG(Strategy).Function renames:
share_common_subtrees→share_common_sub_dags, and the same pattern forshare_common_summary_subtrees.Naming convention: every type and trait name spells it
DAG, including those already onmain(PostAsapDag→PostAsapDAG,CompiledPhysicalDag→CompiledPhysicalDAG,PhysicalDag→PhysicalDAG,DagNode→DAGNode,DagCompiler→DAGCompiler, …). snake_case identifiers and JSON keys usedag/sub_dag, as Rust naming lints require. A test-localtype Dagalias becomesInventoryDAG, because clippy'supper_case_acronymslint rejects an all-capsDAG.Downstream: ASAPQuery-backend pins this repo at
f46cbf6cand imports some of these types (e.g.PostAsapDagDocument,DagCompiler). It is unaffected until it bumps that pin, and the bump will need the matching renames.Export JSON (breaking): the keys
graph,post_graphandpre_asap_subgraphare nowdag,post_dagandpre_asap_sub_dag. The dag-viewer and its fixtures are updated, but exports written before this change no longer load in the viewer. No other repo reads these keys.Wording: sentences that contrasted a DAG with a tree are reworded to say what they mean, e.g. "counts a shared node once per path" instead of "tree-shaped".
Not renamed:
BTreeMap/BTreeSet, DataFusion'sTreeNodeAPI, the vendored MetricsQL parser, git's "working tree",cargo tree, GitHub/tree/URLs, Mermaid'sgraph/subgraphkeywords, and the dagretight-treeoption.Test plan
cargo fmt --check,cargo clippy --workspace --all-targets(no warnings)cargo test --workspace(1524 passed)python3 -m unittest discover -s tools/dag-viewer -p test_render.pydag_export --post-asap --default-costoutput hasdag/post_dagkeys and renders withrender.pyviewer.jsin a browser (JS not syntax-checked locally: no node)🤖 Generated with Claude Code