Fix report_value misclassifying monotone convergence as diverging (#674)#676
Merged
InauguralPhysicist merged 1 commit intoJul 20, 2026
Conversation
A sequence whose magnitude shrinks toward zero converges for any decay ratio in (0,1); the previous heuristic flagged ratios above ~0.87 as diverging, covering essentially every real iterative solver. Classify by whether magnitude grows (diverging) vs shrinks (converging), with a regression test from InauguralSystems#674. Closes InauguralSystems#674 Co-Authored-By: Kimi K3 <noreply@kimi.com>
Nitjsefnie
force-pushed
the
fix-convergence-classification
branch
from
July 20, 2026 16:06
dea3113 to
337ff27
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #674.
report_valuelabeled a monotonically converging sequencedivergingwhenever the per-step decay ratio was above ~0.87 — i.e. essentially every real iterative solver.Root cause (
observer_slot_raw_nonvanishing,eigenscript.c): the "non-vanishing steps" test wasrecent >= 0.5 * older. That admits any geometric decay whose per-half-window ratio is ≥ 0.5 — for a 10-sample window that'sr ≳ 0.871— as "non-vanishing", so a monotone approach to zero read asdiverging. But a geometric decay's steps vanish (their sum converges); only non-shrinking steps (a linear runaway's constant Δv, or a growing Δv) sum without bound.Fix: the bar becomes "steps are not shrinking" —
recent >= older * (1.0 - 1e-9)(the1e-9slack absorbs fp rounding for exactly-constant steps). Same-sign non-shrinking steps still →diverging; sign-alternating →oscillating; a decaying approach →converged.Tests (
test_report_value_convergence.eigs, regression from the issue repro): decay ratios 0.88/0.90/0.95 now classifyconverged(werediverging); a geometric growthr=1.05and a linear runaway still classifydiverging;r=0.5unchanged. Full suite green (the one unrelated failure is a bundle test that needs an exec-capable/tmp, which this sandbox denies — it fails identically on pristinemain). Repro before → 0.90/0.95diverging; after → all rowsconverged. Docs + CHANGELOG updated.One behavior nuance worth your confirmation:
observer_slot_raw_nonvanishingis shared with the oscillation path, so the tightened bar also means a slowly-damped, sub-deadband oscillation now falls through to the relative verdicts (settlesconverged) rather than readingoscillating. That matches the documented #422 intent ("a damped oscillation has decaying steps, fails non-vanishing, settles to converged"); all pinned oscillation tests use non-decaying amplitude and are unaffected, and above-deadband damped oscillations are still caught by the relative channel's flip counter. Flagging in case you'd rather treat that regime differently.Generated by Claude Opus 4.8 (brief, review), Kimi K3 (implementation)