Repository navigation
Improve scaling of cover_transversal - #98
Merged
Merged
Conversation
The finish of `_polish_difference_qp` added one constraint per step, so a seed far from the minimizer cost hundreds of Laplacian factorizations. Bulk steps now add, in one step, the violated constraints (most violated first) that extend the active forest. A primal-dual active-set step (activate all of them, then drop the constraints whose multipliers turn negative) is kept when it raises the dual function. Otherwise the constraints are added by moving along the segment to the tight minimizer of the enlarged forest, interpolating the multipliers linearly; this keeps stationarity and raises the dual function, and the move stops where a multiplier reaches zero. Bulk steps repeat while the number of violated constraints falls, within a `maxbulk` budget, and resume after a single-constraint step that leaves more than 8 violations. Goldfarb–Idnani steps then certify the result as before. On sparse lognormal transversal problems with poor seeds, finish steps drop from 761 to 286 (n = 3162) and from 1149 to 487 (n = 10000); on random difference problems in general position, from 970 to 23. Assisted-by: Claude Opus 5.5 <noreply@anthropic.com> Assisted-by: Claude Fable 5.1 <noreply@anthropic.com>
Each stage of `_abslog2_auglag` runs LSQR with tolerance `LSQR_FORCING` (1e-3) times the KKT residual of the previous update, capped at `LSQR_ATOL_MAX` (1e-6) and floored at the full-accuracy tolerance `_lsqr_atol`; the unweighted start solve uses the full-accuracy tolerance. The Newton steps of the multiplier iteration need no more accuracy than this: on sparse lognormal matrices (full diagonal plus five lognormal entries per row) at n = 31623, LSQR iterations per solve fall from about 35 to 8 while the number of solves rises from about 245 to 290. When the active-set finish follows (`zeroslack=false`), two consecutive updates at the penalty cap that contract the KKT residual by less than a factor of `AL_CAP_CONTRACTION` (3) end the iteration; a stage that ran out of inner iterations is skipped. The finish resolves the remaining constraints in fewer solves than further updates would. `cover_transversal` on three such matrices at n = 31623 drops from 12.5/11.3/11.2 s to 5.6/5.6/6.1 s, and at n = 10000 from 1.5 to 0.95 s; `cover_min` at n = 31623 drops from 2.7 to 2.1 s. All runs converge and certify. Assisted-by: Claude Fable 5.1 <noreply@anthropic.com>
timholy
force-pushed
the
teh/bulk-finish
branch
from
October 25, 2026 08:44
bd71bb4 to
8e7b6ba
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #98 +/- ##
==========================================
- Coverage 98.74% 98.34% -0.41%
==========================================
Files 25 25
Lines 7406 7538 +132
==========================================
+ Hits 7313 7413 +100
- Misses 93 125 +32 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
On large sparse matrices,
cover_transversalwas many times slower thancover_min. This doesn't eliminate the gap, but it goes far in addressing it (TT= "transversal-tight"):It also provides a modest speedup to
cover_min.