feat: Add Python 3.14 compatibility - #288
Open
mitchnegus wants to merge 8 commits into
Open
Conversation
mitchnegus
force-pushed
the
support-py314
branch
2 times, most recently
from
June 11, 2026 00:07
3efb6eb to
01a7877
Compare
mitchnegus
force-pushed
the
support-py314
branch
7 times, most recently
from
June 29, 2026 23:59
1ceda89 to
4038fdf
Compare
mitchnegus
force-pushed
the
support-py314
branch
from
June 30, 2026 01:05
4038fdf to
67f6a0e
Compare
mitchnegus
requested review from
gregjacobus and
sdelliot
and removed request for
sdelliot
June 30, 2026 01:14
Python 3.14 changes the default method for launching processes via the multiprocessing module (including how pickling is handled). This This means that locally defined functions passed to our multiprocessing target functions are unable to be properly pickled. This commit moves these targets to be top level functions and to use use pickleable arguments (e.g., graph IDs). It forces the forkserver method of launching processes (the new default and preferred method) so that this behavior will be explicit and consistent across Python versions.
mitchnegus
force-pushed
the
support-py314
branch
from
July 20, 2026 16:26
67f6a0e to
e59ff17
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.
feat: Add Python 3.14 compatibility
(Pardon the AI language style in the MR, but generating it this way from the patch files is so much faster...)
Description
This MR updates FIREWHEEL to support Python 3.14. It primarily addresses multiprocessing compatibility (due to updates to picklability of objects). The changes address Python 3.14 pickling behavior by moving multiprocessing target functions out of local scope and into module-level functions so they can be safely serialized. In particular:
ExperimentGraphshortest-path worker logic was refactored to use a top-level helper function and stable graph node IDs instead of locally scoped closures.minimegaAPI._check_version()was updated to use a top-level worker target and pickle-safe arguments for compatibility checks.ExperimentGraphmultiprocessing usage was updated to use an explicit multiprocessing context for queue and process creation.minimegaAPI code was further improved with type annotations and some small cleanup/refactoring for readability and maintainability. (To pass linting checks.)Motivation and context
Python 3.14 changes multiprocessing/pickling behavior in a way that breaks some existing patterns used in FIREWHEEL, specifically locally defined functions used as multiprocessing targets. (See the commentary on forkserver restrictions in the 3.14 Changelog. It is in the section on concurrent futures, which may be a better way to handle this pattern eventually, at least in the
minimega/apimodule.)These changes caused compatibility issues in code paths that spawn child processes for graph traversal and minimega binding/version validation.
This MR resolves that problem by:
Other additions for Python 3.14 support include:
Together, these changes allow FIREWHEEL to run and test cleanly under Python 3.14 while also improving maintainability of the affected code.
Type of Change
Checklist
Additional Notes
Notable implementation details:
ExperimentGraphworker refactor precomputes filtered vertex IDs in the parent process and sends only graph IDs to workers.