cpython icon indicating copy to clipboard operation
cpython copied to clipboard

gh-143429: Skip NaN encoding assertions for MIPS

Open chenx97 opened this issue 1 week ago • 2 comments

Description

This PR skips some NaN encoding tests in Lib/test/test_struct.py for the MIPS architecture.

math.nan depends on toolchain settings for a MIPS build, as setting -mnan=legacy and -mnan=2008 result in different __builtin_nan behavior for GCC.

Tests

  • Ran the official test suite: ./python -m test test_struct (Passed).
  • Issue: gh-143429

chenx97 avatar Jan 05 '26 09:01 chenx97

All commit authors signed the Contributor License Agreement.

CLA signed

python-cla-bot[bot] avatar Jan 05 '26 09:01 python-cla-bot[bot]

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

bedevere-app[bot] avatar Jan 05 '26 09:01 bedevere-app[bot]

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 I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

bedevere-app[bot] avatar Jan 07 '26 19:01 bedevere-app[bot]

@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.

skirpichev avatar Jan 08 '26 00:01 skirpichev

@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.

chenx97 avatar Jan 08 '26 10:01 chenx97

the parisc handling logic only runs for the 32-bit environment

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.

skirpichev avatar Jan 08 '26 11:01 skirpichev

Thanks @chenx97 for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. 🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

miss-islington-app[bot] avatar Jan 09 '26 10:01 miss-islington-app[bot]

GH-143595 is a backport of this pull request to the 3.14 branch.

bedevere-app[bot] avatar Jan 09 '26 10:01 bedevere-app[bot]

Mergerd, thank you for your fix. It's good that the fix is no longer to skip the tests :-)

vstinner avatar Jan 09 '26 11:01 vstinner