GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add test coverage for interpreter loop generator overridden insts · Issue #142913 · python/cpython

Add test coverage for interpreter loop generator overridden insts #142913

New issue
Copy link
New issue
Copy link
Closed
#142911
Closed
Add test coverage for interpreter loop generator overridden insts#142913
#142911
Copy link
Assignees
DinoV
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

@DinoV
DinoV
opened on Dec 18, 2025
Issue body actions

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

  • gh-142913: Add test case for interpreter generator w/ overridden opcodes #142911
  • gh-142913: Update generated code that conflicted with other landed change #143932
  • gh-142913: Remove JIT interpreter for interpreter generator tests #143944
  • gh-142913: fix _testinternalcapi build failure due to undefined JIT symbols #143949
  • gh-142913: Export JIT functions for _testinternalcapi #143958
  • gh-142913: Revert adding test_replaced_interpreter #144110
  • gh-142913: Add generated test files to gitattributes #144209
Reacted by Raymond Hettinger

Activity

  1. DinoV
    self-assigned this
    on Dec 18, 2025
  2. DinoV
    added
    3.15bugs and security fixesbugs and security fixes
    on Dec 18, 2025
  3. DinoV
    linked a pull request that will close this issuegh-142913: Add test case for interpreter generator w/ overridden opcodes #142911on Dec 18, 2025
  4. picnixz
    added
    type-featureA feature request or enhancementA feature request or enhancement
    testsTests in the Lib/test dirTests in the Lib/test dir
    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
    and removed
    3.15bugs and security fixesbugs and security fixes
    on Dec 18, 2025
  5. DinoV
    added a commit that references this issue on Jan 16, 2026

    gh-142913: Add test case for interpreter generator w/ overridden opco…

    4d5a676
  6. DinoV
    closed this as completedin #142911on Jan 16, 2026
  7. DinoV
    added a commit that references this issue on Jan 16, 2026

    gh-142913: Update generated code that conflicted with other landed c…

    5996636
  8. Fidget-Spinner
    added 2 commits that reference this issue on Jan 17, 2026

    gh-142913: Remove JIT interpreter for interpreter generator tests (GH…

    949b5ec

    gh-142913: Export JIT functions for _testinternalcapi (#143958)

    7e28ae5
  9. encukou commented on Jan 19, 2026

    @encukou
    encukou
    on Jan 19, 2026
    Member
    More actions

    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
    
  10. encukou
    reopened this on Jan 19, 2026
  11. encukou
    added 2 commits that reference this issue on Jan 21, 2026

    pythongh-142913: Revert adding test_replaced_interpreter

    deb66d5

    gh-142913: Revert adding test_replaced_interpreter (GH-144110)

    3e66171
  12. encukou commented on Jan 22, 2026

    @encukou
    encukou
    on Jan 22, 2026
    Member
    More actions

    I've removed the test for now to get the buildbots green again.

  13. cdce8p
    added a commit that references this issue on Jan 24, 2026

    pythongh-142913: Add generated test files to gitattributes

    59bad5a
  14. Fidget-Spinner
    added a commit that references this issue on Jan 24, 2026

    gh-142913: Add generated test files to gitattributes (GH-144209)

    5f736a0
  15. DinoV
    closed this as completedon Feb 7, 2026
  16. thunder-coding
    added 6 commits that reference this issue on Feb 15, 2026

    pythongh-142913: Add test case for interpreter generator w/ overridde…

    0efcab0

    pythongh-142913: Update generated code that conflicted with other la…

    6098fb0

    pythongh-142913: Remove JIT interpreter for interpreter generator tes…

    2e06a2a

    pythongh-142913: Export JIT functions for _testinternalcapi (python#1…

    785ab8f

    pythongh-142913: Revert adding test_replaced_interpreter (pythonGH-14…

    707d3e6

    pythongh-142913: Add generated test files to gitattributes (pythonGH-…

    35f0b50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @DinoV
    DinoV

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

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.