Repository navigation
Report solver stats - #84
Merged
Merged
Conversation
When the active-set finish certifies a minimizer, `stats.converged` was
set from the finish but the only residual reported was the multiplier
iteration's `kkt` trace, which can sit far above `vtol`. The finish now
reports its own KKT check (`primal`, `ptol`, `dual`, `dtol`) in
`stats.polish`.
A finish that fails to certify returns the multiplier iterate, and now
always warns; previously it warned only when that iterate's residual
exceeded `vwarn`.
With `maxouter = 0` (the soft AbsLog{2} covers) nothing is iterated, so
`converged` is now `false` rather than `true`; no warning is issued.
Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
`symcover_min`, `cover_min`, `cover_transversal`, their mutating forms,
and the soft `AbsLog{2}` covers now return a statistics object as their
last output: `a, stats = symcover_min(A)`, `a, b, stats = cover_min(A)`.
The new public (unexported) `AbstractCoverStats` has one subtype per
solver family; this commit adds `AugmentedLagrangianStats` (with
`ActiveSetStats` for the finish) and `LeastSquaresStats`. The accessors
`converged`, `iterations`, `residual`, and `tolerance` describe the
returned cover; `LeastSquaresStats` implements none of them, since the
soft cover has no stopping criterion.
The augmented Lagrangian gains a `tol` keyword (default `1000eps`), and
any result that does not meet it warns; the separate warning threshold
is gone. The public methods declare their keywords instead of
forwarding them to the workers, so internal options are no longer
reachable, and the sparse methods delegate to the generic ones.
Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
`soft_symcover`, `soft_cover`, and their mutating forms with a
`PowerMean` penalty, including the no-penalty forms that default to
`PowerMean{2}()`, now return a `PowerMeanStats` object as their last
output: `a, stats = soft_symcover(A)`, `a, b, stats = soft_cover(A)`.
`PowerMeanStats{T}` is a public (unexported) subtype of
`AbstractCoverStats`. `converged`, `residual`, and `tolerance` report
whether the largest row (and column) imbalance of the returned cover
meets `tol`; `iterations` counts power-mean updates plus Newton steps.
The element type is the working type of the solve, so the result is
inferrable. The warning on an unconverged solve is unchanged.
The public methods declare their keywords (`tol`, `maxiter`, `newton`,
`maxnewton`, `linsolve`) instead of forwarding them, with the same
defaults. The private solvers and the statistics tuples they return are
unchanged.
Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
The covers computed through JuMP now return a statistics object as
their last output, like the native solvers: `symcover_min`,
`cover_min`, `soft_symcover`, `soft_cover`, and their mutating forms
with `AbsLog{1}` (HiGHS) or `AbsLinear` (Ipopt).
`ExternalSolverStats` records one entry per optimization stage: the
solver, the termination status (as a `Symbol`), the objective value of
the model, the iteration count the solver reports, and its run time.
The `AbsLog{1}` covers run two stages (the LP, then the QP over its
optimal face); Ipopt runs one. Failures still throw `SolverFailure`,
so `converged` is always `true`; `iterations`, `residual`, and
`tolerance` are not implemented.
The `AbsLinear` multistarts return `MultistartStats`, which holds the
label, statistics, and objective of each start whose refinement
succeeded, the index of the selected one, and the labels of the
random starts that failed. Its accessors delegate to the selected
start. The test-only `labels`/`objs` keywords of the soft multistart
are removed, since the statistics carry the same information.
Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
Reading HiGHS's QP iteration counter required its C interface, whose info keys are not guaranteed across the HiGHS versions allowed by `[compat]`. The counts are now the simplex and interior-point iterations that MathOptInterface reports, which do not include the QP stage. Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
Update the docstrings of the optimizing solvers for the trailing stats
output, the `tol` keyword of the AbsLog{2} hard covers, and the policy
of warning (native solvers) versus throwing SolverFailure (JuMP-backed
solvers). Port the doctests to the new return values and add a short
manual section on convergence and solver statistics.
Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #84 +/- ##
==========================================
- Coverage 99.09% 99.07% -0.03%
==========================================
Files 21 22 +1
Lines 6085 6132 +47
==========================================
+ Hits 6030 6075 +45
- Misses 55 57 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
`symcover_min(::AbsLinear, A)` built its starts in a comprehension that captured the element type, which Julia 1.10 cannot infer; it now copies a typed template vector. Two tests assumed that a solve without the active-set finish stalls above the tolerance, which depends on rounding and fails on Julia 1.10. They now check that the solve warns exactly when it does not converge. The multistart test's closure no longer captures a type through a local variable. Assisted-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.
This adds systematic solver stats for the optimizing methods in the package.