Repository navigation
Preserve exception semantics in shared test comparisons - #1440
Open
agourakis82 wants to merge 1 commit into
Open
agourakis82 wants to merge 1 commit into
agourakis82 wants to merge 1 commit into
Conversation
The power tests unmask invalid operations. Give Clang a strict exception contract in guarded safe_division and the trapping test function so vectorization cannot introduce a division on a zero-denominator path. Preserve all numerical expressions, guards, exception masks and assertions. GCC and fast-math profiles retain their existing compilation behavior. Assisted-by: OpenAI Codex
agourakis82
marked this pull request as ready for review
November 2, 2026 10:33
This branch has not been deployed
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.
The existing power tests unmask invalid-operation exceptions, but the shared comparison helper is compiled with Clang's default assumption that exceptions remain masked. In an optimized CLANG64 build,
safe_divisionis vectorized into a speculativevdivpson a guarded zero-denominator path. The comparison then raisesSTATUS_FLOAT_INVALID_OPERATION(0xC0000090), which MSYS2 presents as exit 127.This adds scoped
#pragma clang fp exceptions(strict)tosafe_divisionand the power-test function. All expressions, division guards, exception-mask operations and assertions remain unchanged. The shared helper receives the same contract across translation units. The pragmas are disabled for GCC and fast-math profiles; no production headers or workflows change.Validation uses native C++23:
0xC0000090. Fresh full, multi-translation-unit builds with this exact patch pass: base 430 cases / 151245 assertions, merge 432 / 152205. Native and original MSYS launches both return zero after the fix. No tests are excluded in these full runs.CHECK_BATCH_EQ, first element offset, and the faulting comparison instruction. Independent standalonepowprobes pass with invalid exceptions unmasked.An additional exploratory Clang 18 Release combined ASan/UBSan fast-math run is not green: it reports three API assertion failures and integer-overflow diagnostics. That is a different profile and is not represented as passing validation or repaired here.
This is a fresh fork-run diagnosis, separate from official upstream CI and maintainer review. It reproduces the symptom reported on #1433 and on master; it does not recover the historical job's missing native status. The original sqrt patch remains separate.
Prepared with OpenAI Codex assistance, including independent source and diagnostic review.