Commit Graph

654 Commits

Author SHA1 Message Date
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
Malcolm Smith
f660ec3753 gh-137242: Add Android CI job (#137186)
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
2025-08-12 20:16:04 +03:00
sobolevn
68a61b0f1d gh-133403: Check generate_stdlib_module_names and check_extension_modules with mypy (#137546) 2025-08-12 18:11:18 +03:00
Malcolm Smith
b36d23f58e Update pre-commit hooks (#137591)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-08-10 22:32:50 +00:00
Adam Turner
b4a1974aa2 GH-136155: Fail the EPUB check on fatal errors (#137351) 2025-08-08 02:32:20 +01:00
Adam Turner
ffb5a5372d Further CODEOWNERS listings for Adam Turner (#137483) 2025-08-06 19:53:08 +01:00
Zachary Ware
9745976ac6 Fix buildbot release status link in CONTRIBUTING.rst (GH-137429)
The existing link works, but includes the legacy `/all` part of the path
which causes a scary-looking banner about a misconfiguration on the
`Home` page when in reality it's the link that includes a deprecated path.
2025-08-05 19:44:27 +00:00
Alex Waygood
a46ed665ff Remove Alex Waygood as a codeowner for pre-commit config (#137372) 2025-08-04 13:29:14 +03:00
Brandt Bucher
d591b5effb GH-134291: Support older macOS deployment targets for JIT builds (GH-137211) 2025-07-30 15:48:18 -07:00
🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко)
65d2c51c10 GH-111758: Merge TSan and UBSan reusable GHA workflows (#136820)
Co-authored-by: Sviatoslav Sydorenko <webknjaz@redhat.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-07-20 23:03:46 +03:00
Maciej Olko
624bf52c83 gh-136155: Docs: check for EPUB fatal errors in CI (#134074)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2025-07-15 15:26:24 +03:00
Will Childs-Klein
db47f4d844 gh-135401: Test AWS-LC as a cryptography library in CI (GH-135402)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Zachary Ware <zach@python.org>
2025-07-11 17:24:11 -05:00
Brandt Bucher
56c6f04b88 Omit Python/perf_jit_trampoline.c from the **/*jit* CODEOWNERS rule (#136519)
Omit perf_jit_trampoline from "JIT" codeowners
2025-07-10 23:08:48 +01:00
Diego Russo
e697f5e7c0 Add Diego Russo as code owner of the JIT (#136460) 2025-07-09 21:18:06 +01:00
Ken Jin
b3308973e3 gh-136183: Deal with escapes in JIT optimizer's constant evaluator (GH-136184) 2025-07-02 14:08:25 +08:00
Sergey B Kirpichev
17cf0a343b gh-115119: Remove implicit fallback to the bundled libmpdec (#134078)
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-07-01 17:50:51 +02:00