Skip to content

refactor(ir): remove legacy scaffolding and finish tooling migration - #543

Draft
zzylol wants to merge 8 commits into
stack/528-07-plannerfrom
stack/528-08-cleanup
Draft

zzylol wants to merge 8 commits into
stack/528-07-plannerfrom
stack/528-08-cleanup

Conversation

@zzylol

@zzylol zzylol commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Rebased on main d4869a7 (DF 54).

Rebuilt on the revised stack (2026-10-03)

Old #543 deleted files that no mod declared. On the revised stack those legacy modules were still compiled, and parts of the new IR depended on them. This version therefore migrates code first, then deletes it. It also removes the summary maintenance lifecycle: #509 Stage 2 materialization will decide, per sub-DAG, whether to materialize and at ingestion or query time. Seven commits, 144 files, +2,248 / −36,405:

  1. Remove the old QueryExpr / SummaryExpr IRs. Parameter types (GroupKeys, Reduction, Source, …) move to ir/operator_properties.rs, and their users are migrated. Deleted: pre_asap/{query_expr, cse, canonicalize, resolve, schema_resolver}, post_asap/{expr, cse, post_asap_dag}, and the undeclared unified* leftovers.
  2. Docs and the DAG viewer describe the unified operator IR.
  3. Remove the summary maintenance lifecycle. This deletes summary_maintenance_lifecycle, summary_maintenance_cost/, its DAG export, post_asap::{summary_maintenance, summary_maintenance_lifecycle}, SummaryWindowFramework and the lifecycle e2e test. MajorPass becomes plain cost-only selection plus assembly. The pane primitives stay, for Pass 2 window composition.
  4. LifecycleAssignment is renamed MaterializationAssignment, and the default is all query time: nothing is materialized until Stage 2 owns that decision. Tests that exercise maintenance now assign ingestion time explicitly.

Behavior and API changes:

  • UserInput::new / OptimizationInput::new drop the lifecycle argument, and QueryLifecyclePlan becomes QueryPlan.
  • Planner output now marks summaries as query time.
  • Where lifecycle selection used to force raw recompute, the default cost model now picks sketches.

Tests: 234 tests were deleted, each living in a deleted legacy file or testing only the lifecycle; rewired tests are listed in the commits. One new test pins the default (default_assignment_materializes_nothing). Independently re-run: fmt and clippy with -D warnings are clean, and cargo test --workspace gives 1,511 passed, 0 failed, 2 ignored.


