Skip to content

fix(lsmr): run the recurrence on u₁ and test its stop in exact exponents - #395

Merged
schroedk merged 4 commits into
mainfrom
fix/lsmr-extreme-scales
Sep 24, 2026
Merged

schroedk merged 4 commits into
mainfrom
fix/lsmr-extreme-scales

Conversation

@schroedk

@schroedk schroedk commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

Stack 2/5 (extreme scales), based on #406.

  • The recurrence runs on u₁ = b / β₁, restoring β₁ only in the solution update and the reported residual; ‖A‖_F accumulates by hypot.
  • The backward error ‖Aᵀr‖ / (‖A‖‖r‖) and the reported normal-equation residual are exact-exponent products (Magnitude): a solve whose ‖A‖² or ‖A‖‖b‖ leaves the double range no longer errors, misses its normal-equation stop, or reports a zero residual.
  • check evaluates the unit residual once for both stop tests; Magnitude carries only what the solve uses (no ordering).

A power-of-two scaling sweep pins the unpreconditioned solve to its unit-scale twin at ‖A‖ = 2^±5xx and ‖A‖‖b‖ = 2^±1030. Normal-range solves keep their stop reasons and iteration counts (x differs at ~1e-15).

Next: #403 (vector normalization) → #404 (MGK ⟨v, Mv⟩) → #405 (warm reference).

@schroedk
schroedk changed the base branch from refactor/lsmr-rotation-types to perf/demeaned-from-exit September 23, 2026 13:16
@schroedk
schroedk force-pushed the fix/lsmr-extreme-scales branch from 58bd91e to 84398fe Compare September 23, 2026 13:16
@schroedk
schroedk added this pull request to stack #396 September 23, 2026 13:17
@schroedk
schroedk force-pushed the fix/lsmr-extreme-scales branch 2 times, most recently from fd8728c to 151d01b Compare September 23, 2026 13:28
@schroedk
schroedk removed this pull request from stack #396 September 23, 2026 15:05
@schroedk
schroedk force-pushed the fix/lsmr-extreme-scales branch from 151d01b to 9a3bf4f Compare September 23, 2026 15:06
@schroedk
schroedk added this pull request to stack #398 September 23, 2026 15:06
@schroedk
schroedk force-pushed the fix/lsmr-extreme-scales branch from 9a3bf4f to c230953 Compare September 23, 2026 15:19
@schroedk
schroedk removed this pull request from stack #398 September 23, 2026 15:35
@schroedk
schroedk force-pushed the fix/lsmr-extreme-scales branch from c230953 to 7954f8e Compare September 23, 2026 15:35
@schroedk
schroedk added this pull request to stack #400 September 23, 2026 15:36
@schroedk
schroedk removed this pull request from stack #400 September 23, 2026 15:51
@schroedk
schroedk force-pushed the fix/lsmr-extreme-scales branch from 7954f8e to 6849a4e Compare September 23, 2026 15:52
@schroedk
schroedk added this pull request to stack #402 September 23, 2026 15:52
@schroedk
schroedk force-pushed the fix/lsmr-extreme-scales branch 3 times, most recently from 3c51aaf to e3396e8 Compare September 23, 2026 16:22
Base automatically changed from perf/demeaned-from-exit to main September 23, 2026 16:50
@schroedk
schroedk force-pushed the fix/lsmr-extreme-scales branch from e3396e8 to bb5b996 Compare September 23, 2026 16:50
@schroedk
schroedk force-pushed the fix/lsmr-extreme-scales branch from bb5b996 to b300ace Compare September 23, 2026 17:07
@schroedk schroedk changed the title fix(lsmr): keep LSMR in range at extreme scales fix(lsmr): run the recurrence on u₁ and test its stop in exact exponents Sep 23, 2026
@schroedk
schroedk force-pushed the fix/lsmr-extreme-scales branch from 7f5a474 to bace6ec Compare September 24, 2026 09:48
@schroedk
schroedk removed this pull request from stack #402 September 24, 2026 09:48
@schroedk
schroedk changed the base branch from main to fix/mgk-reorth-refresh September 24, 2026 09:48
@schroedk
schroedk added this pull request to stack #407 September 24, 2026 09:48
Base automatically changed from fix/mgk-reorth-refresh to main September 24, 2026 11:31
At ‖A‖‖b‖ > 1e308 the unscaled `ζ̄₁ = α₁β₁` overflowed, and `‖A‖²` in
the Frobenius estimate left the range from ‖A‖ ≈ 1e±154. The scalar
recurrence now runs on `u₁ = b / β₁`, with β₁ restored only in the
solution update and the reported residual; ‖A‖_F accumulates by hypot.

The backward error `‖Aᵀr‖ / (‖A‖‖r‖)` and the reported relative
normal-equation residual are formed as `Magnitude`s (m·2^e), whose
products and ratios keep their exponent exactly, so neither overflows
where the ratio itself is representable.

A power-of-two scaling sweep pins the unpreconditioned solve to its
unit-scale twin at ‖A‖ = 2^±5xx and ‖A‖‖b‖ = 2^±1030.
…r check

`NormalEqReference::relative` was the only user of `PartialOrd` and
`ZERO`; a zero-or-normal reference tests the same with `is_normal`.
`Mul` had one caller and is inlined into `product`. `check` evaluates
the unit residual once for both stop tests, and the scaling sweep drops
its never-run `mlsmr` arm. Bitwise identical on the probe set.
@schroedk
schroedk force-pushed the fix/lsmr-extreme-scales branch from bace6ec to 4c1ab6d Compare September 24, 2026 11:31
schroedk and others added 2 commits September 24, 2026 14:09
`ζ/(ρρ̄)` on the unit RHS can underflow to zero where `β₁ζ/(ρρ̄)` is a normal
double, so `x` stayed 0 while the recurrence reported a converged stop.

Co-Authored-By: Claude <noreply@anthropic.com>
…allback

`Magnitude::product` of two positive finite norms never vanishes, and a zero α₁
returns before any report; also corrects the `warm` and `pow2` docs.

Co-Authored-By: Claude <noreply@anthropic.com>
@schroedk
schroedk merged commit 6274990 into main Sep 24, 2026
5 checks passed
@schroedk
schroedk deleted the fix/lsmr-extreme-scales 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