Skip to content

Add Python 3.15 and 3.15t support - #4555

Open
XXXXRT666 wants to merge 4 commits into
ml-explore:mainfrom
XXXXRT666:python-3.15-support
Open

XXXXRT666 wants to merge 4 commits into
ml-explore:mainfrom
XXXXRT666:python-3.15-support

Conversation

@XXXXRT666

Copy link
Copy Markdown
Contributor
  • ☑️ I understand it is strictly prohibited to use AI to write PR description
  • AI usage disclosure: All tests are generated by AI, and AI helps me fix bugs

Add Python 3.15 and 3.15t to the release wheel matrix. Update nanobind from 3.0.1 to 3.1.0 and align the extension build configuration and documentation with free-threaded support.

Freeze bound types on Python 3.15 to enable Python immutable type optimizations. This prevents runtime changes to attributes on those types.

Tests on Python 3.15t also exposed two lifetime issues:

  • Transform callbacks were stored in nanobind function objects, which are immortal in free threaded builds. The wrapper now owns the C++ callback directly through a gc nanobind class instance, allowing captured objects and compiled function caches to be released.
  • The random state sentinel could access the Python runtime during static destruction and crash at shutdown when first initialized on a worker thread. Keep its existing process lifetime reference without a reference count operation during static destruction.

Let garbage-collected wrappers own C++ callbacks so compiled caches and captured objects are released. Keep the random state sentinel alive without a Python reference-count operation during static destruction.

This branch has not been deployed

No deployments
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.

1 participant