Skip to content

fix(lsmr): normalize each vector by its own norm, never through 1/x - #403

Merged
schroedk merged 2 commits into
mainfrom
fix/lsmr-normalize
Sep 24, 2026
Merged

schroedk merged 2 commits into
mainfrom
fix/lsmr-normalize

Conversation

@schroedk

@schroedk schroedk commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

Stack 3/5 (extreme scales), based on #395.

  • Every basis vector is normalized by its own norm, dividing where 1/x leaves the range (drscl): a subnormal α, β or ‖b‖, or ‖A‖ = f64::MAX (subnormal 1/α₁), no longer fails with InvalidInput or zeroes the vector.
  • MGK's p̃ update divides p̃ by α first when β/α leaves the range (dlascl); the reorthogonalization ring stores p̃ / α the same way.

Tests: tests/range.rs (subnormal gradient, subnormal rhs, top-of-range operator); all fail on main.

@schroedk
schroedk added this pull request to stack #402 September 23, 2026 17:07
@schroedk
schroedk force-pushed the fix/lsmr-normalize branch 2 times, most recently from fee7be6 to 3532b03 Compare September 24, 2026 09:47
@schroedk
schroedk removed this pull request from stack #402 September 24, 2026 09:48
@schroedk
schroedk added this pull request to stack #407 September 24, 2026 09:48
Base automatically changed from fix/lsmr-extreme-scales to main September 24, 2026 12:16
A subnormal α, β or ‖b‖ has no normal reciprocal, and ‖A‖ = f64::MAX
leaves 1/α₁ subnormal, so `v *= 1/α` failed or zeroed the basis vector.
`normalize` divides when the reciprocal leaves the range (`drscl`), at
every stream site: init/restart, both steps, the MGK ring and its p̃
update, which divides p̃ by α first when β/α itself leaves the range
(`dlascl`).
@schroedk
schroedk merged commit 699cc7b into main Sep 24, 2026
5 checks passed
@schroedk
schroedk deleted the fix/lsmr-normalize branch September 26, 2026 06:58
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