Skip to content

Fixes of STEBZ - #1039

Merged
langou merged 1 commit into
Reference-LAPACK:masterfrom
haox1:stebz
May 24, 2026
Merged

langou merged 1 commit into
Reference-LAPACK:masterfrom
haox1:stebz

Conversation

@haox1

@haox1 haox1 commented Jul 19, 2024

Copy link
Copy Markdown
Contributor

Description

This PR fixes d/sSTEBZ:

  1. Fix accumulation of number of eigenvalues by changing .LT. to .LE. in line 600 (599 for sstebz.f) as line 538 (537 for sstebz.f) states that “NWL accumulates the number of eigenvalues .le. WL” .
  2. Fix possible out of bounds write of IBLOCK. There are IBLOCK(IW) = 0 in lines 704 and 719 (703 and 718 for sstebz.f), which IW are initialized to 0. IF statements are added to check whether IW equals to zero.
  3. Fix failures of test case 53 of SSBEVX in sdrvst.f on Power8 and Power9 by increasing the FUDGE factor in sstebz.f to 2.3.

Checklist

  • The documentation has been updated.
  • If the PR solves a specific issue, it is set to be closed on merge.

@ilayn

ilayn commented May 23, 2026

Copy link
Copy Markdown
Contributor

cc: @langou @oamarques

@ilayn

ilayn commented May 23, 2026

Copy link
Copy Markdown
Contributor

Some background on the first point

  1. There is already some contractual hints in the comments 537-539
    *
    *     Find Eigenvalues -- Loop Over Blocks and recompute NWL and NWU.
    *     NWL accumulates the number of eigenvalues .le. WL,
    *     NWU accumulates the number of eigenvalues .le. WU
    *
    
  2. The test value GU is already fudged GU = GU + FUDGE*BNORM*ULP*IN + FUDGE*PIVMIN on line 587 hence, it is my understanding that, if fudged GU equals WL, every true eigenvalue of the block is strictly less than WL and the boundary is included in the spectrum.

Comment thread SRC/sstebz.f
$ HALF = 1.0E0 / TWO )
REAL FUDGE, RELFAC
PARAMETER ( FUDGE = 2.1E0, RELFAC = 2.0E0 )
PARAMETER ( FUDGE = 2.3E0, RELFAC = 2.0E0 )

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am slightly uncomfortable that this proposed change will imply that the FUDGE would not be the same for SINGLE and DOUBLE.

@langou

langou commented May 24, 2026

Copy link
Copy Markdown
Contributor

I am planning in merging this PR. Comments welcome before this happens.

@ilayn

ilayn commented May 24, 2026

Copy link
Copy Markdown
Contributor

Agree with the fudge factor comment. It is a test issue and should not be effecting the algorithms. The tests can be modified later independently should the fails continue.

@langou
langou merged commit 7e4e6bf into Reference-LAPACK:master May 24, 2026
ilayn added a commit to ilayn/semicolon-lapack that referenced this pull request Oct 25, 2026
The discard loops wrote iblock[-1] when no candidate was found. SSTEBZ
also uses FUDGE = 2.3 as upstream does; gen_single.py gains a per-file
literal override so regenerating sstebz.c keeps it.

Port of Reference-LAPACK 8785529fa
(Reference-LAPACK/lapack#1039).
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.

3 participants