Repository navigation
TESTING: raise SEP threshold to account for xSTEIN's orthogonality guarantee - #1346
Merged
Merged
Conversation
xSTEIN reorthogonalizes only eigenvectors whose eigenvalues lie within 1e-3*|T|; pairs just past that cutoff are orthogonal only to O(ulp*|T|/gap), so test 21 of xCHKST legitimately reaches about 1000*H(n-1)/n =~ 500 at n=3. Seen in-suite: 53.7 (csep/cse2, n=5, type 21); handcrafted worst cases reach 170. Co-Authored-By: Claude Fable 5 <[email protected]>
langou
approved these changes
Aug 1, 2026
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.
Problem
The SEP test suites report a single deterministic numerical failure (observed for example with
ifx on Windows, both the 32-bit and 64-bit integer APIs):
Root cause
DISCLAIMER: The following derivation of the theoretical worst-case was done by Claude Fable 5 ... so could contain mistakes, take it for what it is.
xSTEINreorthogonalizes (modified Gram-Schmidt) only eigenvectors whoseeigenvalues lie within
ORTOL = 1e-3 * ||T||_1of each other. A pair ofeigenvalues with a gap just above
ORTOLis deliberately not reorthogonalized,and inverse iteration then only guarantees
For the failing matrix (5x5 Hermitian tridiagonal, matrix type 21: diagonally
dominant with geometrically spaced eigenvalues) the eigenvalues
1.222e-4and2.362e-3have gap2.24e-3 ~= 2.1 * ORTOL, so their eigenvectors are skipped bythe reorthogonalization and retain an inner product of ~211 ulp, giving the ratio
53.72. This is expected, documented behavior of inverse iteration; the test's
n * ulpscaling simply does not model the gap-just-above-ORTOL regime.Worst-case analysis
Theoretical bound: with converged residuals
||r|| <= C * ulp * ||T||_1and gapsbetween different Gram-Schmidt groups exceeding
k * ORTOL(k = number of groupboundaries crossed), the 1-norm accumulates harmonically over a ladder of
singleton groups:
Empirical calibration of
C: staged adversarial scans (~2.6 million generatedsymmetric tridiagonals run through the exact
SSTEBZ('A','B')+CSTEIN+CSTT21pipeline, with Monte-Carlo perturbation of the last bits) never produceda per-pair contamination above
~450 * ulp / (gap/ORTOL), i.e.C ~= 0.22-0.25.With
C = 0.25the bound evaluates to ~500 at n = 3 (its supremum over n), ~417at n = 5 and ~177 at n = 20. Notes:
||T||weaklycoupled to a cluster of eigenvalues near 0 spaced just above
ORTOL;the largest ratio actually observed in the scans is 169.7 (n = 4);
coupling strong enough to contaminate forces the gap far above
ORTOL;threshold serves all four precisions.
Change
Raise the threshold in
TESTING/sep.inandTESTING/se2.infrom 50 to 60 anddocument the legitimate ceiling in the input files themselves:
60 clears the known deterministic failure (53.72) with margin while keeping the
suite tight for genuine regressions, which produce ratios orders of magnitude
larger (
ULPINV ~ 1.7e7in single precision). Should another seed/compilercombination legitimately exceed 60, the in-file comment records how far the ratio
can go before a real bug should be suspected.