Skip to content

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

Merged
gpshead merged 1 commit into
python:3.15from
miss-islington:backport-1db5966-3.15
Nov 5, 2026
Merged

gpshead merged 1 commit into
python:3.15from
miss-islington:backport-1db5966-3.15

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 900f231 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F161287%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
@gpshead
gpshead merged commit 476b725 into python:3.15 Nov 5, 2026
62 checks passed
@miss-islington
miss-islington deleted the backport-1db5966-3.15 branch November 5, 2026 22:04
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.

4 participants