Skip to content

Keep transversal-start CG bounded on singular systems - #118

Merged
timholy merged 1 commit into
mainfrom
teh/pow2-overflow
Nov 24, 2026
Merged

timholy merged 1 commit into
mainfrom
teh/pow2-overflow

Conversation

@timholy

@timholy timholy commented Nov 24, 2026

Copy link
Copy Markdown
Member

The group-graph Laplacian in the transversal start is singular, with each component's constants in its null space. When the right-hand side vanishes, as it does when the slacks cancel at every group, the stopping tolerance was zero and CG kept iterating after convergence. Roundoff in the residual along the null space, invisible to p'Lp, then produced step sizes near 1e25. In cover_exponents this shifted the group offsets to about -1.6e17, where Float64 rounding scrambled them and the integer balancing overflowed, returning exponents near ±1.2e17 (and making cover(A; pow2=true) throw).

_tt_cg! now projects the residual onto the range of the Laplacian on each component, and its tolerance also scales with the initial residual. As fail-fast guards, the pow2 transversal start checks that the group offsets are small enough to round exactly, and _balance_exponents! uses checked integer arithmetic.

Assisted-by: Claude Opus 5.5 noreply@anthropic.com

The group-graph Laplacian in the transversal start is singular, with
each component's constants in its null space. When the right-hand side
vanishes, as it does when the slacks cancel at every group, the
stopping tolerance was zero and CG kept iterating after convergence.
Roundoff in the residual along the null space, invisible to p'Lp, then
produced step sizes near 1e25. In `cover_exponents` this shifted the
group offsets to about -1.6e17, where Float64 rounding scrambled them
and the integer balancing overflowed, returning exponents near
±1.2e17 (and making `cover(A; pow2=true)` throw).

`_tt_cg!` now projects the residual onto the range of the Laplacian on
each component, and its tolerance also scales with the initial
residual. As fail-fast guards, the pow2 transversal start checks that
the group offsets are small enough to round exactly, and
`_balance_exponents!` uses checked integer arithmetic.

Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.40%. Comparing base (81acf94) to head (420d553).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #118   +/-   ##
=======================================
  Coverage   98.39%   98.40%           
=======================================
  Files          27       27           
  Lines        8685     8706   +21     
=======================================
+ Hits         8546     8567   +21     
  Misses        139      139           

☔ 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 c62d556 into main Nov 24, 2026
7 checks passed
@timholy
timholy deleted the teh/pow2-overflow branch November 24, 2026 16:13
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