Repository navigation
refactor(stage1): move Pass 1's memo population into pass1; forbid pass1 → pass2 imports (#1096) - #1192
Merged
Conversation
milindsrivastava1997
marked this pull request as ready for review
November 3, 2026 03:45
milindsrivastava1997
left a comment
Collaborator
Author
There was a problem hiding this comment.
Automated code review (Claude Code); findings are unverified.
crates/logical-asap-optimization/tests/pass_layering.rs:290: The guard only matches the substringpass2, so Pass 1 can still import Pass 2 types through crate-root re-exports (crate::Pass2RuleError,crate::TumblingWindowWidthDomain,crate::Pass2RoundState). E.g.use crate::TumblingWindowWidthDomain;inpass1/passes the test; this PR's own tests inpass1/logical_memo_candidates.rsalready use that route.crates/logical-asap-optimization/tests/pass_layering.rs:288: Splitting production from test code on the literal"#[cfg(test)]\nmod tests"misses CRLF checkouts (core.autocrlf=true) and any other test-module layout. Then test code counts as production, anda_summary_pass2_may_reuse_for_another_aggregate_is_keptinper_computation_candidates.rstrips a false violation.
…ss1 → pass2 imports (#1096) `pass2/memo/groups.rs` (`try_populate_pass1`, `NodeToStructuralIdCache`) and `pass2/memo/candidates.rs` (`CandidatePopulationError`) are Pass 1 code. They move into `pass1/memo_population.rs`, so Pass 1's production code imports nothing from Pass 2. `tests/pass_layering.rs` enforces the direction; Pass 2 → Pass 1 remains (#1191). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
milindsrivastava1997
force-pushed
the
1096-stage1-layering
branch
from
November 4, 2026 01:46
f46d3c7 to
40ee8d6
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.
Why
Part of #1096 (Stage 1 layering). Pass 1 runs before Pass 2, but Pass 1's production code imported
crate::pass2::memo: the code that fills Stage 0's memo groups with Pass 1 candidates lived underpass2/.What
pass2/memo/groups.rs→pass1/memo_population.rs(try_populate_pass1,NodeToStructuralIdCache).CandidatePopulationErrormoves into the same file;pass2/memo/candidates.rsis deleted.tests/pass_layering.rs: fails if Pass 1's production code referencespass2. Test modules may still use Pass 2 for fixtures. No exceptions: Remove unnecessary deadlines and caps in the group selection MILP #1185 part 2 (refactor(planner): plan without deadlines over every tumbling-window width (#1185, part 2) #1198) deletedcheck_generation_deadline, the last shared item.planner-layering.md.How
A pure move plus import-path updates. Public paths are unchanged:
CandidatePopulationError(crate root) andtest_support::try_populate_pass1keep their names.Pass 2 → Pass 1 is still allowed:
PerComputationCandidateErroris effectively Stage 1's shared error, andasap_aware_cse.rsuses Pass 1 helpers. Removing that is #1191.Key code interfaces added / modified
None (crate-private module moves only).
Major algorithm changes
None.
Before this PR
After this PR
No
pass2references in Pass 1's production code, andcargo test -p asap-logical-asap-optimization --test pass_layeringfails on any new one.Snapshot changes
None.
Verification
cargo test -p asap-logical-asap-optimization --all-targets: 207 passed, 1 ignored;pass_layering1 passed. After rebasing onto refactor(planner): plan without deadlines over every tumbling-window width (#1185, part 2) #1198: lib 201 passed,pass_layering1 passed.pass_layeringfails when ause crate::pass2::…line is planted inpass1/realization.rs(checked, then reverted).cargo check -p asap-physical-asap-optimization -p asap-planner -p asap-integration-tests --all-targets(after the rebase:-p asap-planner -p asap-devtools --tests),cargo clippy -p asap-logical-asap-optimization --all-targets,cargo fmt --all --check: clean.🤖 Generated with Claude Code