Skip to content

Conversation

@kumaraditya303
Copy link
Contributor

@kumaraditya303 kumaraditya303 commented Oct 14, 2025

This PR fixes the thread safety issues in msgspec implementation and add free-threading support as well as making it compatible with 3.14. Python 3.13t support is omitted as it is experimental and has many thread safety issues which won't be fixed.

For fixing compatibility with 3.14, many of the reference counting tests needed be adjusted to account for interpreter now using borrowed reference.

This PR includes #852 should that should be merged first.

edit: resolves #878

kumaraditya303 and others added 10 commits September 12, 2025 23:37
With this change, the tests run for me on a local build of Python 3.14.
There are a lot of failures related to sys.getrefcount() but that seems
to be an unrelated issue.

Closes jcrist#810. Fixes jcrist#651. Fixes jcrist#795.
@kumaraditya303
Copy link
Contributor Author

@ofek Should I add 3.14t CI in this PR or would you add it in #888?

@ofek
Copy link
Collaborator

ofek commented Oct 20, 2025

I just merged that PR, feel free to rebase and add support for 3.14t!

@kumaraditya303
Copy link
Contributor Author

I just merged that PR, feel free to rebase and add support for 3.14t!

done!

@kumaraditya303
Copy link
Contributor Author

All green now with 3.14t

Copy link
Collaborator

@ofek ofek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still getting ramped up on the codebase so I'm getting assistance from AI here, specifically GPT-5 Thinking (Extended).

Copy link
Collaborator

@ofek ofek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me, thanks a lot!

@ofek ofek merged commit a5d3f8e into jcrist:main Oct 20, 2025
7 checks passed
@kumaraditya303 kumaraditya303 deleted the thread-safe branch October 20, 2025 16:57
manzt pushed a commit to marimo-team/msgspec that referenced this pull request Nov 14, 2025
manzt added a commit to marimo-team/msgspec that referenced this pull request Nov 14, 2025
* Fix crash when TypedDict contains incorrect metadata (jcrist#853)

* Fix annotations support on 3.14 (jcrist#852)

* Relax all getrefcount tests to allow lower numbers (jcrist#854)

* Add 3.14 to CI (jcrist#888)

* add free-threading support  (jcrist#877)

Co-authored-by: Jelle Zijlstra <[email protected]>

* Enable Python 3.14 tests in CI

Remove cp314-* from CIBW_TEST_SKIP to allow Python 3.14 tests to run.
Previously, 3.14 wheels were built but tests were skipped.

---------

Co-authored-by: Jelle Zijlstra <[email protected]>
Co-authored-by: Miro Hrončok <[email protected]>
Co-authored-by: Ofek Lev <[email protected]>
Co-authored-by: Kumar Aditya <[email protected]>
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.

msgspec not installed in python 3.14t (free-thread version)

3 participants