Repository navigation
feat: start memo-first planning and candidate-connection MILP migration - #933
Merged
Merged
Conversation
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.
Problem and resulting behavior
Memo planning currently constructs logical group identity after Pass 1 and depends on orchestration/helpers housed under legacy search. This draft begins the implementation of the memo/candidate design discussed in #776: memo routes establish identity before Pass 1, populate those same groups after capability pruning, and continue through the existing Pass 2 rules and selection. The full legacy-removal migration is not complete.
Before this PR
P95/P99 workload roots first become a
PerComputationCandidatesinventory, then the selection layer interns groups. The MILP obtains its independent-query incumbent by calling legacy planning. Source-component analysis, diagnostic remapping, and public stage orchestration also live undersearch/legacy.After this PR
LogicalMemolives in the logical optimization crate and interns roots before Pass 1 on memo routes, including component workloads. Candidate population preserves group IDs and original-node references. Existing from-Pass-1 callers remain supported.Key code interfaces added / modified
LogicalMemo,MemoGroup,MemoGroupId,group_for_node,matches_root_dependencies,CandidateMemo,try_populate_pass1,generate_per_computation_candidates_with_memo,memo::shared_builds.populate_pass1,memo_from_initial,search_with_initial_memo,brute_force_with_initial_memo.search::pipeline,source_connected_queries,remap_rejection_query_indices.group_choices_up_to,incumbent::feasible_plan.expand_concrete_summary_state_groups,build_candidate_inventory,reconstruct_candidate_outputs,ResourceBudget.CandidateDependencyGraph, localPhysicalCandidate,ProducerRequirement,ProducerConsumerConnection,QueryRootAssignment,select_candidates.Major algorithm changes
Validation
Complete logical-optimization tests: 196 unit tests and 35 integration tests passed, including moved population/sharing tests, repeated-group caching, and consumer-specific HAVING/fusion equivalence.
Complete plan-selection unit suite after candidate ownership migration: 225 passed, zero failures. Includes all nine candidate-connection solver tests and the bounded-enumeration regression.
Zero-time-budget MILP incumbent integration regression passed with the bounded memo baseline.
Three-way integration subset after memo-aware generation: four passed, four intentionally ignored long-running randomized cases.
Strict clippy for both affected crates (
--lib --tests -- -D warnings), workspace format check, and diff check passed.Latest targeted validation: 3 state-group tests, 29 candidate-related tests, and 3 inventory tests including Stage 2 physicalization passed. Final strict clippy and workspace formatting checks passed.
Remaining migration work — draft, not ready for final replacement
The implementation plan is included in
docs/design_docs/proposals/joint-planning-implementation-plan.md. Moving helpers and adding the core must not be mistaken for completing legacy deletion. No runtime sketch/window algorithm is added by this draft.