Skip to content

benchmark: initialize maxerr in cholesky.c - #6182

Merged
martin-frbg merged 1 commit into
OpenMathLib:developfrom
HecaiYuan:develop
Oct 27, 2026
Merged

martin-frbg merged 1 commit into
OpenMathLib:developfrom
HecaiYuan:develop

Conversation

@HecaiYuan

Copy link
Copy Markdown
Contributor

maxerr is read before it is written in the verification loop (if (maxerr < err) maxerr = err), which is undefined behavior. Depending on the stale stack value this can trigger a spurious "Hmm, probably it has bug." abort - e.g. on LoongArch with gcc 14.2 it did so at M=1 even though the result was correct.

Fix it the same way benchmark/linpack.c already does ("maxerr = 0.;" before its check loop).

maxerr is read before it is written in the verification loop
(if (maxerr < err) maxerr = err), which is undefined behavior.
Depending on the stale stack value this can trigger a spurious
"Hmm, probably it has bug." abort - e.g. on LoongArch with
gcc 14.2 it did so at M=1 even though the result was correct.

Fix it the same way benchmark/linpack.c already does
("maxerr = 0.;" before its check loop).
@martin-frbg martin-frbg added this to the 0.3.35 milestone Oct 27, 2026
@martin-frbg

Copy link
Copy Markdown
Collaborator

Right, thank you

@martin-frbg
martin-frbg merged commit 02a5904 into OpenMathLib:develop Oct 27, 2026
93 of 110 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.

2 participants