Fix truncating large workspace values#1195
Open
jberg5 wants to merge 1 commit intoReference-LAPACK:masterfrom
Open
Fix truncating large workspace values#1195jberg5 wants to merge 1 commit intoReference-LAPACK:masterfrom
jberg5 wants to merge 1 commit intoReference-LAPACK:masterfrom
Conversation
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
Addresses #1194.
Quick summary: using
REAL()workspace values truncated unrepresentable values to the nearest representable value for a f32, meaning most integers over 2^24 would be wrong. Downstream users of these values would underallocate, leading to segfaults.Have tested by building and running the MRE in the linked issue above.
I also asked Claude (with Opus 4.6) to create a test suite to prevent these kinds of regressions going forward. That said, I do not know fortran!! The REAL/DBLE issue was easy enough for me to understand, but TESTING/EIG/test_wq_rwork.f is not something I've personally been able to review with any level of confidence. I'm happy to remove it if it's valueless slop.
Checklist