Repository navigation
Add Python 3.15 support - #1663
Merged
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Read project.requires-python from pyproject.toml through a shared validator. Reject unsupported interpreters before build-script side effects and validate CMake's selected Python interpreter. Preserve the Python 3.9 deprecation warning, add tomli for Python 3.9–3.10, and include regression tests and documentation updates.
Allow Python 3.9 through 3.15 and select compatible NumPy and Numba requirements for Python 3.15 while retaining the existing ranges for older interpreters. Update version-boundary and dependency regression tests.
Upgrade cibuildwheel, add the cp315 selector, and move existing maximum-version builds and wheel installation checks to Python 3.15. Preserve the Python 3.9 build, older wheel selectors, and the existing CI test structure.
Update the platform installation guides to list standard CPython 3.9 through 3.15 and add a release note covering dependency compatibility and existing CI version updates.
Use __lazy_modules__ to defer plotting dependencies on Python 3.15 while retaining eager imports on Python 3.9-3.14. Add one compact subprocess test for import behavior and first-use execution plotting, plus a release note. Validation: the subprocess test passed on each Python version from 3.9 through 3.15. The existing 87 SimulationBaseClass tests previously passed on the same versions. Median SimulationBaseClass import time fell from 266 ms to 37 ms across 12 paired fresh-process trials on Python 3.15.2.
Remove the one-second pause after queuing retained data, relying on existing writer shutdown synchronization. Preserve worker-pool behavior. Add regression coverage for delayed writers and document the change. Monte Carlo benchmarks show 28–62% shorter batch times with identical retained results.
schaubh
force-pushed
the
feature/python_3_15
branch
from
October 30, 2026 04:25
19d6e7b to
99c3575
Compare
- Reuse one process pool across batches with configurable worker recycling. - Bound the retention queue and raise RuntimeError on writer failures. - Clean up workers, writers, and managers after failures or interruption. - Preserve failed-index reporting for task preparation and submission errors. - Support NumPy case indices in initial-condition reruns. - Add regression tests and document the resource controls. Validated: all 68 Monte Carlo tests pass on Python 3.9, 3.14, and 3.15.
Explicitly target the NumPy 1.24 C API in message bindings so newer build headers do not raise the minimum runtime requirement. Add a focused compile regression test and update the release note. Verify Python 3.15-built modules with Python 3.9 and NumPy 1.24.4: 46 compatibility tests passed; all 402 messaging tests passed on 3.15.
schaubh
added a commit
that referenced
this pull request
Oct 31, 2026
schaubh
added a commit
that referenced
this pull request
Oct 31, 2026
Read project.requires-python from pyproject.toml through a shared validator. Reject unsupported interpreters before build-script side effects and validate CMake's selected Python interpreter. Preserve the Python 3.9 deprecation warning, add tomli for Python 3.9–3.10, and include regression tests and documentation updates.
schaubh
added a commit
that referenced
this pull request
Oct 31, 2026
Allow Python 3.9 through 3.15 and select compatible NumPy and Numba requirements for Python 3.15 while retaining the existing ranges for older interpreters. Update version-boundary and dependency regression tests.
schaubh
added a commit
that referenced
this pull request
Oct 31, 2026
Upgrade cibuildwheel, add the cp315 selector, and move existing maximum-version builds and wheel installation checks to Python 3.15. Preserve the Python 3.9 build, older wheel selectors, and the existing CI test structure.
schaubh
added a commit
that referenced
this pull request
Oct 31, 2026
Update the platform installation guides to list standard CPython 3.9 through 3.15 and add a release note covering dependency compatibility and existing CI version updates.
schaubh
added a commit
that referenced
this pull request
Oct 31, 2026
schaubh
added a commit
that referenced
this pull request
Oct 31, 2026
Use __lazy_modules__ to defer plotting dependencies on Python 3.15 while retaining eager imports on Python 3.9-3.14. Add one compact subprocess test for import behavior and first-use execution plotting, plus a release note. Validation: the subprocess test passed on each Python version from 3.9 through 3.15. The existing 87 SimulationBaseClass tests previously passed on the same versions. Median SimulationBaseClass import time fell from 266 ms to 37 ms across 12 paired fresh-process trials on Python 3.15.2.
schaubh
added a commit
that referenced
this pull request
Oct 31, 2026
Remove the one-second pause after queuing retained data, relying on existing writer shutdown synchronization. Preserve worker-pool behavior. Add regression coverage for delayed writers and document the change. Monte Carlo benchmarks show 28–62% shorter batch times with identical retained results.
schaubh
added a commit
that referenced
this pull request
Oct 31, 2026
- Reuse one process pool across batches with configurable worker recycling. - Bound the retention queue and raise RuntimeError on writer failures. - Clean up workers, writers, and managers after failures or interruption. - Preserve failed-index reporting for task preparation and submission errors. - Support NumPy case indices in initial-condition reruns. - Add regression tests and document the resource controls. Validated: all 68 Monte Carlo tests pass on Python 3.9, 3.14, and 3.15.
schaubh
added a commit
that referenced
this pull request
Oct 31, 2026
schaubh
added a commit
that referenced
this pull request
Oct 31, 2026
schaubh
added a commit
that referenced
this pull request
Oct 31, 2026
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.
Description
Adds support for standard CPython 3.15 while retaining Python 3.9–3.14, and ensures source builds enforce the supported Python range. Profiling with Python 3.15’s Tachyon sampling profiler also identified startup and Monte Carlo overhead addressed in this PR.
Changes are organized into nine commits:
.venv.project.requires-python. The build script rejects unsupported interpreters before cleanup or generation; CMake validates its selected interpreter.>=3.9, <3.16, with Python-specific NumPy and Numba requirements that preserve dependency choices for older interpreters. Update the associated regression tests.SimulationBaseClasson Python 3.15. Python 3.9–3.14 retain their existing eager-import behavior.Monte Carlo workers recycle after eight simulations by default.
setMaxTasksPerChild()controls recycling, andsetRetentionQueueSize()controls queue capacity, which defaults to twice the active worker count. Writer failures raiseRuntimeError; simulation, preparation, and submission failures are reported through failed indices. The one-worker setting continues to execute in the calling process.Python 3.9’s existing deprecation warning remains unchanged. Free-threaded Python support is outside this PR.
Verification
Local compatibility validation completed:
Additional validation for the profiling-driven changes:
Representative local performance measurements:
SimulationBaseClassMeasurements used macOS ARM64 and Python 3.15.2 with the JIT disabled. Import results are medians from 12 paired fresh-process trials. Monte Carlo results are medians of three trials, comparing pool reuse against per-batch pool creation after removal of the fixed sleep; timings include process startup, retention, and shutdown, but exclude parent imports and plotting. These short workloads benefit strongly from reduced startup overhead.
The CPython JIT was also evaluated with basic-orbit, native-controller, Python-controller, and Numba scenarios. It provided no useful improvement in these local measurements, so this PR does not enable it.
Full PI and cross-platform CI checks should validate the final revision, including the Monte Carlo enhancements.
Documentation
Updated:
Future work
Continue profiling longer and more computationally intensive workloads to assess how these improvements scale. Scenario plotting and post-processing remain candidates for separate optimization.
Evaluate portable native-profiling build options, including explicit frame-pointer settings, before changing optimized-build defaults. Further JIT or free-threaded work should remain separate and be guided by measured benefits and compatibility requirements.