-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
gh-143429: Use compile-time NaN encoding detection for test_struct #143432
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
8ff4af9 to
0bbf71e
Compare
skirpichev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In principle, this looks good for me. But I would prefer a different solution, see issue thread.
CC @vstinner
vstinner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I just suggest moving the C change to Modules/_testcapi/float.c.
picnixz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgot to explicitly request changes.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
|
@chenx97, could you check also test_pack_unpack_roundtrip_for_nans() in Lib/test/test_capi/test_float.py? Is it enabled on your system? If so, it should fail too. If not, I suspect you could increase number of samples (10 for now) in this test. |
I think the tests are expected to pass on mips64, as the parisc handling logic only runs for the 32-bit environment. Legacy mips32 fails here, as you guessed. |
Ah, you are right. (I just did a quick grepping and didn't look on the function code.) Still, I think we could use new module variable also here, instead of the platform check. |
... and migrate another parisc detection to the new nan flag
vstinner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. It's better with _testcapi.nan_msb_is_signaling.
…uct (pythonGH-143432) (cherry picked from commit dcdb23f) Co-authored-by: Henry Chen <chenx97@aosc.io>
|
GH-143595 is a backport of this pull request to the 3.14 branch. |
|
Mergerd, thank you for your fix. It's good that the fix is no longer to skip the tests :-) |
Description
This PR uses C macros to detect NaN encoding schemes for Lib/test/test_struct.py, instead of detecting the host machine.
math.nandepends on toolchain settings for a MIPS build, as setting-mnan=legacyand-mnan=2008result in different__builtin_nanbehavior for GCC.Tests