Repository navigation
TESTING: fix random IL/IU selection in the symmetric eigenvalue testers - #1347
Merged
Merged
Conversation
INT was applied to the (0,1) deviate instead of the scaled value, so IL and IU were always 1 and the RANGE='I'/'V' paths never tested more than a single eigenvector. Matches the form already used in xDRVBD, xDRVSG and the other xDRVST variants. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
1+INT((N-1)*u) with u in (0,1) can never reach N, so the IU=N branch of the RANGE='V' bound in xDRVST has been unreachable since the code was written. xLARND excludes 0 and 1, so 1+INT(N*u) covers [1,N]. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes the symmetric/Hermitian eigenvalue tester drivers so that random index-range selection (IL, IU) actually exercises partial eigenvalue/eigenvector computations, and expands the random draw so the full index range [1, N] can be selected (including IU = N).
Changes:
- Corrects the index-range RNG expressions so
IL/IUare no longer effectively constant (= 1) in multiple testers. - Switches the scaling from
(N-1)/(MNMIN-1)toN/MNMINso the top endpoint (NorMNMIN) can be drawn. - Applies these updates consistently across real/complex and 1-stage/2-stage tester variants.
Reviewed changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| TESTING/EIG/zdrvst2stg.f | Update random IL/IU generation to scale by N so full [1,N] is reachable. |
| TESTING/EIG/zdrvst.f | Same IL/IU scaling fix for the ZDRVST Hermitian tester. |
| TESTING/EIG/zdrvsg2stg.f | Same IL/IU scaling fix for generalized Hermitian tester (2-stage). |
| TESTING/EIG/zdrvsg.f | Same IL/IU scaling fix for generalized Hermitian tester. |
| TESTING/EIG/zdrvbd.f | Update IL/IU scaling to use MNMIN so [1,MNMIN] is reachable. |
| TESTING/EIG/zchkst2stg.f | Fix broken IL/IU selection and widen draw to [1,N] in multiple test sections. |
| TESTING/EIG/zchkst.f | Fix broken IL/IU selection and widen draw to [1,N] in multiple test sections. |
| TESTING/EIG/sdrvst2stg.f | Update random IL/IU generation to scale by N (single precision, 2-stage). |
| TESTING/EIG/sdrvst.f | Update random IL/IU generation to scale by N (single precision). |
| TESTING/EIG/sdrvsg2stg.f | Same IL/IU scaling fix for generalized symmetric tester (single, 2-stage). |
| TESTING/EIG/sdrvsg.f | Same IL/IU scaling fix for generalized symmetric tester (single). |
| TESTING/EIG/sdrvbd.f | Update IL/IU scaling to use MNMIN so [1,MNMIN] is reachable (single). |
| TESTING/EIG/schkst2stg.f | Fix broken IL/IU selection and widen draw to [1,N] in multiple test sections (single, 2-stage). |
| TESTING/EIG/schkst.f | Fix broken IL/IU selection and widen draw to [1,N] in multiple test sections (single). |
| TESTING/EIG/schkbd.f | Update IL/IU scaling to use MNMIN so [1,MNMIN] is reachable (single). |
| TESTING/EIG/ddrvst2stg.f | Update random IL/IU generation to scale by N (double, 2-stage). |
| TESTING/EIG/ddrvst.f | Update random IL/IU generation to scale by N (double). |
| TESTING/EIG/ddrvsg2stg.f | Same IL/IU scaling fix for generalized symmetric tester (double, 2-stage). |
| TESTING/EIG/ddrvsg.f | Same IL/IU scaling fix for generalized symmetric tester (double). |
| TESTING/EIG/ddrvbd.f | Update IL/IU scaling to use MNMIN so [1,MNMIN] is reachable (double). |
| TESTING/EIG/dchkst2stg.f | Fix broken IL/IU selection and widen draw to [1,N] in multiple test sections (double, 2-stage). |
| TESTING/EIG/dchkst.f | Fix broken IL/IU selection and widen draw to [1,N] in multiple test sections (double). |
| TESTING/EIG/dchkbd.f | Update IL/IU scaling to use MNMIN so [1,MNMIN] is reachable (double). |
| TESTING/EIG/cdrvst2stg.f | Update random IL/IU generation to scale by N (complex single, 2-stage). |
| TESTING/EIG/cdrvst.f | Update random IL/IU generation to scale by N (complex single). |
| TESTING/EIG/cdrvsg2stg.f | Same IL/IU scaling fix for generalized Hermitian tester (complex single, 2-stage). |
| TESTING/EIG/cdrvsg.f | Same IL/IU scaling fix for generalized Hermitian tester (complex single). |
| TESTING/EIG/cdrvbd.f | Update IL/IU scaling to use MNMIN so [1,MNMIN] is reachable (complex single). |
| TESTING/EIG/cchkst2stg.f | Fix broken IL/IU selection and widen draw to [1,N] in multiple test sections (complex single, 2-stage). |
| TESTING/EIG/cchkst.f | Fix broken IL/IU selection and widen draw to [1,N] in multiple test sections (complex single). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
langou
approved these changes
Aug 2, 2026
ilayn
added a commit
to ilayn/semicolon-lapack
that referenced
this pull request
Oct 26, 2026
…ects (#43) - Use the DLAMCH constant the Fortran asks for in 35 routines (and their s/c copies). DBL_EPSILON stood in for DLAMCH('Epsilon'), which is half of it, or the reverse. In xLAGTS this doubled the pivot tolerance, and inverse iteration in xSTEIN failed on tight clusters, so ZHEEVX/ZHPEVX returned INFO > 0 where reference LAPACK succeeds. - xGEDMD returns after XERBLA in the NaN checks of X and Y. Reference-LAPACK/lapack#1395 - ZLAGHE/CLAGHE guard a zero leading element of the reflector. Reference-LAPACK/lapack#1365 Reference-LAPACK/lapack#1366 - xTSQR01 checks the GEMLQ('R','N') residual it computes. Reference-LAPACK/lapack#1364 - xDRVES: Fortran xSLECT with SELOPT = 0, complete test 13, and the documented xGEES exit codes N+1 and N+2. Reference-LAPACK/lapack#1355 - IL/IU drawn from the full [1, N] range in the CHKST, DRVST, DRVSG, CHKBD and DRVBD drivers, and the xDRVBD GESVDX tests ported line by line. Reference-LAPACK/lapack#1347 - xDRVLS random right-hand sides and EPS, real QZ drivers SAFMIN/ULP, RFP driver parameters from the *test_rfp.in files, invented singular values removed from the xDRVBD generator, new seed for zDRVST/zDRVST2STG.
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.
Description
xCHKST,xCHKST2STGandDDRVSTnever actually tested a partial eigenvalue range. Their "choose random values for IL and IU" code appliedINTto the(0,1)deviate instead of to the scaled value:xLARND(1,·)returns a value strictly inside(0,1), soINT(...)is0on every call and the expression collapses toIL = IU = 1. EveryRANGE='I'/RANGE='V'test in those routines has been running on a single eigenvector.Two commits: the fix, then a follow-up that widens the drawn range to the full
[1,N].1.
TESTING: fix random IL and IU selection in xCHKST and DDRVST50 sites in 9 files, rewritten to the form already used by
xDRVBD,xDRVSG,xDRVST2STGand the s/c/zxDRVSTvariants:2.
TESTING: draw IL and IU from the full [1,N] range1 + INT( (N-1)*u )withu ∈ (0,1)yields[1, N-1], soIU = Ncan never be drawn. The consumer inddrvst.fexplicitly guards for it:The
IU.NE.Ntest exists only to keepD1(IU+1)in bounds, so theELSEbranch was written for a case the generator could not produce. It has never executed. This commit switches all 46 IL/IU draw pairs (92 lines, 30 files, coveringx{chk,drv}st,x{chk,drv}st2stg,xdrvsg,xdrvsg2stg,xchkbd,xdrvbd) to:The
(N-1)form predates the git history (2008 trunk import), so there is no recorded rationale. It looks like the linear map of[0,1]onto[1,N], which is correct withNINTbut drops the top value under truncation.