Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
eb67609
JIT: widen int fast path to full int64 range
KRRT7 May 20, 2026
1181bf0
cleanup
KRRT7 May 25, 2026
8624d26
Fix widened JIT int fast paths
KRRT7 May 25, 2026
91854c2
Add widened JIT int boundary tests
KRRT7 May 25, 2026
e0089f7
Merge branch 'main' into jit-wide-int-fastpath
KRRT7 May 25, 2026
160d3cd
fix failing unit tests
KRRT7 May 26, 2026
32d6758
Merge branch 'main' into jit-wide-int-fastpath
KRRT7 May 28, 2026
a67837c
WIP
KRRT7 May 28, 2026
fd45492
Merge branch 'main' into jit-wide-int-fastpath
KRRT7 May 28, 2026
1d667d4
Update Misc/NEWS.d/next/Core_and_Builtins/2026-05-28-15-00-00.gh-issu…
KRRT7 May 28, 2026
41ad8fb
Update pycore_long.h
KRRT7 May 28, 2026
d549674
Restore compact fast path in _PyCompactLong_{Add,Subtract,Multiply}; …
KRRT7 May 28, 2026
094a60a
Split BINARY_OP_ADD/SUBTRACT/MULTIPLY_INT into compact and wide speci…
KRRT7 May 28, 2026
8769659
Update jit_int_benchmark_pyperf.py
KRRT7 May 29, 2026
7775456
Merge branch 'main' into jit-wide-int-fastpath
KRRT7 May 29, 2026
f206055
fix failing tests
KRRT7 May 29, 2026
39ae2f2
Fix wide int guard range and optimizer facts
KRRT7 May 29, 2026
f35d39b
Rename int64 guard helper and drop simple benchmark
KRRT7 May 29, 2026
4d49566
Separate compact int and int64 optimizer facts
KRRT7 May 29, 2026
e6fd6d8
Merge branch 'main' into jit-wide-int-fastpath
KRRT7 May 29, 2026
d4a355c
tier1-merged tier2-split: single BINARY_OP_ADD_INT with optimizer gua…
KRRT7 May 29, 2026
d608803
Port merged design from explore/merged-on-main
KRRT7 May 29, 2026
5e01840
Fix SUBSCR_LIST_INT/STORE_SUBSCR_LIST_INT asserting on wide ints
KRRT7 May 29, 2026
24a0d2a
Update Include/internal/pycore_long.h
KRRT7 May 29, 2026
a4c0ddb
edit based on feedback
KRRT7 May 29, 2026
c7800d9
Merge branch 'main' into jit-wide-int-fastpath
KRRT7 Jun 8, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix SUBSCR_LIST_INT/STORE_SUBSCR_LIST_INT asserting on wide ints
_GUARD_TOS_INT only checks PyLong_CheckExact, so wide (non-compact)
ints can reach _BINARY_OP_SUBSCR_LIST_INT and _STORE_SUBSCR_LIST_INT,
both of which call _PyLong_CompactValue unconditionally.  The
specializer correctly gates on _PyLong_IsNonNegativeCompact, but the
runtime guard did not enforce that invariant.

Add EXIT_IF / DEOPT_IF(!_PyLong_IsNonNegativeCompact) before each
_PyLong_CompactValue call so wide-int indices fall back to the slow
path instead of hitting the assertion.

The bug was latent before this branch because BINARY_OP_ADD_INT would
deopt on wide-int operands, so wide results rarely appeared as list
subscripts that had already been specialised for compact ints.
  • Loading branch information
KRRT7 committed May 29, 2026
commit 5e018400515a9c2c41a2d4afdc9c908db9211211
10 changes: 10 additions & 0 deletions Modules/_testinternalcapi/test_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Python/bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1135,6 +1135,7 @@ dummy_func(

assert(PyLong_CheckExact(sub));
assert(PyList_CheckExact(list));
EXIT_IF(!_PyLong_IsNonNegativeCompact((PyLongObject *)sub));

Py_ssize_t index = _PyLong_CompactValue((PyLongObject *)sub);
if (index < 0) {
Expand Down Expand Up @@ -1413,6 +1414,7 @@ dummy_func(

assert(PyLong_CheckExact(sub));
assert(PyList_CheckExact(list));
DEOPT_IF(!_PyLong_IsNonNegativeCompact((PyLongObject *)sub));

Py_ssize_t index = _PyLong_CompactValue((PyLongObject *)sub);
DEOPT_IF(!LOCK_OBJECT(list));
Expand Down
15 changes: 15 additions & 0 deletions Python/executor_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions Python/generated_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading