Skip to content

Rescale the balanced objective and stop falsely converging - #106

Merged
timholy merged 1 commit into
mainfrom
teh/balanced-underflow
Oct 28, 2026
Merged

timholy merged 1 commit into
mainfrom
teh/balanced-underflow

Conversation

@timholy

@timholy timholy commented Oct 28, 2026

Copy link
Copy Markdown
Member

cover_transversal(PowerMean{p}(), A; target) evaluates its objective divided by target^p, so the weights are (r/target)^p rather than r^p. Ratios far below one no longer underflow for large p, and the range check now rejects target^(-p) that would overflow.

A Newton step at the resolution of the arithmetic no longer reports convergence when the relative reduced gradient exceeds tol: roundoff in the groups' gradients can hide a descent direction (for example, the common scale of a block whose internal weights are ~1e22). The solve now stops with stalled = true and a warning.

cover_transversal(PowerMean{p}(), A; target) evaluates its objective
divided by target^p, so the weights are (r/target)^p rather than r^p.
Ratios far below one no longer underflow for large p, and the range
check now rejects target^(-p) that would overflow.

A Newton step at the resolution of the arithmetic no longer reports
convergence when the relative reduced gradient exceeds tol: roundoff in
the groups' gradients can hide a descent direction (for example, the
common scale of a block whose internal weights are ~1e22). The solve
now stops with stalled = true and a warning.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.40%. Comparing base (a16c7f1) to head (5591599).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #106      +/-   ##
==========================================
+ Coverage   98.34%   98.40%   +0.06%     
==========================================
  Files          25       25              
  Lines        7536     7541       +5     
==========================================
+ Hits         7411     7421      +10     
+ Misses        125      120       -5     

☔ 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 fdffce8 into main Oct 28, 2026
7 checks passed
@timholy
timholy deleted the teh/balanced-underflow branch October 28, 2026 18:37
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