Presolve/postsolve debug utilities - #3219
Merged
Merged
Conversation
added 9 commits
August 15, 2026 16:45
…en log_dev_level > 0
…ambdas and their calls in undo for HighsPostsolveStack.h
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## latest #3219 +/- ##
==========================================
- Coverage 73.04% 73.03% -0.02%
==========================================
Files 445 445
Lines 107591 107676 +85
Branches 17250 17259 +9
==========================================
+ Hits 78591 78639 +48
- Misses 28724 28761 +37
Partials 276 276 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
fwesselm
approved these changes
Aug 18, 2026
| double report_col_value = kHighsInf; | ||
|
|
||
| // Lambda for logging the solution for a specific column whenever its value | ||
| changes auto reportColLogging = [&](const HighsInt reduction) { |
Collaborator
There was a problem hiding this comment.
changes belongs to previous line?
fwesselm
approved these changes
Aug 18, 2026
| if (lp->integrality_[i] == HighsVarType::kInteger) | ||
| updateViolation(fractionality(value), i, num_integrality_violations, | ||
| integrality_violation, col_of_max_integrality_violation); | ||
| updatePrimalViolation(value, i, is_column); |
| } | ||
| bool is_column = false; | ||
| for (HighsInt i = 0; i != lp->num_row_; ++i) | ||
| updatePrimalViolation(row_value_p[i], i, is_column); |
Collaborator
There was a problem hiding this comment.
And pass false here? (And remove is_column altogether.)
Member
Author
There was a problem hiding this comment.
I feel that it's clearer to pass a named identifier than just true/false
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.
Introduces the struct
MipViolationto gather data fromHighsMipSolver::solutionFeasiblerather than justbound_violation_,row_violation_,integrality_violation_. This allows more informative logging of "untransformed violations" whenlog_dev_levelis positive.Introduced
reportOriginalPresolvedCol(report_col, sol);to log model data (in both the original and presolved problem) about a columnreport_col(when non-negative) before callingpostSolveStack.undoPrimalinHighsMipSolverData::transformNewIntegerFeasibleSolutionsince model data is unknown inpostSolveStack.undo.Introduced
getPresolvedColumnIndexandgetPresolvedRowIndexinHighsPostSolveStack.hso that the index of a column/row in the presolved model can be determined, allowing the model data for the column/row in the presolved problem to be logged.Introduced
presolveTypeToStringinHighsPostSolveStack.hso that presolve reductions can be logged more clearly.Introduced
last_reduction_as a data member ofHighsPresolveso that calls toHighsPresolve::checkLimitsfollowing a reduction can be identified, simplifying the task of stopping VScode before the last (error-causing) reduction has been performed.