Skip to content

gh-159184: Do not intern NaN constants on the free-threaded build - #161276

Merged
gpshead merged 1 commit into
python:mainfrom
cmaloney:gh-159184-ft-nan-constants
Nov 4, 2026
Merged

gpshead merged 1 commit into
python:mainfrom
cmaloney:gh-159184-ft-nan-constants

Conversation

@cmaloney

@cmaloney cmaloney commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

compare_constants() matches floats by bits, but hash_const() uses the object hash, which for a NaN depends on its address, so each NaN loaded by marshal.loads() added an immortal entry to the constants table. Hashing the bits would merge NaNs and shrink frozensets, so leave them out of the table.

compare_constants() matches floats by bits, but hash_const() uses the object
hash, which for a NaN depends on its address, so each NaN loaded by
marshal.loads() added an immortal entry to the constants table.  Hashing the
bits would merge NaNs and shrink frozensets, so leave them out of the table.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cmaloney

cmaloney commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

!buildbot Refleaks NoGIL|NoGIL Refleaks

@bedevere-bot

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @cmaloney for commit aba373c 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F161276%2Fmerge

The command will test the builders whose names match following regular expression: Refleaks NoGIL|NoGIL Refleaks

The builders matched are:

  • s390x Fedora Rawhide NoGIL refleaks PR
  • AMD64 Fedora Rawhide NoGIL refleaks PR
  • PPC64LE Fedora Rawhide NoGIL refleaks PR
  • aarch64 Fedora Rawhide NoGIL refleaks PR
  • AMD64 CentOS9 NoGIL Refleaks PR
  • ARM64 MacOS M1 Refleaks NoGIL PR

@gpshead
gpshead merged commit 1db5966 into python:main Nov 4, 2026
112 of 114 checks passed
@gpshead gpshead added needs backport to 3.14 bugs and security fixes needs backport to 3.15 bugs and security fixes labels Nov 4, 2026
@miss-islington-app

Copy link
Copy Markdown

Thanks @cmaloney for the PR, and @gpshead for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Thanks @cmaloney for the PR, and @gpshead for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15.
🐍🍒⛏🤖

@bedevere-app

bedevere-app Bot commented Nov 4, 2026

Copy link
Copy Markdown

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

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Nov 4, 2026
@bedevere-app

bedevere-app Bot commented Nov 4, 2026

Copy link
Copy Markdown

GH-161287 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Nov 4, 2026
@cmaloney
cmaloney deleted the gh-159184-ft-nan-constants branch November 4, 2026 01:59
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.

3 participants