fix(presolve): prevent floating-point underflow in dynamism-scaled tolerances - #3203
Open
HuAliAsu wants to merge 2 commits into
Open
fix(presolve): prevent floating-point underflow in dynamism-scaled tolerances#3203HuAliAsu wants to merge 2 commits into
HuAliAsu wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## latest #3203 +/- ##
=======================================
Coverage 73.16% 73.16%
=======================================
Files 430 430
Lines 103967 103967
Branches 16719 16719
=======================================
+ Hits 76067 76069 +2
+ Misses 27624 27622 -2
Partials 276 276 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Opt-Mucca
requested changes
Aug 6, 2026
Opt-Mucca
left a comment
Collaborator
There was a problem hiding this comment.
I don't see how this change can hurt. It needs to be formatted correctly though. Nice spot!
Collaborator
|
I don't really like hard-coding |
Member
Agreed |
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
When solving MILP models containing large matrix coefficients (such as micrometer dimensions
10^12or large Big-M indicators), HiGHS Presolve can incorrectly declare feasible models asInfeasibleor fail to reduce valid forcing rows and columns.Technical Root Cause
In
HPresolve.cpp(lines 4300 and 4587),primal_feasibility_toleranceanddual_feasibility_toleranceare scaled by dividing by the matrixdynamismratio.When dynamism is high (
>= 10^8),tolerance / dynamismunderflows below the IEEE 754 double precision machine epsilon (2.22e-16). For example,1e-7 / 10^12 = 1e-19.As a result, comparisons like
std::abs(bound) <= 1e-19fail due to standard floating-point noise (~10^-15), causing valid presolve reductions to fail and leading to falseInfeasiblestatus returns.The Fix
Clamp the dynamism-scaled tolerances to a lower bound of
1e-15(IEEE 754 machine epsilon safeguard):Reproducible LP Benchmark