Revised Phase A stack (see #528): #567 → #560 → #537 → #539 → #540 → #541 → #542 → #543. The pre-rebuild description is in the PR history.

🤖 Generated with Claude Code

@zzylol
zzylol force-pushed the stack/528-08-cleanup branch from 6c2c313 to 2bd4c4d Compare October 2, 2026 18:32
@zzylol
zzylol force-pushed the stack/528-07-planner branch 2 times, most recently from 2a3bcd0 to a03efc2 Compare October 2, 2026 19:40
@zzylol
zzylol force-pushed the stack/528-08-cleanup branch 2 times, most recently from 78b6dc3 to e40ffdb Compare October 2, 2026 21:14
@zzylol
zzylol force-pushed the stack/528-07-planner branch from a03efc2 to 2c708f3 Compare October 2, 2026 21:14
@zzylol
zzylol force-pushed the stack/528-08-cleanup branch from e40ffdb to 8b2dfff Compare October 2, 2026 21:22
@zzylol
zzylol force-pushed the stack/528-07-planner branch 2 times, most recently from 03166e7 to 4b84314 Compare October 2, 2026 21:25
@zzylol
zzylol force-pushed the stack/528-08-cleanup branch from 8b2dfff to 5f9d447 Compare October 2, 2026 21:25
@zzylol
zzylol force-pushed the stack/528-07-planner branch from 4b84314 to d9da0f9 Compare October 2, 2026 21:56
@zzylol
zzylol force-pushed the stack/528-08-cleanup branch from 5f9d447 to cc36ea0 Compare October 2, 2026 21:56
@zzylol
zzylol force-pushed the stack/528-07-planner branch from d9da0f9 to ec9f8cb Compare October 3, 2026 02:31
@zzylol
zzylol force-pushed the stack/528-08-cleanup branch from cc36ea0 to fe7d713 Compare October 3, 2026 02:31
@zzylol
zzylol force-pushed the stack/528-07-planner branch from ec9f8cb to 95eef55 Compare October 3, 2026 02:39
@zzylol
zzylol force-pushed the stack/528-08-cleanup branch from fe7d713 to 0f6e7e4 Compare October 3, 2026 02:39
@zzylol

zzylol commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author

Follow-up: the module/crate reorganization by #509 stages and the #511 IR (removing pre_asap / post_asap and splitting asap-aware-mapping) is tracked in #572 and starts after this cleanup lands.

🤖 Generated with Claude Code

@zzylol
zzylol marked this pull request as draft October 3, 2026 20:02
@zzylol
zzylol force-pushed the stack/528-07-planner branch 2 times, most recently from 74b4884 to e629370 Compare October 3, 2026 20:48
zzylol added a commit that referenced this pull request Oct 3, 2026
Re-applies the documentation half of the earlier legacy cleanup (#543) on
the revised stack, resolving conflicts in favor of the current text where
it is newer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
zzylol added a commit that referenced this pull request Oct 3, 2026
Re-applies the viewer half of the earlier legacy cleanup (#543): the
viewer categorizes exactly the NonASAPOp/ASAPOp kind names, its fixtures
use the unified export, and devtools/tests/viewer_contract.rs pins the
viewer's category table to every operator variant.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@zzylol
zzylol force-pushed the stack/528-08-cleanup branch from 0f6e7e4 to e529b6e Compare October 3, 2026 21:27
zzylol added a commit that referenced this pull request Oct 6, 2026
Re-applies the viewer half of the earlier legacy cleanup (#543): the
viewer categorizes exactly the NonASAPOp/ASAPOp kind names, its fixtures
use the unified export, and devtools/tests/viewer_contract.rs pins the
viewer's category table to every operator variant.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@zzylol
zzylol force-pushed the stack/528-07-planner branch from 0c62c4a to e153234 Compare October 6, 2026 17:47
@zzylol
zzylol force-pushed the stack/528-08-cleanup branch from 10ef511 to 843f37b Compare October 6, 2026 17:47
@zzylol
zzylol force-pushed the stack/528-07-planner branch from e153234 to 9d9bff2 Compare October 6, 2026 20:02
zzylol added a commit that referenced this pull request Oct 6, 2026
Re-applies the documentation half of the earlier legacy cleanup (#543) on
the revised stack, resolving conflicts in favor of the current text where
it is newer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
zzylol added a commit that referenced this pull request Oct 6, 2026
Re-applies the viewer half of the earlier legacy cleanup (#543): the
viewer categorizes exactly the NonASAPOp/ASAPOp kind names, its fixtures
use the unified export, and devtools/tests/viewer_contract.rs pins the
viewer's category table to every operator variant.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@zzylol
zzylol force-pushed the stack/528-08-cleanup branch from 843f37b to dcd5ce1 Compare October 6, 2026 20:04
zzylol added a commit that referenced this pull request Oct 6, 2026
Re-applies the documentation half of the earlier legacy cleanup (#543) on
the revised stack, resolving conflicts in favor of the current text where
it is newer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
zzylol added a commit that referenced this pull request Oct 6, 2026
Re-applies the viewer half of the earlier legacy cleanup (#543): the
viewer categorizes exactly the NonASAPOp/ASAPOp kind names, its fixtures
use the unified export, and devtools/tests/viewer_contract.rs pins the
viewer's category table to every operator variant.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@zzylol
zzylol force-pushed the stack/528-07-planner branch from 9d9bff2 to dbbf4c7 Compare October 6, 2026 20:17
@zzylol
zzylol force-pushed the stack/528-08-cleanup branch from dcd5ce1 to d2890b5 Compare October 6, 2026 20:17
zzylol added a commit that referenced this pull request Oct 6, 2026
Re-applies the documentation half of the earlier legacy cleanup (#543) on
the revised stack, resolving conflicts in favor of the current text where
it is newer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
zzylol added a commit that referenced this pull request Oct 6, 2026
Re-applies the viewer half of the earlier legacy cleanup (#543): the
viewer categorizes exactly the NonASAPOp/ASAPOp kind names, its fixtures
use the unified export, and devtools/tests/viewer_contract.rs pins the
viewer's category table to every operator variant.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@zzylol
zzylol force-pushed the stack/528-07-planner branch from dbbf4c7 to fa46076 Compare October 6, 2026 20:48
@zzylol
zzylol force-pushed the stack/528-08-cleanup branch from d2890b5 to a0c9c01 Compare October 6, 2026 20:48
zzylol and others added 8 commits October 6, 2026 21:52
The planner emits the unified operator IR end to end, so the old pre-ASAP
QueryExpr DAG, its resolver/canonicalizer/CSE, and the post-ASAP
SummaryExpr/PostAsapDAG modules have no live consumers left.

- Move the operator parameter types (GroupKeys, Reduction, Source, ...)
  into ir/operator_properties.rs; pre_asap re-exports them.
- Drop QueryExpr paths from execution_data_state, maintained_population,
  agg_intent, column_resolution, scalar_type_rules and pre_asap/schema.
  with_promql_series_identity keeps only its OperatorNode version in
  ir/schema_support.rs.
- Delete the undeclared unified/ frontend dirs, unified_physical_planner,
  unified_sources, expressions/unified_planner.rs and readout.rs.
- Migrate planner_vocabulary.rs off SchemaResolver; fix the
  scalar_type_rules_fail_closed test name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Re-applies the documentation half of the earlier legacy cleanup (#543) on
the revised stack, resolving conflicts in favor of the current text where
it is newer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Re-applies the viewer half of the earlier legacy cleanup (#543): the
viewer categorizes exactly the NonASAPOp/ASAPOp kind names, its fixtures
use the unified export, and devtools/tests/viewer_contract.rs pins the
viewer's category table to every operator variant.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Stage 2 materialization (#509) will decide per sub-DAG whether and when to
materialize, so the Planner no longer chooses a maintenance lifecycle.

- MajorPass now runs search_workload_with_targets -> global_selection ->
  assemble_selected_dag per root -> share_common_sub_dags.
- QueryLifecyclePlan becomes QueryPlan { entry_index, root }; PlanOutput's
  execution_timed_dag times the roots directly. LifecycleInput, the
  lifecycle errors and UserInput's `lifecycle` field are gone (public API
  break).
- Delete summary_maintenance_lifecycle, summary_maintenance_cost,
  summary_maintenance_dag_export, post_asap::{summary_maintenance,
  summary_maintenance_lifecycle} and SummaryWindowFramework (the pane
  primitives stay), the lifecycle CostModel hooks, CandidateCostOverrides
  and EmpiricalEvidenceProvider::lifecycle_cost_inputs.
- Delete the lifecycle e2e test and the viewer's lifecycle-plan UI; rewire
  e2e_plan, summary_sharing, operator_design_examples and
  weighted_topk_binding to the new pipeline.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rename LifecycleAssignment to MaterializationAssignment and
apply_lifecycle_timings to apply_materialization_timings. The default
assignment is now all_query_time(): nothing is materialized until Stage 2
materialization (#509) decides per sub-DAG. all_ingestion_time() and set()
assign maintenance explicitly.

- validate_default becomes validate_maintained: candidate legality is still
  checked with every summary maintained, so candidate generation is
  unchanged. planned_data_state and fixed_window_rate_candidates use the
  same maintained assumption, and the maintained precompute compilers in
  promql_rows assign ingestion time explicitly.
- PlanOutput::execution_timed_dag, show_post_asap_ir and the default test
  helpers now emit query-time summaries.
- Tests that exercise maintenance assign it explicitly (new `maintained`
  helpers); a new unit test pins the query-time default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ime default

Remove the lifecycle APIs, recipes and viewer section from the docs, delete
the workload-demand-and-summary-lifecycle proposal, and point materialization
questions to Stage 2 (#509). Rename LifecycleAssignment/apply_lifecycle_timings/
validate_default to their new names and describe the all-query-time default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Follow #537: the remaining tests read Operator<NodeId> payloads from the
physical DAG, and docs name ir::flat / ir::physical_export instead of the
removed ir::export.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@zzylol
zzylol force-pushed the stack/528-08-cleanup branch from a0c9c01 to 95f1f36 Compare October 6, 2026 22:16
@zzylol
zzylol force-pushed the stack/528-07-planner branch from fa46076 to 67800ba Compare October 6, 2026 22:16
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