⚡ Sangsakala Proxy 🏠 Home
Skip to content

[3.14] gh-159184: Do not intern NaN constants on the free-threaded build (GH-161276) - #161286

Open
miss-islington wants to merge 1 commit into
python:3.14from
miss-islington:backport-1db5966-3.14
Open

miss-islington wants to merge 1 commit into
python:3.14from
miss-islington:backport-1db5966-3.14

Conversation

@miss-islington

@miss-islington miss-islington commented Nov 4, 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.
(cherry picked from commit 1db5966)

Co-authored-by: Cody Maloney cmaloney@users.noreply.github.com
Co-authored-by: Claude Opus 5.5 noreply@anthropic.com

…ld (pythonGH-161276)

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.
(cherry picked from commit 1db5966)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@gpshead

gpshead commented Nov 4, 2026

Copy link
Copy Markdown
Member

!buildbot Refleaks NoGIL|NoGIL Refleaks

@bedevere-bot

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @gpshead for commit 6ed227b 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F161286%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 self-assigned this Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants