Fail fast when a myopic stage has no solution - #918
Open
mohammadrezwankhan wants to merge 1 commit into
Open
Conversation
mohammadrezwankhan
force-pushed
the
codex/fail-fast-myopic-stage
branch
2 times, most recently
from
July 23, 2026 17:50
37f7b0c to
01b2a9c
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.
Description Fixes the myopic multistage workflow so a failed stage is reported at the point of failure.
solve_modelcan return a model without primal values after logging that no solution was found. The myopic loop previously continued, and the next stage calledfix_initial_investmentson the unsolved prior model. That masked the original solver failure with a downstreamResultIndexBoundsErrorfromvalue(...). This change checkshas_valuesimmediately after each myopic stage solve and aborts with the stage number, termination status, primal status, and raw solver status. Successful-stage behavior is unchanged. ## What type of PR is this? (check all applicable) - [ ] Feature - [x] Bug Fix - [ ] Documentation Update - [ ] Code Refactor - [ ] Performance Improvements ## Related Tickets & Documents Related to Discussion #917, where the downstream exception obscured a Stage 1 solve failure. ## Checklist - [x] Code changes are sufficiently documented; no user-facing configuration or API changed. - [x] The change is based on the latestmaincommit. - [x] Code has been tested to ensure all functionality works as intended. - [x]CHANGELOG.mdincludes anUnreleased > Fixedentry for #918. - [x] I consent to the release of this PR's code under the GNU General Public license. ## How this can be tested Tested with Julia 1.12.6 and HiGHS: - Added a two-stage end-to-end myopic-run test whose first stage is infeasible; it verifies the runner reports Stage 1 directly instead of entering the Stage 2 linking logic. - Verified the message containstermination_status=INFEASIBLE,primal_status=NO_SOLUTION, and the raw solver status. - Rantest/test_multistage.jlsuccessfully. The focused test reports:text Myopic run stops at a stage without a solution | 5 passed