Repository navigation
Add test coverage for interpreter loop generator overridden insts #142913
Copy link
Copy link
Closed
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)testsTests in the Lib/test dirTests in the Lib/test dirtype-featureA feature request or enhancementA feature request or enhancement
Description
Activity
- linked a pull request that will close this issuegh-142913: Add test case for interpreter generator w/ overridden opcodes #142911
on Dec 18, 2025 - addedtype-featureA feature request or enhancementA feature request or enhancementtestsTests in the Lib/test dirTests in the Lib/test dirinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)and removed3.15bugs and security fixesbugs and security fixes
on Dec 18, 2025 - added a commit that references this issue
on Jan 16, 2026 - added a commit that references this issue
on Jan 16, 2026 The newly added test
test_replaced_interpreterfails 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: FAILUREI've removed the test for now to get the buildbots green again.
- added a commit that references this issue
on Jan 24, 2026 - added 6 commits that reference this issue
on Feb 15, 2026
Metadata
Metadata
Assignees
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)testsTests in the Lib/test dirTests in the Lib/test dirtype-featureA feature request or enhancementA feature request or enhancement
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.
Linked PRs
_testinternalcapibuild failure due to undefined JIT symbols #143949