4940 Commits

Author SHA1 Message Date
Petr Viktorin
70e67f579e
gh-141376: smelly.py: Print only smelly symbols, or all of them with --verbose (GH-141394)
Instead of long and uninteresting output for all checked libraries, only print found issues by default.

Add a new -v/--verbose option to list all symbols (useful for checking that the script finds the symbols).
2026-01-23 17:51:29 +01:00
Brett Cannon
6181b69970
GH-143941: Move WASI-related files to Platforms/WASI (GH-143942)
Along the way, leave a deprecated Tools/wasm/wasi/__main__.py behind for backwards-compatibility.

Co-authored-by: Zachary Ware <zachary.ware@gmail.com>
2026-01-21 14:31:58 -08:00
Hugo van Kemenade
a126893fa8
gh-143960: Add support for OpenSSL 3.6, drop EOL 3.2 (#143961)
Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
2026-01-20 17:25:31 +02:00
Hai Zhu
b4b73245d8
gh-143421: Use new buffer to save optimized uops (GH-143682) 2026-01-17 15:52:16 +00:00
Peter Bierma
d51c01a271
gh-141004: Document PyException_HEAD and PyDescr_COMMON (GH-143896) 2026-01-17 10:39:29 -05:00
Neil Schemenauer
bb25f7280a
gh-132657: Add maybe_enable_deferred_ref_count() (gh-142843)
If we are specializing to `LOAD_GLOBAL_MODULE` or `LOAD_ATTR_MODULE`, try
to enable deferred reference counting for the value, if the object is owned by
a different thread.  This applies to the free-threaded build only and should
improve scaling of multi-threaded programs.
2026-01-17 01:54:43 +00:00
Ken Jin
949b5ec8e6
gh-142913: Remove JIT interpreter for interpreter generator tests (GH-143944) 2026-01-17 00:34:39 +00:00
Dino Viehland
4d5a676aa0
gh-142913: Add test case for interpreter generator w/ overridden opcodes (#142911)
Add test case for interpreter generator w/ overridden opcodes
2026-01-16 10:33:29 -08:00
Seth Michael Larson
edeebe22cb
gh-143572: Run 'python3-libraries' fuzzer in CI using CIFuzz (#143749)
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <578543+webknjaz@users.noreply.github.com>
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2026-01-16 18:09:39 +02:00
Serhiy Storchaka
bab1d7a561
gh-74902: Add Unicode Grapheme Cluster Break algorithm (GH-143076)
Add the unicodedata.iter_graphemes() function to iterate over grapheme
clusters according to rules defined in Unicode Standard Annex #29.

Add unicodedata.grapheme_cluster_break(), unicodedata.indic_conjunct_break()
and unicodedata.extended_pictographic() functions to get the properties
of the character which are related to the above algorithm.

Co-authored-by: Guillaume "Vermeille" Sanchez <guillaume.v.sanchez@gmail.com>
2026-01-14 14:37:57 +00:00
Peter Bierma
0e0d51cdce
gh-141004: Document several soft-deprecated C APIs (GH-141634)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-01-14 08:20:33 -05:00
Stan Ulbrych
1176facbf2
gh-141004: Don't trigger run-tests when Tools/check-c-api-docs/ignored_c_api.txt is changed (GH-143583) 2026-01-13 08:28:09 -05:00
Petr Viktorin
f0a0467c17
gh-143054: Disallow non-top-level Cut for now (GH-143622)
The behaviour of Cut in nested parentheses, Repeat, Opt, and similar
is somewhat chaotic. Apparently even the academic papers on PEG aren't
as clear as they could be.

And it doesn't really matter. Python only uses top-level cuts.
When that changes, we can clarify as much as necessary (and even
change the implementation to make sense for what we'll need).

Document that this is deliberately unspecified, and add a test to
make sure any decision is deliberate, tested and documented.
2026-01-13 13:21:59 +01:00
Yashraj
a7ba3b124f
gh-141004: Document symbol visibility macros (PyAPI_DATA, Py_EXPORTED_SYMBOL, Py_LOCAL_SYMBOL,Py_IMPORTED_SYMBOL) (GH-143508)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-01-13 13:15:02 +01:00
Yashraj
42f7c2dfba
gh-141004: Document PyUnicode_IS_COMPACT and PyUnicode_IS_COMPACT_ASCII macros (GH-143494) 2026-01-12 13:59:59 +01:00
Ken Jin
548526bbbe
gh-134584: JIT: Remove redundant refcounting for UNARY_{INVERT|NEGATIVE} (GH-143704) 2026-01-11 20:42:55 +00:00
Ken Jin
95259116ec
gh-142764: Restore REPLACE_OPCODE_IF_EVALUATES_PURE optimization for some ops (GH-143335) 2026-01-09 23:18:22 +00:00
Petr Viktorin
1932127ec7
gh-141004: Document remaining constants from patchlevel.h (GH-143598)
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-01-09 17:40:07 +00:00
Petr Viktorin
234a15dc4e
gh-141004: Improve make check-c-api-docs (GH-143564)
- Gather all documented names into a set in a single pass.
  This makes the check much faster.

- Do not match substrings (e.g. documenting `PyErr_WarnEx`
  doesn't mean that `PyErr_Warn` is documented)

- Consider `PY`-prefixed names (a lot of old macros use this)
2026-01-09 11:16:50 +01:00
Sam Gross
49c3b0a67a
gh-142095: Use thread local frame info in py-bt and py-bt-full when available (gh-143371)
In optimized and `-Og` builds, arguments and local variables are frequently
unavailable in gdb. This makes `py-bt` fail to print anything useful. Use the
`PyThreadState*` pointers `_Py_tss_gilstate` and `Py_tss_tstate` to find the
interpreter frame if we can't get the frame from the
`_PyEval_EvalFrameDefault` call.

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-01-08 09:18:24 -05:00
Sam Gross
d04394929b
gh-117657: Remove remaining TSan suppressions (gh-143499) 2026-01-07 17:34:05 +00:00
Sam Gross
98e55d70bc
gh-132070: Fix PyObject_Realloc thread-safety in free threaded Python (gh-143441)
The PyObject header reference count fields must be initialized using
atomic operations because they may be concurrently read by another
thread (e.g., from `_Py_TryIncref`).
2026-01-06 15:55:37 -05:00
Donghee Na
98258326a9
no-issue: Fix optimizer_generator.py to print abstract_uop_name properly (gh-143366) 2026-01-02 17:18:15 +00:00
Sam Gross
e8e044eda3
gh-143100: Fix memcpy data race in setobject.c (gh-143127) 2025-12-24 08:02:19 -05:00
Diego Russo
fc2f0fea6b
JIT: Move executor to a register (#143072) 2025-12-24 09:44:16 +00:00
Sam Gross
50ecd6b880
gh-143108: Don't instrument faulthandler.c for TSan (#143109)
The dumping of tracebacks has data races and that's okay (it's best
effort).
2025-12-24 02:12:55 +01:00
Sam Gross
cbe0cb779a
gh-143100: Add temporary suppression for set_swap_bodies (gh-143114) 2025-12-23 15:52:59 -05:00
Mark Shannon
20aeb3a463
GH-143026: Fix assertion error in executor management. (GH-143104) 2025-12-23 17:19:34 +00:00
Pablo Galindo Salgado
81c8eb85e1
gh-138122: Add blocking mode for accurate stack traces in Tachyon (#142998) 2025-12-23 10:49:47 +00:00
Pablo Galindo Salgado
9e51301234
gh-138122: Allow tachyon to write and read binary output (#142730) 2025-12-22 23:57:20 +00: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
Sam Gross
e46f28c6af
gh-129069: Fix listobject.c data races due to memmove (gh-142957)
The use of memmove and _Py_memory_repeat were not thread-safe in the
free threading build in some cases. In theory, memmove and
_Py_memory_repeat can copy byte-by-byte instead of pointer-by-pointer,
so concurrent readers could see uninitialized data or tearing.

Additionally, we should be using "release" (or stronger) ordering to be
compliant with the C11 memory model when copying objects within a list.
2025-12-19 18:06:47 -05:00
Sam Gross
08bc03ff2a
gh-120321: Make gi_frame_state transitions atomic in FT build (gh-142599)
This makes generator frame state transitions atomic in the free
threading build, which avoids segfaults when trying to execute
a generator from multiple threads concurrently.

There are still a few operations that aren't thread-safe and may crash
if performed concurrently on the same generator/coroutine:

 * Accessing gi_yieldfrom/cr_await/ag_await
 * Accessing gi_frame/cr_frame/ag_frame
 * Async generator operations
2025-12-19 19:10:37 +00:00
Diego Russo
685272eb8a
JIT: Rename trampoline.c to shim.c (#142974) 2025-12-19 14:39:41 +00:00
Sam Gross
f54d44d333
gh-129068: Make range iterators thread-safe (gh-142886)
Now that we specialize range iteration in the interpreter for the common
case where the iterator has only one reference, there's not a
significant performance cost to making the iteration thread-safe.
2025-12-18 13:11:51 -05:00
Ken Jin
8b64dd853d
gh-139757: Treat call specially in JIT assembly backend optimizer on x86-64 and AArch64 (GH-142907)
Co-authored-by: Savannah Ostrowski <savannah@python.org>
2025-12-17 22:47:47 +00:00
Sam Gross
6e625f87d2
gh-129748: Remove TSan suppression for mi_block_set_nextx (gh-142887)
The function was already changed to use a relaxed atomic store in gh-134238.
2025-12-17 15:27:04 -05:00
Petr Viktorin
7d81eab923
gh-142225: Add PyABIInfo_VAR to to _testcapimodule & _testinternalcapi (GH-142833) 2025-12-17 16:33:09 +01: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
0ac4e6c6cd
gh-134584: Remove custom float decref ops (GH-142576) 2025-12-15 19:38:58 +00:00
Mark Shannon
27a2e49d18
GH-142718: JIT: Fix crash due to incorrect caching on side exits when exiting jitted code. (GH-142762)
JIT: Fix crash due to incorrect caching on side exits when exiting jitted code.

* Make sure that stack is in correct state at side exits with TOS cached values
* Simplify choice of cached items for side exits
2025-12-15 19:01:29 +00:00
Lucas Colley
8bb5b6e8ce
gh-142466: Pixi package definitions for downstream use (#142469)
* WIP: ENH: Pixi package definitions for downstream development

[skip ci]

* linux-64 support

* tidy gitignore

* respond to review
- switch cases on `PYTHON_VARIANT`
- remove `minor_version` by using `python3`
- remove runtime-only asan options

* README updates

* use `.md` to preview rendering

* Apply suggestions from code review

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>

* Apply suggestion from @FFY00

Co-authored-by: Filipe Laíns <filipe.lains@gmail.com>

* Apply suggestion from @FFY00

Co-authored-by: Filipe Laíns <filipe.lains@gmail.com>

* Apply suggestion from @FFY00

Co-authored-by: Filipe Laíns <filipe.lains@gmail.com>

* Apply suggestion from @lucascolley

---------

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Filipe Laíns <filipe.lains@gmail.com>
2025-12-15 15:04:16 +00:00
Savannah Ostrowski
c90863ac3d
GH-141362: Make get_externals handle fetching platform-specific release artifacts (#142405)
Co-authored-by: Steve Dower <steve.dower@microsoft.com>
Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
2025-12-12 21:23:18 +00:00
Mark Shannon
4eab90f4f3
GH-140683: JIT: Improve machine code for loading smaller constants on AArch64. (GH-142511)
* Use movz and movk instructions for loading 16 and 32 bit operands and oparg.
* Loading of 64 bit operands is unchanged.
2025-12-11 12:33:39 +00:00
Mark Shannon
469f191a85
GH-135379: Top of stack caching for the JIT. (GH-135465)
Uses three registers to cache values at the top of the evaluation stack
This significantly reduces memory traffic for smaller, more common uops.
2025-12-11 10:32:52 +00:00
Diego Russo
46295677a1
GH-142305: JIT: Deduplicating GOT symbols in the trace (#142316) 2025-12-10 16:04:04 +00:00
Karolina Surma
c0d0f4b72a
gh-131372: Include LDVERSION and EXE in base_interpreter value (#142256)
* Include LDVERSION and EXE in base_interpreter value

In Fedora, build-details.json created and installed for python3.14t
contains "/usr/bin/python3.14" as the base_interpreter value.
Create a correct string, taking into account both LDVERSION and EXE
config variables, similarly to how it's defined in altbininstall in Makefile.

* Add news

Signed-off-by: Filipe Laíns <lains@riseup.net>

---------

Signed-off-by: Filipe Laíns <lains@riseup.net>
Co-authored-by: Filipe Laíns <lains@riseup.net>
2025-12-10 12:09:41 +00:00
Miro Hrončok
bcf90de8ba
gh-142454: Make the JIT digest more deterministic by sorting the files in Tools/jit (#142455)
Co-authored-by: Ken Jin <kenjin4096@gmail.com>
2025-12-09 17:33:09 +00:00
Stan Ulbrych
719d7960e2
Fix typo in Tools/wasm/README.md (#142426) 2025-12-08 12:48:17 -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