Skip to content

TESTING: Make the test failures fatal and resolve all of them - #1371

Merged
langou merged 21 commits into
masterfrom
fatal_test_failures
Sep 13, 2026
Merged

langou merged 21 commits into
masterfrom
fatal_test_failures

Conversation

@ACSimon33

@ACSimon33 ACSimon33 commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Description

The test suite could not fail. A driver that found a numerical error printed it and exited with status 0, and every fatal STOP was either bare or carried a character stop code, which also exits with 0 — so ctest and lapack_testing.py, which both check the status, saw a passing run. This branch closes those paths and fixes what the CI then reported.

Merge this last: the numerical failures it exposes are fixed on their own branches (see table below).

Failures now fail

  • LAPACK_Test_Summary runs with --fail-on-error, so a numerical failure or error reported by any driver fails the run.
  • 177 fatal STOPs become STOP 1, across 45 files in BLAS/TESTING, CBLAS/testing, TESTING/EIG and TESTING/LIN.
  • The ALLOCATE checks passed their message as the stop code, which goes to stderr where the script never sees it; they now write it to the output unit.

Reports name their job

lapack_testing.py --junit-job NAME prefixes the JUnit suite (job / suite) and class (job.class) names, exposed to CMake as LAPACK_TESTING_JUNIT_JOB_ID. Codecov keys a test case on those names alone, so the reports of ~40 jobs collapsed onto one another, and a failure did not say where it came from.

Error-exit tests

  • On a Windows shared build, the drivers' own XERBLA cannot replace the library's, so the first deliberate illegal argument killed the driver before any test ran (CBLAS already skips its xerbla tests for this). LAPACK_SKIP_ERROR_EXIT_TESTS plus the new lapack_test_input() feed such a build a copy of the input with TSTERR off, written where lapack_testing.py looks for it so a hand-run driver uses the same input ctest does. This could be fixed by SET_XERBLA - override the error-handler without linker stuff #1407.
  • ?ec.in had no TSTERR line at all — ?chkee hard-coded .TRUE.. It is now read from the file, the line is added to sec.in/dec.in/cec.in/zec.in, and the input-format docs in [sdcz]chkee.F are updated.

The numerical failures, fixed elsewhere

Fix Clears
#1396 macos-26-nagfor, sec/dec; closes #598
#1397 ubuntu-26.04-gfortran, the 803-row cnep/ced/znep/zed baseline
#1398 STFSM 1 of 7776, every x86-64 gfortran job; closes #679
#1400 SHS/CHS 1 of 2016, ARM gfortran and armflang
#1401 ubuntu-26.04-arm-flang, ubuntu-24.04-arm-armflang; item 3 of #732
#1410 ubuntu-24.04-arm-armflang

Earlier test failures cleared on the way here; all merged: #1337, #1338, #1340, #1342, #1343, #1344, #1346, #1347, #1355.

…iles are now differentiated between the jobs.
@codecov

codecov Bot commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 22.61905% with 260 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.36%. Comparing base (6b64b63) to head (df8b100).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
TESTING/LIN/cchkaa.F 31.81% 15 Missing ⚠️
TESTING/LIN/dchkaa.F 31.81% 15 Missing ⚠️
TESTING/LIN/schkaa.F 31.81% 15 Missing ⚠️
TESTING/LIN/zchkaa.F 31.81% 15 Missing ⚠️
TESTING/EIG/cchkee.F 35.00% 13 Missing ⚠️
TESTING/EIG/zchkee.F 35.00% 13 Missing ⚠️
TESTING/EIG/csyl01.f 33.33% 12 Missing ⚠️
TESTING/EIG/dsyl01.f 33.33% 12 Missing ⚠️
TESTING/EIG/ssyl01.f 33.33% 12 Missing ⚠️
TESTING/EIG/zsyl01.f 33.33% 12 Missing ⚠️
... and 38 more
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1371      +/-   ##
==========================================
- Coverage   69.37%   69.36%   -0.02%     
==========================================
  Files        6122     6122              
  Lines      486495   486711     +216     
  Branches    23268    23268              
==========================================
+ Hits       337512   337584      +72     
- Misses     148545   148689     +144     
  Partials      438      438              
Components Coverage Δ
BLAS 97.94% <ø> (ø)
CBLAS 96.98% <ø> (ø)
LAPACK 82.38% <ø> (ø)
LAPACKE 2.17% <ø> (ø)
TMGLIB 55.69% <ø> (ø)
BLAS testing 88.33% <0.00%> (ø)
CBLAS testing 89.63% <0.00%> (ø)
LAPACK testing 82.20% <30.64%> (-0.08%) ⬇️
LAPACKE testing ∅ <ø> (∅)
Files with missing lines Coverage Δ
TESTING/EIG/alareq.f 65.45% <0.00%> (ø)
TESTING/EIG/schkdmd.f90 87.83% <0.00%> (ø)
TESTING/LIN/alareq.f 10.90% <0.00%> (ø)
TESTING/LIN/cchkrfp.f 62.35% <0.00%> (ø)
TESTING/LIN/dchkab.f 74.35% <0.00%> (ø)
TESTING/LIN/dchkrfp.f 62.35% <0.00%> (ø)
TESTING/LIN/schkrfp.f 62.35% <0.00%> (ø)
TESTING/LIN/zchkab.f 74.57% <0.00%> (ø)
TESTING/LIN/zchkrfp.f 62.35% <0.00%> (ø)
BLAS/TESTING/cblat1.f 88.77% <0.00%> (ø)
... and 38 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 6b64b63...df8b100. Read the comment docs.

ACSimon33 and others added 5 commits September 8, 2026 13:17
The merge kept both sides of the LAPACK_Test_Summary block, so nothing
configured at all: add_test refused the second, duplicate, test name.
Keep this branch's copy, which passes --fail-on-error and the job id,
and take the mention of LAPACKE from master's comment.

