Skip to content

Copy updated zero-pivot columns back in xLASYF and xLAHEF - #1433

Merged
ACSimon33 merged 2 commits into
Reference-LAPACK:masterfrom
rioyu123:fix-zero-pivot-panel-copy
Oct 4, 2026
Merged

ACSimon33 merged 2 commits into
Reference-LAPACK:masterfrom
rioyu123:fix-zero-pivot-panel-copy

Conversation

@rioyu123

@rioyu123 rioyu123 commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes #1432, reported by @Bruun97.

When a column becomes exactly zero after a blocked Bunch-Kaufman panel update, xLASYF/xLAHEF set INFO but leave the original column in A instead of copying the updated column from W. The returned factors can therefore fail to reconstruct the input even though INFO > 0 documents a completed, singular factorization.

Copy the updated column back to A in both triangle branches of SLASYF, DLASYF, CLASYF, ZLASYF, CLAHEF and ZLAHEF, matching the _rook/_rk siblings. The production change is 12 lines. The Hermitian routines still force the diagonal real, and non-singular paths are unchanged.

The existing CHKSY/CHKHE drivers now test a rank-one 2-by-2 block whose second pivot becomes zero during elimination. They check INFO and reconstruct the input with xSYT01/xHET01. Coverage includes upper/lower storage, all six routines, and both real and imaginary off-diagonal blocks for complex types. The checks respect the existing singular-matrix selection.

Native verification on current master with gfortran 13.3, -fcheck=all and reference BLAS:

  • The new regressions fail without the fix across all six routines; unblocked controls pass.
  • The standard S/D/C/Z LIN inputs report 2,923,150 test ratios with no numerical failures or other errors, checked by lapack_testing.py.
  • Focused runs with N up to 102 and NB in {1, 2, 3, 20, 64} go from 240 failures in 1,276 checks to none.

These runs used Linux x86_64. Other compilers and optimized BLAS were not tested.

Checklist

  • The documentation has been updated. (Not needed: this restores the documented INFO > 0 behavior.)
  • If the PR solves a specific issue, it is set to be closed on merge.

@codecov

codecov Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.32394% with 36 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.39%. Comparing base (2e5d9c1) to head (5b14af5).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
TESTING/LIN/cchkhe.f 86.95% 6 Missing ⚠️
TESTING/LIN/cchksy.f 87.23% 6 Missing ⚠️
TESTING/LIN/dchksy.f 86.04% 6 Missing ⚠️
TESTING/LIN/schksy.f 86.04% 6 Missing ⚠️
TESTING/LIN/zchkhe.f 86.95% 6 Missing ⚠️
TESTING/LIN/zchksy.f 87.23% 6 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1433      +/-   ##
==========================================
+ Coverage   69.38%   69.39%   +0.01%     
==========================================
  Files        6122     6122              
  Lines      487347   487627     +280     
  Branches    23268    23268              
==========================================
+ Hits       338166   338410     +244     
- Misses     148747   148783      +36     
  Partials      434      434              
Components Coverage Δ
BLAS 99.13% <ø> (ø)
CBLAS 96.98% <ø> (ø)
LAPACK 82.30% <100.00%> (+<0.01%) ⬆️
LAPACKE 2.17% <ø> (ø)
TMGLIB 55.69% <ø> (ø)
BLAS testing 88.54% <ø> (ø)
CBLAS testing 89.63% <ø> (ø)
LAPACK testing 82.21% <86.76%> (+<0.01%) ⬆️
LAPACKE testing ∅ <ø> (∅)
Files with missing lines Coverage Δ
SRC/clahef.f 98.93% <100.00%> (ø)
SRC/clasyf.f 98.79% <100.00%> (+0.01%) ⬆️
SRC/dlasyf.f 98.79% <100.00%> (+0.01%) ⬆️
SRC/slasyf.f 98.79% <100.00%> (+0.01%) ⬆️
SRC/zlahef.f 98.93% <100.00%> (ø)
SRC/zlasyf.f 98.79% <100.00%> (+0.01%) ⬆️
TESTING/LIN/cchkhe.f 85.96% <86.95%> (+0.25%) ⬆️
TESTING/LIN/cchksy.f 84.78% <87.23%> (+0.62%) ⬆️
TESTING/LIN/dchksy.f 85.71% <86.04%> (+0.07%) ⬆️
TESTING/LIN/schksy.f 85.71% <86.04%> (+0.07%) ⬆️
... and 2 more

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2e5d9c1...5b14af5. Read the comment docs.

Comment thread SRC/clahef.f Outdated
Comment thread SRC/clahef.f Outdated
Comment thread SRC/zlahef.f Outdated
Comment thread SRC/zlahef.f Outdated
@ACSimon33
ACSimon33 merged commit 9b1ceb6 into Reference-LAPACK:master Oct 4, 2026
47 checks passed
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.

LASYF / LAHEF: zero-pivot column is not copied back from W to A, so blocked SYTRF / HETRF return wrong factors when INFO > 0

2 participants