Skip to content

refactor(planner): rename asap-physical-operators to the Stage 4 asap-executor crate - #587

Draft
zzylol wants to merge 1 commit into
stack/572-b4b-planner-facadefrom
stack/572-b5-executor
Draft

zzylol wants to merge 1 commit into
stack/572-b4b-planner-facadefrom
stack/572-b5-executor

Conversation

@zzylol

@zzylol zzylol commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Why

#572 puts each #509 stage in its own crate. Stage 4, the reference executor, stays in this repository as a separate crate that no planning stage depends on. This PR is step B5, the last Phase B step. It renames asap-physical-operators to asap-executor, keeping plan/ and physical_planner/ in it, as #572's 2026-10-03 update decides: they compile plans into runtime operators, and plan and runtime import each other. It is a pure rename.

What

Before this PR

asap-integration-tests ··dev··► asap-physical-operators ──► asap-types
asap-physical-operators ··dev··► asap-plan-selection, asap-logical-optimizer, asap-frontend-promql

After this PR

asap-integration-tests ··dev··► asap-executor ──► asap-types
asap-executor ··dev··► asap-plan-selection, asap-logical-optimizer, asap-frontend-promql   (its tests)

cargo tree -i asap-executor -e normal,dev,build --depth 1 shows only asap-integration-tests, as a dev-dependency. For each of asap-logical-optimizer, asap-physical-optimizer, asap-plan-selection and asap-planner, cargo tree -p <crate> -e normal,dev,build does not contain asap-executor.

cargo tree -p asap-executor --depth 1 -e normal,dev:

asap-executor
├── asap-types (as planner-types)
├── asap_sketchlib, chrono, futures, regex, serde, serde_json, thiserror, tracing
[dev-dependencies]
├── asap-frontend-promql
├── asap-logical-optimizer
├── asap-plan-selection
└── rmp-serde

How

  • git mv crates/asap-physical-operators crates/executor. The package is now asap-executor, so the library is asap_executor.
  • No compatibility re-exports. asap_physical_operators → asap_executor everywhere: the executor's own tests and README doctest, six integration-tests files, and two docs.
  • Manifest guards. The Stage 1, 2 and 3 guards now reject asap-executor instead of asap-physical-operators. The executor's manifest states the rule.
  • Executor tests keep their dev-dependencies on stage crates. physical_planner/candidates.rs:367 and four integration tests (deployment_computation, planspace_series_identity_heap, precompute_candidates, promql_fallback) call the legacy global_selection. This is the allowed direction, executor → stage, so no stage crate depends on the executor and nothing needs to move to integration-tests. These call sites go away with Pass 2 sharing and Stage 1 coverage parity with the retired MajorPass #580.

Moved files

From To
crates/asap-physical-operators/** (85 files: src/{plan, physical_planner, runtime, operators, sources, summary_kernels, expressions, dag, …}, 18 integration tests, README) crates/executor/**

66 files move unchanged; 19 change only in the crate path (Cargo.toml, README, tests).

Volume

99 files changed, +208 / −227. 85 files renamed, about 130 lines rewritten from asap_physical_operators to asap_executor.

Final layout versus #572

crates/
  types/                 ir/{operator, scalar, schema, properties, export, physical_export, wire, cse,
                         canonicalize, query, schema_support}, workload/, physical/, cost.rs, dag_export.rs
  frontend-common, frontend-sql, frontend-promql, frontend-metricsql   Stage 0
  logical-optimizer/     Stage 1: pass1/, pass2/{reconciliation, topk_reuse}, accuracy/
  physical-optimizer/    Stage 2: implementation/physical_candidates
  plan-selection/        Stage 3: lib.rs (select_plan, PlanningModels), candidate_selection, cost/
  executor/              Stage 4: plan, physical_planner, runtime, operators, sources, summary_kernels,
                         expressions, values, capability, dag, evaluation
  planner/               facade: lowering dispatch + pass/ (OptimizationPass, StagePipeline, optimize)
  devtools/, integration-tests/

asap-aware-mapping and asap-physical-operators are gone. Dependencies flow one way: logical-optimizer ← physical-optimizer (dev only) ← plan-selection ← planner; executor depends only on types.

Deviations from #572's target:

#572 target Now Reason
physical-optimizer/materialization/{summary_maintenance_lifecycle, pane_sharing, storage_io} Absent Lifecycle deleted in #543; pane_sharing deleted in #585 (no callers); storage_io is in plan-selection/cost (#572 update). Stage 2 materialization is not built yet.
physical-optimizer/implementation/ includes query_physical_lowering and {plan, physical_planner} Only physical_candidates #572 update: query_physical_lowering goes to plan-selection, {plan, physical_planner} to the executor.
physical-optimizer depends on logical-optimizer Dev-dependency only Production code only takes OperatorNode roots.
plan-selection/accuracy/{erp, empirical_comparison} and the AccuracyModel trait No accuracy/ module erp and empirical_comparison deleted (no callers). The trait remains in logical-optimizer/src/accuracy/mod.rs, and Stage 1's legacy search still takes it (Q22). Moving it is a behavior change.
plan-selection/cost/summary_maintenance_cost Absent Deleted in #543.
plan-selection/cost/ Also holds query_physical_lowering, storage_io, empirical_resources #572 update; empirical_resources is the measurement schema empirical_cost uses.
Plan selection itself Crate root plus candidate_selection plan_selection was added in Phase C after #572 was written; candidate_selection is deleted under #580.
planner/ absorbs the pass driver Done A custom pass (#430) now depends on asap-planner and so on the frontends (see #586).
Executor is a renamed asap-physical-operators Also keeps capability, dag, evaluation, measurement, statistic, key_by_label_values, error Pure rename.
Leftover pre-#509 names renamed pre_asap_sub_dag key (tools/dag-viewer/render.py), tools/dag-viewer/post_asap_fixture.json, devtools bins show_pre_asap_ir / show_post_asap_ir, and asap_types::post_asap text in dag.example.json remain Types step (B1) scope; not touched by B3–B5.
types/ Also has cost.rs (export cost annotations), dag_export.rs, serde_f64.rs, types.rs Not covered by #572's sketch.

Gate (at the tip)

Part of #572 (B5, completes Phase B) and #509. Follows #586. Related: #580.

🤖 Generated with Claude Code

…-executor crate

Rename crates/asap-physical-operators to crates/executor (package
asap-executor), keeping plan/ and physical_planner/ in it as #572's
2026-10-03 update decides. Imports are rewritten without compatibility
re-exports. The three stage manifest guards now reject asap-executor;
only integration-tests depends on it (#572, B5).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant