Skip to content

refactor(planner): move Pass 1 helpers out of the legacy search; drop show_post_asap_ir, erp and empirical_comparison - #676

Merged
zzylol merged 2 commits into
mainfrom
stack/g2-legacy-removal
Oct 13, 2026
Merged

zzylol merged 2 commits into
mainfrom
stack/g2-legacy-removal

Conversation

@zzylol

@zzylol zzylol commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Why

This is the first step in removing the legacy replacement search. The rule is that a legacy piece is deleted only once the new architecture implements it, and the group that reimplements a capability deletes the legacy piece. This PR deletes only the pieces that are already replaced (show_post_asap_ir → stage_pipeline) or that the user decided to drop (erp, empirical_comparison: Assumption 5's deployment-owned empirical models cover them, and sketch-bench keeps its own copy). It also moves the helpers Pass 1 shares with the legacy search out of replacement.rs, so that file can be deleted later without touching Pass 1.

What stays, and which group or issue removes it:

What

  • New asap_aware_mapping::realization holds summary_candidates, accuracy_target, accuracy_budget, default_size_params, DEFAULT_DELTA, column_ref, summarised_column and summarised_input. The bodies moved unchanged from replacement.rs. The one difference is that summarised_column is now pub(crate), because the legacy search still calls it. Pass 1 (per_computation_candidates), replacement.rs and the other callers import from the new module. RealizationError also moves to realization (re-exported from replacement), so the new module does not depend on the legacy search.
  • Deleted the show_post_asap_ir bin, which stage_pipeline replaces. Renamed show_pre_asap_ir to show_logical_dag. Bins are auto-discovered, and no CI or tests referenced either name.
  • Renamed the frontend-common resolver's fallback schema to usage_derived_schema.
  • Deleted erp.rs and empirical_comparison.rs, plus empirical_cost::snapshot_prepare_cpu (only empirical_comparison used it) and its unit test.
  • No Markdown changes.

Verification

  • git grep -w finds no remaining reference to any deleted public item or to either old bin name outside Markdown.
  • cargo fmt --all -- --check and cargo clippy --workspace --all-targets -- -D warnings: clean.
  • cargo nextest run --workspace: 1609 passed, 50 skipped. All 23 removed tests were in deleted code: 10 in erp, 9 in empirical_comparison, 3 in show_post_asap_ir, and 1 for snapshot_prepare_cpu.
  • stage_pipeline --example planner-layering-1 output is byte-identical to tools/dag-viewer/examples/planner-layering-example1.json.
  • tools/dag-viewer/test_render.py: 29 OK. tools/verify_metricsql_external_consumer.sh: OK.

Human review

  • The moved helpers and RealizationError are unchanged
  • Deleting erp/empirical_comparison (and snapshot_prepare_cpu) matches the decision
  • The ownership list above for what stays is correct

🤖 Generated with Claude Code

https://claude.ai/code/session_01W7qG9aFyPij5uWsyAJCxDW

Comment thread crates/asap-aware-mapping/src/accuracy/estimators/mod.rs
Comment thread crates/asap-aware-mapping/src/cost_model.rs
… show_post_asap_ir, erp and empirical_comparison

- New asap_aware_mapping::realization holds the summary realization helpers
  (summary_candidates, accuracy_target, accuracy_budget, default_size_params,
  DEFAULT_DELTA, column_ref, summarised_column, summarised_input), moved
  unchanged from replacement.rs; Pass 1 and the legacy search import them.
- Delete the show_post_asap_ir bin (replaced by stage_pipeline); rename
  show_pre_asap_ir to show_logical_dag.
- Rename the frontend-common resolver's `fallback` schema to
  `usage_derived_schema`.
- Delete erp.rs and empirical_comparison.rs, and snapshot_prepare_cpu (only
  empirical_comparison used it).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W7qG9aFyPij5uWsyAJCxDW
@zzylol
zzylol force-pushed the stack/g2-legacy-removal branch from a4f58c1 to 67e7847 Compare October 13, 2026 19:29
@zzylol zzylol changed the title chore(planner): delete the legacy replacement search, legacy cost models and dag_export refactor(planner): move Pass 1 helpers out of the legacy search; drop show_post_asap_ir, erp and empirical_comparison Oct 13, 2026
realization.rs no longer imports from the legacy replacement search;
replacement.rs re-exports the error from realization.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W7qG9aFyPij5uWsyAJCxDW
@zzylol
zzylol merged commit 6665fcc into main Oct 13, 2026
3 of 4 checks passed
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