Repository navigation
fix(plan-selection): reject an unpriceable candidate in the reference pricer (#1067) - #1164
Merged
Merged
Conversation
This was referenced Nov 2, 2026
milindsrivastava1997
force-pushed
the
fix-planner-timing-flakes
branch
from
November 2, 2026 23:19
7cfd306 to
155b0f6
Compare
… pricer The search rejects a candidate whose cost overflows (cost_not_representable), but the test-only reference pricer failed the whole selection on it. Which round the search selects depends on timing, so planner_layering_example2's production_memo_selects_a_validated_example2_plan failed whenever the selected round held such a candidate. The reference pricer now rejects it with the new RejectionCause::CostNotRepresentable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
milindsrivastava1997
force-pushed
the
fix-planner-timing-flakes
branch
from
November 2, 2026 23:49
155b0f6 to
c4dab02
Compare
zzylol
added a commit
that referenced
this pull request
Nov 3, 2026
…y and cost exactly (#1185, part 1) (#1188) * fix(plan-selection): run the group selection MILP to proven optimality and cost exactly (#1185) The group selection MILP stopped at wall-clock deadlines and costed some candidates inexactly past hardcoded caps, so the selected plan depended on machine speed and could differ from the optimum of the model. Deadlines removed: - select_plan no longer takes a deadline; the facade stops passing one (its own round budgets and the Pass 2 deadline are unchanged). - The warm start has no time budget: it tries workload order, its reverse and MORE_ORDERS pseudo-random orders, every run. - No per-part time split and no HiGHS time_limit: every part is solved to proven optimality. Any HiGHS status other than Optimal or Infeasible is a solver error. - Deleted WARM_START_MOST_TIME, MOMENT_TO_READ_THE_START_S, LP_TIME_LIMIT_S (the LP diagnosis's LPs and one-node root solve end on their own), SelectionMilpStatus, SelectionMilpError::{DeadlineReached, NoSolution}, SearchStatus::DeadlineReached, ErrorSelectingPlan::NoPlanByDeadline and the solution's relative_gap (always 0 now). Caps removed (every combination is costed and encoded exactly): - MAX_CONTEXTS, MAX_PRODUCER_CHOICES and UsageContext::TooManyContexts. - MAX_WINDOW_KINDS: every union of a scan run's window kinds is costed and encoded with exact indicators; the widest-window fallback is gone. - MAX_COMPOSITIONS: every composition is built and checked, so no set of approximate candidates is marked NotChecked for its size. HiGHS threads are now SelectionMilpOptions::highs_threads, default 1 (was 4), so ties between plans of equal cost break the same way. Snapshot changes: only the search status. o11y_bench q05, q19, q25 and the sketch workloads shared-quantiles-1h-mvp and quantile-single-mvp used to stop at the time limit with the optimal plan; they are now proven optimal (proven_optimal true, search_status optimal). Plans and costs are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(plan-selection): guard window-union enumeration against shift overflow; update deadline docs (review) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(plan-selection): name why candidates could not be costed when the selection MILP is infeasible The dag-viewer test test_a_plan_without_a_rate_fact_names_the_missing_fact failed on main since the group MILP became the default: candidates whose usage asap-cost could not price (e.g. a source without an arrival rate) were left out silently and the error said only 'infeasible'. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(plan-selection): import AnalyticalCostError from asap-cost in the selector (main build after #1164 and #1187) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <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.
Part of #1067. The test-only reference pricer failed a whole selection on a candidate the search rejects.
Why
planner_layering_example2::production_memo_selects_a_validated_example2_planfailed intermittently in CI withplan selection selects: Cost { candidate: "E17-0", node: 4, error: Overflow }(#1166 now ignores it). The search rejects a candidate whose cost overflows (cost_not_representable); the reference pricer, which prices every memo choice of the selected round for tests andstage_pipeline'sreference_pricing, returned the error instead. Which round is selected depends on timing, so the failure appeared only when that round held such a candidate.What
The reference pricer rejects a candidate whose cost overflows, with the new
RejectionCause::CostNotRepresentable, and selects among the rest.How
select_among_plansskips an overflowing candidate when fitting the calibration and, when offering it, records aCostNotRepresentablerejection instead of returningErrorSelectingPlan::Cost. The search's own overflow handling andPlanSelector::offer_beforeare unchanged.Key code interfaces added / modified
crates/plan-selection/src/report.rs—RejectionCausestays, gains one variant:Serialized as
cost_not_representable; added to the DAG viewer's failed-check causes, its README, thestage_pipelineoutput docs andasap-aware-mapping-contracts.md.Major algorithm changes
None.
Before this PR
When the selected round held a candidate whose cost overflows, the reference pricer returned
Err(Cost { .. Overflow }), failing tests that read it (andstage_pipeline's reference pricing), although the search had rejected that candidate.After this PR
That candidate is listed under the reference's rejections with cause
cost_not_representable; selection among the rest proceeds.Evidence
the_reference_pricer_rejects_an_unpriceable_candidatefails onmain(the selection errors instead of returningNoValidCandidate) and passes with the fix. The CI failure itself is timing-dependent and not reproduced.Verification
plan-selectiontests::the_reference_pricer_rejects_an_unpriceable_candidate— candidates whose cost overflows are each rejected asCostNotRepresentable, not a selection failure.devtoolsviewer_contract(2) andtools/dag-viewerstages.test.mjs(19) pass. Full workspace suite not run locally; relying on CI.-D warnings(CI's flags), fmt.Snapshot changes
None.
Architectural decisions
PlanSelector::offer_before, which the old engine uses, so no production path changes.ASAP_STAGE3_SEARCH=old.Limitations and follow-up
Human review — do not complete with an agent
🤖 Generated with Claude Code