Repository navigation
Conversation
zzylol
force-pushed
the
stack/572-b3-physical-optimizer
branch
from
October 5, 2026 06:21
a3c2d63 to
8d2a23d
Compare
zzylol
force-pushed
the
stack/572-b4-plan-selection
branch
2 times, most recently
from
October 8, 2026 16:47
31a177e to
4db77b5
Compare
Move asap-aware-mapping's Stage 3 modules into the new asap-plan-selection crate: the cost model and its inputs under cost/, plan_selection/mod.rs as the crate root (select_plan, PlanningModels) and candidate_selection, with their tests and the test_support copy. Delete pane_sharing, erp and empirical_comparison, which have no callers (#572), and the snapshot_prepare_cpu helper only empirical_comparison used. A manifest guard rejects the facade and executor. Imports are rewritten without compatibility re-exports (#572, B4). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nd Operator<NodeId> payloads Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W7qG9aFyPij5uWsyAJCxDW
zzylol
force-pushed
the
stack/572-b4-plan-selection
branch
from
October 10, 2026 14:32
4db77b5 to
9ba90c2
Compare
zzylol
force-pushed
the
stack/572-b3-physical-optimizer
branch
from
October 10, 2026 14:32
20db54d to
9c43271
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.
Rebased on main d4869a7 (DF 54).
Why
#572 puts each #509 stage in its own crate so that Cargo enforces the one-way stage flow. This PR is step B4: Stage 3 (plan selection, the only stage that uses the cost model) moves out of
asap-aware-mappinginto a new crate,asap-plan-selection. As #572 decided, three modules with no callers are deleted instead of moved. Behavior is otherwise unchanged.What
Before this PR
After this PR
cargo tree -p asap-plan-selection --depth 1 -e normal,dev:How
git mvfor 16 files (table below).plan_selection/mod.rsbecomes the crate root, soPlanningModels(Q37),select_planandselect_exhaustiveare atasap_plan_selection::…. The crate root also keeps the re-exportsasap-aware-mapping's root had for the moved items:CostModel,DefaultCostModel, the recurrence types and thecandidate_selectiontypes.cost/, includingquery_physical_loweringandstorage_io(Reorganize crates and modules by #509 stages and the #511 unified IR #572 update: only cost code calls them) andempirical_resources(used byempirical_cost). There is noaccuracy/module: its two planned members,erpandempirical_comparison, are deleted, and moving theAccuracyModeltrait there (Q22) is a behavior change, not part of this move.cargo check, rewrote imports across the workspace:crate::cost_model→crate::cost::cost_modelinside the crate, andasap_aware_mapping::{cost_model, …, plan_selection}→asap_plan_selection::…inasap-aware-mapping/pass,asap-physical-operators, devtools, integration-tests, planner, frontend-promql tests and the docs.passno longer re-exportsPlanningModels;asap-plannerre-exports it fromasap_plan_selection.asap-aware-mappingdropsserde,serde_jsonand its dev-dependency. devtools, integration-tests, frontend-promql (dev) and asap-physical-operators (dev) now depend onasap-plan-selectioninstead ofasap-aware-mapping, which they no longer import. frontend-sql drops an unusedasap-aware-mappingdev-dependency.include_str!paths inempirical_cost.rsgain one../for the deeper location.tests/stage3_dependencies.rs, fails if the manifest namesasap-aware-mapping,asap-plannerorasap-physical-operators. The Stage 1 guard also rejectsasap-plan-selection.offline-sketch-evidence.mdand the ERP proposal now say that their consumers were deleted. The historical table inplanner-vocabulary-migration.mdis unchanged.Deleted modules (no callers)
At the base of this PR,
git grep -n -wfor each module name and its public items (PaneReuseCandidate,SharedPaneGroup,select_shared_panes,ErpArtifact,ErpSelection,recommend_offline,OfflineComparisonRequest), outside the modules themselves, finds only thepub modlines and documentation:pane_sharing.rsshares_compatible_windows,excludes_invalid_and_nonbeneficial_quoteserp.rsselects_cheapest_applicable_accurate_configuration,distribution_mismatch_fails_closed,multi_fit_selects_only_confident_well_fitting_family,multi_fit_rejects_ambiguous_or_poor_observations,multi_fit_jointly_ranks_all_plausible_families,exact_empirical_fingerprint_precedes_fits_and_requires_identity,deserializes_sketch_bench_wire_format,nearest_shape_prefers_cardinality_and_skew_then_cost,nearest_shape_rejects_distribution_family_and_small_benchmarks,pane_window_composes_atomic_operation_costsempirical_comparison.rsaccuracy_requirement_changes_selected_configuration_and_cost,preparation_and_exact_resource_dimensions_keep_their_meaning,optional_exact_dimensions_cannot_hide_invalid_measurements,sketch_comparison_requires_unknown_preparation_phase,missing_cost_or_failed_error_acceptance_selects_exact,applicability_is_checked_before_recommendation,resource_objective_and_unknown_memory_are_explicit,formal_minimums_cannot_be_relaxed_by_observed_accuracy,comparison_requires_disjoint_phases_and_one_exact_generationempirical_cost::snapshot_prepare_cpu(pub(crate))unmeasured_preparation_for_other_families_stays_unknown. Its only production caller wasempirical_comparison(empirical_comparison.rs:414); without it the function is dead code and fails-D warnings.Moved files
asap-aware-mapping/plan-selection/src/plan_selection/mod.rssrc/lib.rssrc/plan_selection/candidate_selection.rssrc/candidate_selection.rssrc/{cost_model, analytical_cost, physical_plan_cost_model, physical_operator_statistics, physical_handoff_cost, recurrence, empirical_cost, empirical_resources, query_physical_lowering, storage_io}.rssrc/cost/*.rssrc/test_support.rssrc/test_support.rstests/{physical_handoff_cost, storage_io}.rs,tests/data/offline-evidence-synthetic.jsontests/…New:
Cargo.toml,src/cost/mod.rs,tests/stage3_dependencies.rs.Volume
62 files changed, +340 / −2,208. 16 files moved with
git mv, 3 new, 3 modules (1,887 lines) deleted. About 170 changed lines name the new paths.Gate (at the tip)
cargo fmt --all --check: passes.cargo clippy --workspace --all-targets --all-features -- -D warnings: passes.cargo test --workspace: 1,508 passed, 12 ignored. That is B3's 1,529, less the 22 deleted tests listed above, plus the new manifest guard. Compared with refactor: extract the Stage 1 logical-optimizer crate (#572 B2) #583 (1,528): −22 + 2 guards.python3 -m unittest discover -s tools/dag-viewer -p test_render.py: OK, 6 skipped.stage_pipeline --example planner-layering-1regeneratestools/dag-viewer/examples/planner-layering-example1.jsonbyte for byte.Part of #572 (B4) and #509. Follows #584. Related: #580 (deletes
candidate_selection). Next: B4b (facade intoasap-planner).🤖 Generated with Claude Code