refactor(plan): add asap-plan optimizer layer, move CSE into it (#57, phase 1) - #58
Merged
Merged
Conversation
… phase 1) Phase 1 of the crate reorg (#57): introduce the optimizer layer that sits between the IR (core) and any runtime. It lands as a placeholder with one real occupant — workload-level CSE — plus stub modules marking where the optimizer work goes. - New `asap-plan` crate (depends only on the IR crate, never a front end). - Move `intent_algebra/cse.rs` -> `asap-plan/src/cse.rs` (imports rebased onto `asap_control_core::…`); drop the `cse` module + `dedupe_subtrees` / `CseWorkloadPlan` re-export from core. - Stub modules with TODOs: `cost_model` (#6/#33), `boundary` (#34 per-node sketch-vs-exact), `canonicalize` (#34 shared normalization pass). No behavior change; CSE's own tests move with it. Full workspace suite green; clippy --all-targets clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Phase 1 of the crate reorg (#57): introduce
asap-plan, the cost-aware optimizer layer between the IR (core) and any runtime.What
asap-plancrate — depends only on the IR crate, never on a front end (the layering invariant holds: arrows point up).intent_algebra/cse.rs→asap-plan/src/cse.rs(workload-level CSE), rebasing its imports ontoasap_control_core::…. Drops thecsemodule and thededupe_subtrees/CseWorkloadPlanre-export fromcore, so the IR crate no longer carries a cost-aware pass.cost_model— cost traits + the model CSE credits a shared producer against (Wire workload-level CSE into a cost model #6, Add logic to detect which optimizations are applicable to a query workload #33)boundary— the per-node sketch-vs-exact accuracy decision (L3 IR standardization: cross-language correctness and canonicalization #34 cross-cutting; an L4 concern not carried in L3)canonicalize— the single post-lowering normalization pass both front ends run through (L3 IR standardization: cross-language correctness and canonicalization #34)Why placeholder-with-CSE
Per the plan in #57: land the layer now with a genuine occupant (CSE) so it isn't an empty shell, and leave stubs so #6/#33/#34 have an obvious home.
Verification
No behavior change — CSE's own unit tests move with it and pass in the new crate. Full workspace suite green (21 test binaries);
cargo clippy --all-targetsclean. Git trackscse.rsas a rename (92% similar).Next
Phase 2 (split
asap-sketchout ofcore), Phase 3 (renamecore→asap-ir), Phase 4 (splitlowerfront ends), Phase 5 (README/docs) — tracked in #57.Part of #57.
🤖 Generated with Claude Code