Skip to content

Improve asymptotics - #50

Merged
timholy merged 4 commits into
mainfrom
sparse-asymptotics
Aug 23, 2026
Merged

Improve asymptotics#50
timholy merged 4 commits into
mainfrom
sparse-asymptotics

Conversation

@timholy

@timholy timholy commented Aug 23, 2026

Copy link
Copy Markdown
Member

Following #45, this fixes other cases that violated the hoped-for O(nnz)ish performance.

soft_symcover_min and soft_cover_min used :auto, which could select
dense normal equations for sparse matrices. Give their sparse-storage
methods the :lsqr default used by the hard minimal-cover solvers. The
other soft AbsLog entry points delegate to these methods.

Add Unitful disambiguation methods for allocating sparse minimal-cover
calls. Without them, sparse quantity matrices lost unit-stripping
dispatch and could fail at log(::Quantity).

Assisted-by: Claude Fable 5 <noreply@anthropic.com>
Replace three full row-pair scans of W with foreach_support. Sparse
weights now take O(nnz(W)) traversal instead of O(m^2 log m); dense
behavior is unchanged.

Count only stored nonzero summands when inflating for roundoff, since
zero terms add no error.

Assisted-by: Claude Fable 5 <noreply@anthropic.com>
boost_feasible_seq! repeatedly rescanned deferred pairs, taking
Theta(D^2) when scales propagated against scan order. Queue pairs
incident to each newly scaled vertex instead. Each vertex resolves
once, reducing deferred resolution to O(D) and leaving the sort as the
O(nnz log nnz) term.

Pairs unreachable from a scaled endpoint retain the ordered
equal-split fallback. Worklist order can change heuristic outputs when
multiple neighbors could supply a scale, but every result remains
feasible.

Assisted-by: Claude Fable 5 <noreply@anthropic.com>
Outside sparse storage, :auto used dense normal equations whenever
Woodbury was unavailable. Structured and wrapped sparse-support
matrices could therefore incur O(N^2) memory and O(N^3) factorization
costs.

Select Woodbury when eligible, LSQR at support density <= 1/4, and
dense solves otherwise. The choice depends on foreach_support rather
than storage type. Results near the threshold may differ at solver
tolerance.

Assisted-by: Claude Fable 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Aug 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.23810% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 98.39%. Comparing base (f3baba0) to head (fe38d5c).

Files with missing lines Patch % Lines
src/heuristic_covers.jl 89.28% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #50      +/-   ##
==========================================
+ Coverage   98.11%   98.39%   +0.28%     
==========================================
  Files          13       13              
  Lines        2922     2937      +15     
==========================================
+ Hits         2867     2890      +23     
+ Misses         55       47       -8     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@timholy
timholy merged commit c715d16 into main Aug 23, 2026
4 of 5 checks passed
@timholy
timholy deleted the sparse-asymptotics branch August 23, 2026 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant