summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* gh-131998: Fix `NULL` dereference when using an unbound method descriptor in ↵Peter Bierma2025-04-083-0/+26
| | | | | | | | a specialized code path (#132000) Co-authored-by: sobolevn <mail@sobolevn.me> Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Mark Shannon <mark@hotpy.org>
* gh-100239: more stats for BINARY_OP/SUBSCR specialization (#132230)Irit Katriel2025-04-081-0/+30
|
* gh-130775: Allow negative locations in `ast` (#130795)sobolevn2025-04-071-5/+2
| | | Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-131591: Handle includes for iOS in remote_debugging.c (#132050)Pablo Galindo Salgado2025-04-061-20/+13
|
* gh-132011: Fix crash on invalid `CALL_LIST_APPEND` deoptimization (#132018)sobolevn2025-04-063-3/+10
| | | | Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
* GH-131798: Narrow the result of _CONTAINS_OP_SET to bool in the JIT (GH-132057)Tomas R.2025-04-052-3/+7
|
* gh-109599: Expose `CapsuleType` via the `_types` module (#131969)Adam Turner2025-04-041-0/+1
|
* gh-100239: fix bug in comparison (#132093)Irit Katriel2025-04-041-2/+2
|
* gh-99108: Implement HACL* HMAC (#130157)Bénédikt Tran2025-04-041-0/+1
| | | | | | | A new extension module, `_hmac`, now exposes the HACL* HMAC (formally verified) implementation. The HACL* implementation is used as a fallback implementation when the OpenSSL implementation of HMAC is not available or disabled. For now, only named hash algorithms are recognized and SIMD support provided by HACL* for the BLAKE2 hash functions is not yet used.
* GH-131498: Cases generator: manage stacks automatically (GH-132074)Mark Shannon2025-04-047-181/+125
|
* gh-100239: more refined specialisation stats for BINARY_OP/SUBSCR (#132068)Irit Katriel2025-04-041-0/+35
|
* gh-130115: fix thread identifiers for 32-bit musl (#130391)Vincent Fazio2025-04-041-9/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | CPython's pthread-based thread identifier relies on pthread_t being able to be represented as an unsigned integer type. This is true in most Linux libc implementations where it's defined as an unsigned long, however musl typedefs it as a struct *. If the pointer has the high bit set and is cast to PyThread_ident_t, the resultant value can be sign-extended [0]. This can cause issues when comparing against threading._MainThread's identifier. The main thread's identifier value is retrieved via _get_main_thread_ident which is backed by an unsigned long which truncates sign extended bits. >>> hex(threading.main_thread().ident) '0xb6f33f3c' >>> hex(threading.current_thread().ident) '0xffffffffb6f33f3c' Work around this by conditionally compiling in some code for non-glibc based Linux platforms that are at risk of sign-extension to return a PyLong based on the main thread's unsigned long thread identifier if the current thread is the main thread. [0]: https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/Arrays-and-pointers-implementation.html --------- Signed-off-by: Vincent Fazio <vfazio@gmail.com>
* gh-128632: fix segfault on nested __classdict__ type param (#128744)Tomasz Pytel2025-04-042-13/+27
|
* gh-125434: Display thread name in faulthandler (#132016)Victor Stinner2025-04-041-1/+22
|
* GH-131770: increase assumed WASI stack size to 131072 (wasi-sdk default) ↵Filipe Laíns 🇵🇸2025-04-041-1/+1
| | | | | | | (#131844) https://github.com/WebAssembly/wasi-libc/blob/e9524a0980b9bb6bb92e87a41ed1055bdda5bb86/libc-top-half/musl/src/internal/pthread_impl.h#L220 Signed-off-by: Filipe Laíns <lains@riseup.net>
* gh-131591: Implement PEP 768 (#131937)Pablo Galindo Salgado2025-04-035-1/+1329
| | | | Co-authored-by: Ivona Stojanovic <stojanovic.i@hotmail.com> Co-authored-by: Matt Wozniski <godlygeek@gmail.com>
* GH-131904: Fix Py_STACKREF_DEBUG build (GH-132022)Mark Shannon2025-04-031-2/+8
|
* gh-118761: Optimise import time for ast (#131953)Adam Turner2025-04-021-0/+1
|
* GH-131498: Cases generator: Parse down to C statement level. (GH-131948)Mark Shannon2025-04-025-582/+131
| | | | | * Parse down to statement level in the cases generator * Add handling for #if macros, treating them much like normal ifs.
* gh-132002: Fix crash of `ContextVar` on unhashable `str` subtype (#132003)sobolevn2025-04-021-7/+6
|
* GH-131726: Split up _CHECK_VALIDITY_AND_SET_IP (GH-131810)Brandt Bucher2025-04-015-43/+7
|
* GH-131798: Allow the JIT to remove more int/float/str guards (GH-131800)Brandt Bucher2025-04-015-465/+504
|
* gh-130704: Strength reduce `LOAD_FAST{_LOAD_FAST}` (#130708)mpage2025-04-019-32/+637
| | | Optimize `LOAD_FAST` opcodes into faster versions that load borrowed references onto the operand stack when we can prove that the lifetime of the local outlives the lifetime of the temporary that is loaded onto the stack.
* gh-111178: remove redundant casts for functions with correct signatures ↵Bénédikt Tran2025-04-011-1/+1
| | | | (#131673)
* GH-131296: Add missing UNREACHABLE mark in thread_nt.h (GH-131589)Chris Eibl2025-03-311-0/+1
|
* Fix PEP number in `ast_opt.c` for new `finally` check (#131928)sobolevn2025-03-311-1/+1
|
* GH-131498: Another refactoring of the code generator (GH-131827)Mark Shannon2025-03-312-7/+7
| | | | | | | | | | | | * Rename 'defined' attribute to 'in_local' to more accurately reflect how it is used * Make death of variables explicit even for array variables. * Convert in_memory from boolean to stack offset * Don't apply liveness analyis to optimizer generated code * Add 'out' parameter to stack.pop
* GH-131798: Remove type checks for _TO_BOOL_STR (GH-131816)Amit Lavon2025-03-305-27/+63
|
* gh-130924: Do not create cells for usages of names in local annotations ↵Jelle Zijlstra2025-03-291-12/+24
| | | | (#131843)
* gh-131740: minor readability fix in PyUnstable_GC_VisitObjects (gh-131786)Martin DeMello2025-03-281-5/+5
| | | | | | | | | Minor readability fix in PyUnstable_GC_VisitObjects Replaces `if (visit_generation())` with `if (visit_generation() < 0)`, since we are checking for the failure case, and it's confusing to have that be implicitly `true`. Also fixes a misspelt variable name.
* gh-130373: Avoid locking in _LOAD_ATTR_WITH_HINT (#130372)Dino Viehland2025-03-284-41/+57
| | | Avoid locking in _LOAD_ATTR_WITH_HINT
* gh-131738: optimize builtin any/all/tuple calls with a generator expression ↵Irit Katriel2025-03-285-33/+119
| | | | arg (#131737)
* gh-131818: Add imply `-P` in `-I`'s help message (#131819)Hang2025-03-281-1/+1
|
* GH-130415: Remove redundant sym_matches_type calls in the JIT optimizer ↵Brandt Bucher2025-03-272-48/+26
| | | | (GH-131778)
* gh-131525: Cache the result of tuple_hash (#131529)Michael Droettboom2025-03-279-11/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * gh-131525: Cache the result of tuple_hash * Fix debug builds * Add blurb * Fix formatting * Pre-compute empty tuple singleton * Mostly set the cache within tuple_alloc * Fixes for TSAN * Pre-compute empty tuple singleton * Fix for 32-bit platforms * Assert that op != NULL in _PyTuple_RESET_HASH_CACHE * Use FT_ATOMIC_STORE_SSIZE_RELAXED macro * Update Include/internal/pycore_tuple.h Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> * Fix alignment * atomic load * Update Objects/tupleobject.c Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com> --------- Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
* GH-131729: Consider in-memory state when merging storage and stack (GH-131773)Mark Shannon2025-03-272-0/+3
|
* gh-131763: Replace the redundant check with assert in remove_tools (#131765)Sergey Muraviov2025-03-261-2/+3
|
* gh-131586: Avoid refcount contention in some "special" calls (#131588)Sam Gross2025-03-262-15/+18
| | | | | | | | | | In the free threaded build, the `_PyObject_LookupSpecial()` call can lead to reference count contention on the returned function object becuase it doesn't use stackrefs. Refactor some of the callers to use `_PyObject_MaybeCallSpecialNoArgs`, which uses stackrefs internally. This fixes the scaling bottleneck in the "lookup_special" microbenchmark in `ftscalingbench.py`. However, the are still some uses of `_PyObject_LookupSpecial()` that need to be addressed in future PRs.
* gh-123358: Use `_PyStackRef` in `LOAD_DEREF` (gh-130064)Sam Gross2025-03-263-9/+16
| | | | | | | | | | | | Concurrent accesses from multiple threads to the same `cell` object did not scale well in the free-threaded build. Use `_PyStackRef` and optimistically avoid locking to improve scaling. With the locks around cell reads gone, some of the free threading tests were prone to starvation: the readers were able to run in a tight loop and the writer threads weren't scheduled frequently enough to make timely progress. Adjust the tests to avoid this. Co-authored-by: Donghee Na <donghee.na@python.org>
* GH-131729: Code-gen better liveness analysis (GH-131732)Mark Shannon2025-03-265-233/+126
| | | | | | | | | | | | * Rename 'defined' attribute to 'in_local' to more accurately reflect how it is used * Make death of variables explicit even for array variables. * Convert in_memory from boolean to stack offset * Don't apply liveness analysis to optimizer generated code * Fix RETURN_VALUE in optimizer
* gh-130881: Handle conditionally defined annotations (#130935)Jelle Zijlstra2025-03-263-69/+285
|
* gh-131740: Update PyUnstable_GC_VisitObjects to traverse perm gen (gh-131744)Donghee Na2025-03-261-1/+4
|
* gh-131670: Fix crash in `anext()` when `__anext__` is sync and raises (#131682)sobolevn2025-03-241-0/+3
| | | Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* gh-128421: Avoid TSAN warnings in `sys._current_frames()` (gh-131548)Sam Gross2025-03-241-1/+3
| | | | | | | | | | | | This tells TSAN not to sanitize `PyUnstable_InterpreterFrame_GetLine()`. There's a possible data race on the access to the frame's `instr_ptr` if the frame is currently executing. We don't really care about the race. In theory, we could use relaxed atomics for every access to `instr_ptr`, but that would create more code churn and current compilers are overly conservative with optimizations around relaxed atomic accesses. We also don't sanitize `_PyFrame_IsIncomplete()` because it accesses `instr_ptr` and is called from assertions within PyFrame_GetCode().
* gh-111178: fix UBSan failures for `Python/legacy_tracing.c` (#131611)Bénédikt Tran2025-03-241-29/+38
|
* gh-111178: fix UBSan failures for `Python/instrumentation.c` (#131608)Bénédikt Tran2025-03-241-10/+18
|
* gh-111178: fix UBSan failures for `_PyExecutorObject` (#131610)Bénédikt Tran2025-03-241-15/+21
|
* gh-130080: do not fold match case constants in unoptimized AST (#131577)Irit Katriel2025-03-231-0/+3
|
* gh-131296: fix clang-cl warning in tracemalloc.c (#131514)Victor Stinner2025-03-221-6/+3
| | | | | Always set MAX_NFRAME to UINT16_MAX. Avoid the complicated code which emitted a compiler warning.
* gh-131238: Add missing pycore_function.h includes for JIT compiler (#131571)Victor Stinner2025-03-212-0/+2
|