Commit graph

669 commits

Author SHA1 Message Date
Hugo van Kemenade
f783cc37eb
Update pre-commit with zizmor and Ruff fixes (#143095) 2025-12-23 17:51:02 +02:00
Chris Eibl
be3c131640
GH-139922: Tail calling for MSVC (VS 2026) (GH-143068)
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Co-authored-by: Brandt Bucher <brandt@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-12-22 23:01:34 +00:00
sobolevn
248eb3efb3
gh-142859: Add Tools/check-c-api-docs to mypy check (#142860) 2025-12-17 13:23:30 +02:00
Ken Jin
b6d708ff2c
Add Fidget-Spinner to more JIT CODEOWNERS (GH-142768) 2025-12-15 21:50:42 +00:00
Hugo van Kemenade
04a9009a53
gh-140189: Revert "Temporarily allow CI failures for iOS (#142365)" (#142660) 2025-12-14 12:54:42 +02:00
Pablo Galindo Salgado
ff52e90ea4
Add pablogsal as codeowner for profiling sampling files and docs (#142678) 2025-12-13 19:10:59 +00:00
Russell Keith-Magee
91884838bc
gh-140189: Use macos-14 runner for iOS CI tests (#142444)
Switch to the macos-14 runner for iOS CI, working around some instability 
in the macos-15 runner.
2025-12-10 05:52:52 +08:00
Stan Ulbrych
9e3d7cdec1
gh-142278: Add granular change detection for platforms in CI (#142350)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-12-08 18:04:17 +00:00
Savannah Ostrowski
9d39c02498
Temporarily allow CI failures for iOS (#142365)
iOS tests are flaky right now. Based on the convo in Discord, it seems like allowing failures is the best option.

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-12-08 11:54:47 -05:00
Peter Bierma
1a7824a927
gh-141004: Add a CI job ensuring that new C APIs include documentation (GH-142102)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-12-04 03:14:25 +00:00
Bartosz Sławecki
88cd5d9850
gh-142170: Add pymanager link to issue template menu (#142199)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-12-03 11:11:40 +02:00
Stan Ulbrych
9f2a34af74
Remove references to `Misc/ACKS from CONTRIBUTING.md` (#141952)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-11-25 18:59:28 +00:00
Gregory P. Smith
2746c698e3
[security] Add a cooldown period to dependabot (GH-141866)
See https://blog.yossarian.net/2025/11/21/We-should-all-be-using-dependency-cooldowns and the description in the comment.
2025-11-23 01:34:48 -08:00
Alex Crichton
9b69a55be3
gh-141172: Update to wasi-sdk-29 (GH-141684)
This commit updates CI and configuration from wasi-sdk-25 to wasi-sdk-29
which was released recently. This notably includes stubs for pthreads
which all return errors, so some adjustment in logic is necessary to
retain knowledge that WASI cannot yet spawn threads for example.

This additionally increases the wasm stack allowance to 32MiB from 16MiB
to accomodate the `test_recursive_pickle` test in the
`test_functools.py` file. It looks like the Clang/LLVM update that
happened in wasi-sdk-29 relative to wasi-sdk-25 is likely the cause of
this where presumably functions have more locals than before and/or a
slightly adjusted stack space requirement which overflows the stack.
2025-11-19 10:03:30 -08:00
Mark Shannon
b420f6be53
GH-139109: Support switch/case dispatch with the tracing interpreter. (GH-141703) 2025-11-18 13:31:48 +00:00
Hugo van Kemenade
181a2f4f2e
gh-139596: Cease caching config.cache & ccache in GH Actions (#141451) 2025-11-14 11:59:19 +02:00
Ken Jin
4fa80ce74c
gh-139109: A new tracing JIT compiler frontend for CPython (GH-140310)
This PR changes the current JIT model from trace projection to trace recording. Benchmarking: better pyperformance (about 1.7% overall) geomean versus current https://raw.githubusercontent.com/facebookexperimental/free-threading-benchmarking/refs/heads/main/results/bm-20251108-3.15.0a1%2B-7e2bc1d-JIT/bm-20251108-vultr-x86_64-Fidget%252dSpinner-tracing_jit-3.15.0a1%2B-7e2bc1d-vs-base.svg, 100% faster Richards on the most improved benchmark versus the current JIT. Slowdown of about 10-15% on the worst benchmark versus the current JIT. **Note: the fastest version isn't the one merged, as it relies on fixing bugs in the specializing interpreter, which is left to another PR**. The speedup in the merged version is about 1.1%. https://raw.githubusercontent.com/facebookexperimental/free-threading-benchmarking/refs/heads/main/results/bm-20251112-3.15.0a1%2B-f8a764a-JIT/bm-20251112-vultr-x86_64-Fidget%252dSpinner-tracing_jit-3.15.0a1%2B-f8a764a-vs-base.svg

Stats: 50% more uops executed, 30% more traces entered the last time we ran them. It also suggests our trace lengths for a real trace recording JIT are too short, as a lot of trace too long aborts https://github.com/facebookexperimental/free-threading-benchmarking/blob/main/results/bm-20251023-3.15.0a1%2B-eb73378-CLANG%2CJIT/bm-20251023-vultr-x86_64-Fidget%252dSpinner-tracing_jit-3.15.0a1%2B-eb73378-pystats-vs-base.md .

This new JIT frontend is already able to record/execute significantly more instructions than the previous JIT frontend. In this PR, we are now able to record through custom dunders, simple object creation, generators, etc. None of these were done by the old JIT frontend. Some custom dunders uops were discovered to be broken as part of this work gh-140277

The optimizer stack space check is disabled, as it's no longer valid to deal with underflow.

Pros:
* Ignoring the generated tracer code as it's automatically created, this is only additional 1k lines of code. The maintenance burden is handled by the DSL and code generator.
* `optimizer.c` is now significantly simpler, as we don't have to do strange things to recover the bytecode from a trace.
* The new JIT frontend is able to handle a lot more control-flow than the old one.
* Tracing is very low overhead. We use the tail calling interpreter/computed goto interpreter to switch between tracing mode and non-tracing mode. I call this mechanism dual dispatch, as we have two dispatch tables dispatching to each other. Specialization is still enabled while tracing.
* Better handling of polymorphism. We leverage the specializing interpreter for this.

Cons:
* (For now) requires tail calling interpreter or computed gotos. This means no Windows JIT for now :(. Not to fret, tail calling is coming soon to Windows though https://github.com/python/cpython/pull/139962

Design:
* After each instruction, the `record_previous_inst` function/label is executed. This does as the name suggests.
* The tracing interpreter lowers bytecode to uops directly so that it can obtain "fresh" values at the point of lowering.
* The tracing version behaves nearly identical to the normal interpreter, in fact it even has specialization! This allows it to run without much of a slowdown when tracing. The actual cost of tracing is only a function call and writes to memory.
* The tracing interpreter uses the specializing interpreter's deopt to naturally form the side exit chains. This allows it to side exit chain effectively, without repeating much code. We force a re-specializing when tracing a deopt.
* The tracing interpreter can even handle goto errors/exceptions, but I chose to disable them for now as it's not tested.
* Because we do not share interpreter dispatch, there is should be no significant slowdown to the original specializing interpreter on tailcall and computed got with JIT disabled. With JIT enabled, there might be a slowdown in the form of the JIT trying to trace.
* Things that could have dynamic instruction pointer effects are guarded on. The guard deopts to a new instruction --- `_DYNAMIC_EXIT`.
2025-11-13 18:08:32 +00:00
Savannah Ostrowski
d162c42790
GH-140479: Update JIT builds to use LLVM 21 (#140973) 2025-11-12 18:09:25 +00:00
Adam Turner
c744ccb2c9
GH-139596: Cease caching config.cache & ccache in GH Actions (GH-139623)
* Cease caching config.cache in GH Actions\
* Remove ccache action
2025-11-11 13:51:22 -08:00
Ken Jin
947bb4642c
gh-140889: Bump tailcall and JIT CI to llvm 20 (#140963) 2025-11-03 12:37:29 -08:00
Hugo van Kemenade
cf1a2c1ee4
gh-133600: Run Tools/wasm/wasi on CI instead of deprecated Tools/wasm/wasi.py (#140907) 2025-11-03 21:26:09 +02:00
Ken Jin
9791a506c2
gh-140889: Test tailcall and JIT in CI (GH-140891) 2025-11-03 19:07:55 +00:00
Savannah Ostrowski
4e2ff4ac4c
GH-136895: Update JIT builds to use LLVM 20 (#140329)
Co-authored-by: Emma Harper Smith <emma@emmatyping.dev>
2025-11-03 10:01:44 -08:00
Brett Cannon
ac1ffd7785
Move WASI CI over to Arm runners (GH-140810) 2025-10-30 15:29:39 -07:00
Russell Keith-Magee
f4e6370582
gh-140189: Add CI job to test iOS builds. (#140190)
Adds a CI configuration to test iOS builds on every build.

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-10-28 13:46:38 +08:00
Brett Cannon
e5f4299f13
GH-140475: Support WASI SDK 25 (#140477)
As well, bump the version of Wasmtime used in CI.
2025-10-22 14:34:37 -07:00
Albert N
999ab8926b
gh-133059: Fix Tools/build/deepfreeze.py for new nsmallposints (#139906) 2025-10-17 11:48:53 +03:00
Hugo van Kemenade
9c1279d5de
gh-124111: test macOS CI with Tk 9 (#137424)
Co-authored-by: Ned Deily <nad@python.org>
2025-10-14 00:00:58 -04:00
Jacob Coffee
6954077fde
Remove Cirrus macOS runners from CI (#139799)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-10-08 19:14:05 +00:00
Malcolm Smith
a9b0506d8d
gh-137242: Allow Android testbed to take all Python command-line options (#138805)
Modifies the Android test runner to ensure that all valid Python command line
options are preserved when running the test suite.
2025-10-06 13:19:48 +08:00
Zachary Ware
98e748b3a0
gh-139573: Update OpenSSL in CI (GH-139577) 2025-10-04 19:43:17 -05:00
Filipe Laíns 🇵🇸
f191db2e0e
Add FFY00 to CODEOWNERS for generate-build-details (#139561)
Signed-off-by: Filipe Laíns <lains@riseup.net>
2025-10-04 15:25:07 +01:00
Stan Ulbrych
37d16f7f62
Replace workflow with project automations (#136831)
Remove unnecessary workflow
2025-10-04 07:09:37 +02:00
Jacob Coffee
1ae9250364
gh-137638: Use macos-15-intel in GitHub Actions (#139154)
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-10-03 19:49:03 +00:00
Victor Stinner
16da633dfe
Remove @tiran from CODEOWNERS (#139513)
Christian Heimes is now inactive for 2 years.
2025-10-02 18:05:37 +02:00
Donghee Na
c4f21d7c7c
gh-133171: Re-enable JUMP_BACKWARD to free-threading build (gh-137800) 2025-09-24 14:19:17 +09:00
Stan Ulbrych
b90e4ace9d
Link to Discourse in `.github/CONTRIBUTING.rst` (#138996)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-09-21 10:49:46 +00:00
Russell Keith-Magee
35c7e52b3e
gh-138171: Migrate iOS testbed location and add Apple build script (#138176)
Adds tooling to generate and test an iOS XCframework, in a way that will also facilitate
adding other XCframework targets for other Apple platforms (tvOS, watchOS, visionOS and 
even macOS, potentially).

---------
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-09-19 13:23:38 +01:00
Donghee Na
8247e1b3e7
gh-137838: Add CI for no-opt JIT (#139081)
* gh-137838: Add CI for no-opt JIT

* nit
2025-09-18 11:46:03 +01:00
Paul Ganssle
5560ab674b
Add pganssle to CODEOWNERS for `zoneinfo` (#139032)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-09-17 16:17:27 +01:00
Emma Smith
445b424b74
Re-order Modules/makesetup in CODEOWNERS and update owners (#138628)
* Re-order Modules/makesetup in CODEOWNERS and add Adam Turner
* Add Erlend to Modules/makesetup in CODEOWNERS
2025-09-15 19:52:59 -07:00
Hugo van Kemenade
6e78a539bf
gh-138744: GitHub Actions: pin to windows-2022 (#138743) 2025-09-10 17:28:27 +03:00
Emma Smith
4ed046c481
Add Emma Smith to CODEOWNERS (#138588)
Added myself as a code owner for build system files, WASM platform files, and compression.zstd files.
2025-09-07 01:11:19 -07:00
sobolevn
03f8d3b0db
gh-126524: Revert "gh-126524: Run regen-unicodedata as a part of our CI #126682" (#138197) 2025-08-28 10:31:44 +03:00
Adam Turner
73fb155ba7
Introduce a structure for `.github/CODEOWNERS` (#137498)
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-08-26 03:34:07 +02:00
Bénédikt Tran
96b7a2eba4
gh-135261: bring back CI job for testing OpenSSL 1.1.1w (#135262)
This partially reverts commit d83e30cadd
by bringing back the CI job for testing OpenSSL 1.1.1w. Despite this
version being upstream EOL, the rationale for keeping it as follows:

- It most resembles other 1.1.1-work-a-like ssl APIs supported by important vendors.
- Python officially requires OpenSSL 1.1.1 or later, although OpenSSL 3.0 or later
  is recommended for cryptographic modules. Since changing the build requirements
  requires a transition period, we need to keep testing the allowed versions.
- The code base still contains calls to OpenSSL functions that are deprecated since
  OpenSSL 3.0 as well as `ifdef` blocks constrained to OpenSSL 1.1.1.
2025-08-24 09:01:37 +00:00
Ken Jin
8952b826a7
gh-138042: Fix homebrew for tail-calling macOS CI (GH-138043)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-08-22 20:15:40 +08:00
sobolevn
04377a1bd1
gh-133403: Run mypy on Tools/build/check_warnings.py (#137700) 2025-08-14 16:58:02 +03:00
Zachary Ware
7a703c8f19
gh-132339: Add support for OpenSSL 3.5 (GH-137720)
* Add OpenSSL 3.5.2 definitions to Modules/_ssl_data_35.h (moved from Modules/_ssl_data_34.h)

* Demote OpenSSL 3.1 to "old", remove it from CI

* Update all OpenSSL versions to latest patchlevel in CI config and multissltests defaults

* Add OpenSSL 3.5.2 to CI configuration and multissltests default list

* Fix a typo in the argument parser description of multissltests.py
2025-08-13 23:18:03 -05:00
sobolevn
e93dca7223
gh-133403: Run mypy on Tools/build/mypy.ini changes (#137692) 2025-08-12 22:01:50 +00:00