Conversation
This was referenced Oct 2, 2026
zzylol
force-pushed
the
stack/528-08-cleanup
branch
from
October 2, 2026 18:32
6c2c313 to
2bd4c4d
Compare
zzylol
force-pushed
the
stack/528-07-planner
branch
2 times, most recently
from
October 2, 2026 19:40
2a3bcd0 to
a03efc2
Compare
zzylol
force-pushed
the
stack/528-08-cleanup
branch
2 times, most recently
from
October 2, 2026 21:14
78b6dc3 to
e40ffdb
Compare
zzylol
force-pushed
the
stack/528-07-planner
branch
from
October 2, 2026 21:14
a03efc2 to
2c708f3
Compare
zzylol
force-pushed
the
stack/528-08-cleanup
branch
from
October 2, 2026 21:22
e40ffdb to
8b2dfff
Compare
zzylol
force-pushed
the
stack/528-07-planner
branch
2 times, most recently
from
October 2, 2026 21:25
03166e7 to
4b84314
Compare
zzylol
force-pushed
the
stack/528-08-cleanup
branch
from
October 2, 2026 21:25
8b2dfff to
5f9d447
Compare
zzylol
force-pushed
the
stack/528-07-planner
branch
from
October 2, 2026 21:56
4b84314 to
d9da0f9
Compare
zzylol
force-pushed
the
stack/528-08-cleanup
branch
from
October 2, 2026 21:56
5f9d447 to
cc36ea0
Compare
zzylol
force-pushed
the
stack/528-07-planner
branch
from
October 3, 2026 02:31
d9da0f9 to
ec9f8cb
Compare
zzylol
force-pushed
the
stack/528-08-cleanup
branch
from
October 3, 2026 02:31
cc36ea0 to
fe7d713
Compare
zzylol
force-pushed
the
stack/528-07-planner
branch
from
October 3, 2026 02:39
ec9f8cb to
95eef55
Compare
zzylol
force-pushed
the
stack/528-08-cleanup
branch
from
October 3, 2026 02:39
fe7d713 to
0f6e7e4
Compare
This was referenced Oct 3, 2026
Contributor
Author
|
Follow-up: the module/crate reorganization by #509 stages and the #511 IR (removing 🤖 Generated with Claude Code |
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.
Problem: the old two-IR representation is still on disk and in the tools after the #511 migration
#511 replaces the separate pre-ASAP and post-ASAP representations with one operator DAG.
operator-sharing.md§Goal and problem: "Today, the post-ASAP representation wraps relational subplans and duplicates some relational operators outside those wrappers." Its §3 Acceptance criteria require that "Scalar expressions and conversions use the same representation before and after optimization, with no bridge nodes or hidden subplans".decoupling_op_and_expr.md§4 Acceptance and scope requires plans with no "PromqlScalarBridgeor equivalent constant-wrapper node", and says implementation "will require frontend, validation and plan-format migration".PRs 1–7 of this stack moved production code to the shared
ir::OperatorNodewithOperator::NonASAP(NonASAPOp)andOperator::ASAP(ASAPOp). Before this PR, three things were still left over:Legacy and transitional source files on disk. These files were not declared by any
modand were not compiled, but they still defined the old IR and parallel implementations:types/src/pre_asap/query_expr.rsQueryExpr, "the canonical pre-ASAP intent algebra IR"ir::OperatorNode+NonASAPOp+ScalarExprtypes/src/post_asap/expr.rsSummaryExpr(incl.KeepPreAsap),SummaryNode,ValueOperationir::ASAPOpinsideir::OperatorNodetypes/src/post_asap/post_asap_dag.rsPostAsapDAGcontractir::export::PostAsapDAG(wire version 7)types/src/pre_asap/cse.rs,types/src/post_asap/cse.rsshare_common_summary_sub_dags)ir::cse::share_common_sub_dagstypes/src/pre_asap/{canonicalize,resolve,schema_resolver}.rs,types/src/ir/schema_support.rsQueryExprcanonicalization and resolutionir::canonicalize,frontend-common::{resolve, schema_resolver},pre_asap::schemaasap-physical-operators/src/unified_physical_planner/*,unified_sources/*,expressions/unified_planner.rs,readout.rsphysical_planner/*,sources/*,expressions/planner.rs,evaluation.rs/summary_kernels/exact.rsfrontend-{promql,sql,metricsql}/src/unified/*frontend-promql/src/promql.rs,frontend-sql/src/sql/,frontend-metricsql/src/lib.rsThe DAG viewer still spoke the old vocabulary.
tools/dag-viewer/node-style.jscategorized kinds the exporter can no longer emit, and missed kinds it does emit:KeepPreAsap,PromqlScalarBridge,EvalTimestamp,CurrentTimestamp,PromqlScalarFromVector,RelationalJoin,SummaryBinaryOp,ValueOperationValues,FinalizeExactAccumulator,MaintainPopulation,EvaluatePopulation,ExtensionThe fixtures still showed a summary input as a wrapped sub-DAG:
Docs described the old representation. Architecture and developer guides still used
QueryExpr,SummaryExpr,KeepPreAsap,SketchAlgorithmStrategyand "readout".Scope. This PR covers the last migration step of #511: delete the leftover definitions, move the viewer to
Operator::kind_name, and update docs. Cleanup criterion: removeKeepPreASAPand the previous separate, non-shared logical DAG/node definitions. The logical compiler must use the sharedir::OperatorNodewithNonASAPOpandASAPOp; the physical-planner crate must not define a parallel logical planning-node IR. Remove the temporary parallel physical-planner implementation once it has been promoted into the canonical planner, and obsolete physical planning IR node definitions. It keeps the runtimePhysicalDAGand executable physical operators, which are needed to run a plan. The versionedir::export::PostAsapDAGstructs are serialization DTOs at the boundary, not a second in-memory planner IR;dag_exportnode structs are viewer/export formats. No production behavior changes.Proposed method
KeepPreAsapare a code comment inreplacement.rsand the negative assertion inoperator_design_examples.rs.node-style.jsmaps exactly the 30Operator::kind_name()values to color categories. TheKeepPreAsapstyle override and legend row inviewer.jsare removed. Fixtures anddag.example.jsonuse flat ordinary nodes (Scan,Project) where they usedKeepPreAsap(...), andASAPStrategieswhere they usedSketchAlgorithmStrategy. The README states thatkindisOperator::kind_name, that scalar expressions are not nodes, and that an operator read by a scalar expression is a child shown as{"scalar_ref": <node id>}.crates/devtools/tests/viewer_contract.rsreadsKIND_CATEGORY_JSONout ofnode-style.jsand checks that its keys equal the set of exported kinds. Exhaustive matches overNonASAPOpandASAPOpmake a new operator variant a compile error until the kind list is updated.operator-sharing.mdnow namesSchemaDerivationErrorinstead ofQueryExprError. Newdocs/develop_docs/operator-design-acceptance.mdmaps the docs: define unified operators and SQL/PromQL scalar boundaries #511 acceptance criteria and comparison-table rows to the implementation and tests.scalar_type_rulesmodule doc, and the test namescalar_type_ruless_fail_closed→scalar_type_rules_fail_closed.Pipeline position: none. This touches IR definitions, tooling and docs only.
Key code interfaces
This PR adds no public Rust API. It leaves these as the only planner IR (
crates/types/src/ir/node.rs):The viewer reads the export node (
crates/types/src/dag_export.rs, unchanged here). ItskindisOperator::kind_name():New contract test (
crates/devtools/tests/viewer_contract.rs):Viewer table (
tools/dag-viewer/node-style.js):Deleted, by name:
QueryExpr,SummaryExpr,SummaryNode,ValueOperation, the oldpost_asap::PostAsapDAG,share_common_summary_sub_dags,with_promql_series_identity(old copy),unified_physical_planner::{compile, bind, bind_with_data_sources, compile_node},unified_sources::{DataSources, Scan},CompiledExpression(old copy),readout::{exact_readout, insufficient_counter_samples}(old copies), and theunifiedfrontends.Fields
OperatorNode(unchanged; listed because it is now the only node type):operatorOperatorNonASAP(NonASAPOp)for an ordinary query operator,ASAP(ASAPOp)for a summary operator. Inputs areRc<OperatorNode>inside the payload.result_kindOperatorResultKindRelation,InstantVector,RangeVector, orState(unfinalized summary or accumulator state).OperatorNode::new/with_schema.schemaSchemawith_schemamay supply names and qualifiers).guaranteeOption<ResultGuarantee>Nonemeans unassessed or unknown, never exact.timingOption<ExecutionTiming>IngestionTimeorQueryTimeonce lifecycle assignment runs.Nonein logical plans; export rejects an executable node without it.Operator::kind_name()returns the variant name. It is thekindstring the exporter writes and the viewer looks up.DAGNodefields read by the viewer:idkindOperator::kind_name(), for example"Aggregate"or"SummaryAgg". Key intoKIND_CATEGORY_JSON.labelScan(netflow_table).detail{"scalar_ref": <node id>}.schemaOperatorNode::schemaas JSON, entries underfields.childrenOperatorNode::childrenorder: operator inputs, then nodes referenced from scalar expressions.workload_node_idContract test items:
NON_ASAP_KINDSNonASAPOp::kind_name()values.ASAP_KINDSASAPOp::kind_name()values.kind_lists_track_every_variantmatchon every variant stops compiling when a variant is added, until the lists are updated.viewer_kind_categoriesconst KIND_CATEGORY_JSON = \`` fromnode-style.js` and parses it as JSON, as the viewer does.viewer_categorizes_exactly_the_exported_node_kindsKIND_CATEGORY_JSON(kind → category) after this PR:dataScan,ValuesfilterFiltersamplePromqlSeriesSamplederiveProject,PromqlRelabel,PromqlInfoEnrich,PromqlVectorFromScalar,BinaryOpaggregateAggregatewindowTimeRange,PromqlSubquery,TimeShift,SQLWindowFuncjoinJoinsetDedup,SetOpcombineConcatsortSort,LimitsummarySummaryAgg,SummaryEstimate,SummaryMerge,SummarySubtract,SummaryDelete,SummaryJoin,FinalizeExactAccumulator,MaintainPopulation,EvaluatePopulation,ExtensionExamples
One summary plan, before and after
tools/dag-viewer/post_asap_fixture.json, KLL overnetflow_table:Every operator is one node with its own
kind. The scan is visible, not hidden in a wrapper. This matches the "Proposed" side of the #511 §Goal and problem figure, where the scan under a KLL build is directly visible.What the contract test catches
KeepPreAsapValuesorEvaluatePopulationNonASAPOporASAPOpvariant without a list entrykind_lists_track_every_variant)node-style.jswithoutKIND_CATEGORY_JSON, or invalid JSONexpectmessageOut of scope
tools/dag-viewer/render.pystill has aKeepPreAsaprendering branch; it is unreachable for current exports.PhysicalDAGand executable physical operators are kept on purpose.Stack and validation
Stack 8/8 of the #528 split · Base: #542 · Next: #551 · Reference/tracker: #528.
The stack is rebased onto
mainat7734c68f, keeping #544 DAG naming and the later #535 schema compatibility/naming fixes, so it includes changes beyond the original #528 snapshot. This is a review split of that implementation. #532 is already in the main-branch base.Validation: full workspace tests/doctests (1,590 passed); formatting; workspace all-target/all-feature Clippy with warnings denied; viewer tests (25 passed, 6 Node-dependent tests skipped because Node is unavailable). All eight rebased layers pass workspace/all-target/all-feature Clippy; the final stack passes the full workspace tests.
🤖 Generated with Claude Code