You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add test coverage for interpreter loop generator overridden insts #142913
The interpreter generator has long supported giving it multiple bytecodes files where the latter files override opcodes defined in the earlier opcodes. This enables PEP 523 hook users to generate an interpreter loop using the existing opcodes and their own set of customizations. But there've been no test cases that validate this actually works.
This adds such a test case and fixes things up so this practically works. static functions used directly in the interpreter loop are moved into ceval.h. APIs which are used but not exported are marked as exported.
The newly added test test_replaced_interpreter fails when re-run, like in all refleaks buildbot runs.
$ ./python -m test test_capi -R: -v -m test_replaced_interpreter
== CPython 3.15.0a5+ (heads/main:bb2b9ba49d8, Jan 19 2026, 13:38:43) [GCC 15.2.1 20251211 (Red Hat 15.2.1-5)]
== Linux-6.17.12-300.fc43.x86_64-x86_64-with-glibc2.42 little-endian
== Python build: debug
== cwd: /home/encukou/dev/cpython/build/test_python_worker_3768940æ
== CPU count: 18 (process) / 20 (system)
== encodings: locale=UTF-8 FS=utf-8
== resources: all test resources are disabled, use -u option to unskip tests
Using random seed: 826622625
0:00:00 load avg: 0.42 Run 1 test sequentially in a single process
0:00:00 load avg: 0.42 [1/1] test_capi
beginning 9 repetitions. Showing number of leaks (. for 0 or less, X for 10 or more)
12345:6789
test_replaced_interpreter (test.test_capi.test_misc.Test_Pep523API.test_replaced_interpreter) ... ok
----------------------------------------------------------------------
Ran 1 test in 0.000s
OK
Xtest_replaced_interpreter (test.test_capi.test_misc.Test_Pep523API.test_replaced_interpreter) ... FAIL
======================================================================
FAIL: test_replaced_interpreter (test.test_capi.test_misc.Test_Pep523API.test_replaced_interpreter)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/encukou/dev/cpython/Lib/test/test_capi/test_misc.py", line 2875, in test_replaced_interpreter
self.assertEqual(stats["resumes"], 5)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
AssertionError: 0 != 5
----------------------------------------------------------------------
Ran 1 test in 0.003s
FAILED (failures=1)
test test_capi failed
0:00:00 load avg: 0.42 [1/1/1] test_capi failed (1 failure)
== Tests result: FAILURE ==
1 test failed:
test_capi
Total duration: 179 ms
Total tests: run=1 (filtered) failures=1
Total test files: run=1/1 (filtered) failed=1
Result: FAILURE
Activity
gh-142913: Add test case for interpreter generator w/ overridden opco…
gh-142913: Update generated code that conflicted with other landed c…
gh-142913: Remove JIT interpreter for interpreter generator tests (GH…
gh-142913: Export JIT functions for _testinternalcapi (#143958)
encukou commentedon Jan 19, 2026
The newly added test
test_replaced_interpreterfails when re-run, like in all refleaks buildbot runs.pythongh-142913: Revert adding test_replaced_interpreter
gh-142913: Revert adding test_replaced_interpreter (GH-144110)
encukou commentedon Jan 22, 2026
I've removed the test for now to get the buildbots green again.
pythongh-142913: Add generated test files to gitattributes
gh-142913: Add generated test files to gitattributes (GH-144209)
pythongh-142913: Add test case for interpreter generator w/ overridde…
pythongh-142913: Update generated code that conflicted with other la…
pythongh-142913: Remove JIT interpreter for interpreter generator tes…
pythongh-142913: Export JIT functions for _testinternalcapi (python#1…
pythongh-142913: Revert adding test_replaced_interpreter (pythonGH-14…
pythongh-142913: Add generated test files to gitattributes (pythonGH-…