Moving the input check into the helper also dropped the rule that a BLAS
driver reading an input file must not have its stdout redirected: it
takes the name of its summary file from that input and opens it on unit
6 itself, so the redirect opened the one file twice and xBLAT2 died on
the second open.  Only xBLAT1, which has no input, needs it.

Also drop a reference to the preprocessor macro the error-exit tests no
longer use.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
langou
langou previously approved these changes Sep 11, 2026
@ACSimon33

Copy link
Copy Markdown
Collaborator Author

@langou All errors should be resolved now. When the three open PR's (#1398, #1400, and #1401) are merged, I'll merge the master back to this branch and see if I missed anything.

ACSimon33 and others added 4 commits September 12, 2026 23:47
nagfor rejects the SQRT( -ONE ) that creates a NaN, and the LAPACKE test
build regenerates the ?errcxx drivers without the -Onopropagate that
TESTING/LIN applies, so every nagfor job has failed to build since the
LAPACKE LIN tests were merged.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Every STOP in the test drivers was either bare or carried a character
stop code, and both exit with status 0.  That is not an accident of the
implementation: the standard recommends the exit status be taken from an
integer stop code, and recommends zero when the stop code is of type
character or absent.  So a driver that abandoned its run - an
unrecognised subprogram name, an input file it could not parse, a failed
ALLOCATE, or its own reference arithmetic evaluating wrongly - reported
success, and ctest and lapack_testing.py, which both do check the
status, saw a passing test.

The 177 fatal paths now use STOP 1.  A digit string as the stop code is
FORTRAN 77, and STOP keeps normal termination, so all units are still
flushed and closed; ERROR STOP would need Fortran 2008 and only
recommends flushing.  The 24 STOPs that end a program normally are left
as they are.

The ALLOCATE checks printed their message as the stop code, which sends
it to standard error where lapack_testing.py never sees it.  They now
write it to the output unit before stopping.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
--fail-if-empty only looked at the grand total, so one driver that wrote
its header and then ran nothing passed unnoticed as long as its siblings
kept the total above zero.  That is the shape of a driver whose input
file has stopped lining up with what it reads: the run is not an error
by any measure the script applies, the tests simply are not there.

Report every analyzed output file whose test count is zero, and let
--fail-if-empty fail on it as well.  Measured over a clean build, the
smallest per-file count is 6 tests and none is zero, so this does not
fire on a healthy run.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@ACSimon33
ACSimon33 marked this pull request as ready for review September 13, 2026 12:12
@ACSimon33

Copy link
Copy Markdown
Collaborator Author

Codecov Report

❌ Patch coverage is 23.45679% with 248 lines in your changes missing coverage. Please review. ✅ Project coverage is 69.36%. Comparing base (6b64b63) to head (3c87871). ✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
TESTING/LIN/cchkaa.F 31.81% 15 Missing ⚠️
TESTING/LIN/dchkaa.F 31.81% 15 Missing ⚠️
TESTING/LIN/schkaa.F 31.81% 15 Missing ⚠️
TESTING/LIN/zchkaa.F 31.81% 15 Missing ⚠️
TESTING/EIG/cchkee.F 35.00% 13 Missing ⚠️
TESTING/EIG/zchkee.F 35.00% 13 Missing ⚠️
TESTING/EIG/csyl01.f 33.33% 12 Missing ⚠️
TESTING/EIG/dsyl01.f 33.33% 12 Missing ⚠️
TESTING/EIG/ssyl01.f 33.33% 12 Missing ⚠️
TESTING/EIG/zsyl01.f 33.33% 12 Missing ⚠️
... and 34 more
Additional details and impacted files

The missing lines are the abnormal exit branches from the testing framework (STOP 1). We can't hit those in coverage.

@ACSimon33
ACSimon33 marked this pull request as draft September 13, 2026 12:34
ACSimon33 and others added 8 commits September 13, 2026 15:09
The drivers lost their _lapacke segment when the testing CMakeLists was
reworked, so --run could not find any of them.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
--fail-if-empty gated both "no results at all" and "some output file
ran nothing", with no way to ask for one without the other.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Job ids carry the runner image version, so their dots split one job
across two levels of the JUnit hierarchy.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The four ?chkdmd drivers printed FAILED and stopped with status 0, so
ctest saw a clean run; the STOP that ends the program keeps status 0.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The rewrite runs at configure time, so a copy outlived both edits to its
source and the build flipping back to running the error exits.  An input
with no flag to turn off now gets no copy at all.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
An unconditional else() clobbered -D, and a shared macOS build without
USE_FLAT_NAMESPACE hits the same XERBLA override failure as Windows.
The warning that replaced it also tested BUILD_TESTING before the option
declaring it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
A build directory with a space in it split them into extra arguments,
which cmake_parse_arguments then discarded.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
BLAS/TESTING hand-rolled the same compiler-id test and flag the helper
was added to hold, for its own set of drivers.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The four generalized-eigenvalue inputs were the only ones spelling it
.TRUE., which the CMake rewrite carried a second pattern for.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@ACSimon33
ACSimon33 marked this pull request as ready for review September 13, 2026 14:34
@ACSimon33

Copy link
Copy Markdown
Collaborator Author

@langou All issues are resolved now. The code coverage is reduced slightly because of the unreachable STOP 1 lines in the test framework.

@langou
langou merged commit a6c6e74 into master Sep 13, 2026
43 of 45 checks passed
@langou

langou commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Hi @ACSimon33, this is really nice work. Julien.

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.

stest_rfp: STFSM test is very sensitive to small numeric errors in BLAS STRSM LAPACK slaln2.f: more accuracy hurts if not consistent

3 participants