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
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