Repository navigation
Support Python 3.15 and free-threaded builds - #170
Open
jameshilliard wants to merge 1 commit into
Open
jameshilliard wants to merge 1 commit into
jameshilliard wants to merge 1 commit into
Conversation
jameshilliard
force-pushed
the
python315-freethreading
branch
3 times, most recently
from
October 21, 2026 18:07
423bbca to
16268ff
Compare
jameshilliard
marked this pull request as ready for review
October 21, 2026 18:26
Member
|
jameshilliard
force-pushed
the
python315-freethreading
branch
from
October 22, 2026 15:51
16268ff to
95db3d9
Compare
Member
|
jameshilliard
force-pushed
the
python315-freethreading
branch
from
October 22, 2026 16:45
95db3d9 to
b0b4d18
Compare
AdrianAtZyte
approved these changes
Oct 22, 2026
jameshilliard
force-pushed
the
python315-freethreading
branch
from
October 22, 2026 22:04
b0b4d18 to
040230a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #28.
Adds Python 3.15 and 3.15t wheel builds and CI coverage, adds 3.14t to the test matrix, and declares the Cython extension compatible with free-threading. Per-instance locks protect native state, including input setup and decoding within a shared
Tagger.tag()call. Training callbacks can inspect their trainer but cannot mutate active training state. Model dumps avoid closing file descriptors that another thread may have reused.Free-threaded builds route CRFsuite's shuffle calls through a mutex around libc's
rand(). This preserves the platform's generator and sequential shuffle sequence while protecting concurrent trainers on platforms such as macOS and musl, whoserand()implementations update shared state without locking. Native sources compile normally, and the CRFsuite submodule is unchanged.ItemSequenceretains its lock because calling__init__()on an existing instance replaces its native vector; a regression test covers concurrent reinitialization and reads.Committed regression tests cover shared-tagger calls from multiple threads, callback mutation rejection, concurrent
ItemSequencereinitialization, closed-taggerValueErrorbehavior, and import without enabling the GIL. The Cython minimum is reduced to 3.1 after verifying builds with that version. Setuptools 75.7 remains the minimum because it definesPy_GIL_DISABLEDfor free-threaded Windows extension builds (upstream change).Validated on macOS ARM64 using wheels built from the source distribution with Cython 3.1.0 and setuptools 75.7.0: Python 3.14t and 3.15t each passed 80 tests with 5 existing expected failures; Python 3.10 and 3.15 each passed 78 tests with 2 skips and 5 expected failures. These totals include additional temporary stress tests. A temporary native RNG probe verified that serialized and concurrent wrapper calls consume the same libc RNG sequence. Seeded smoke tests produced identical model files on 3.15 and 3.15t for L-BFGS, L2-SGD, AP, PA, and AROW.