Skip to content

test__opcode fails with missing 'jump_backward' in specialization stats #132815

Description

@furkanonder

Bug report

Bug description:

When running the test__opcode test with a build that uses --enable-pystats, there is a mismatch between the expected specialized opcodes and the actual ones. The test is expecting jump_backward in the specialized opcodes list, but it's not present in the actual stats.

Configuration

./configure --with-pydebug --enable-pystats

Test Output

╰─$ ./python -m test test__opcode                                                                                                                                                                           82595ms
Using random seed: 2739258338
0:00:00 load avg: 0.97 Run 1 test sequentially in a single process
0:00:00 load avg: 0.97 [1/1] test__opcode
test test__opcode failed -- Traceback (most recent call last):
  File "/home/arf/Desktop/cpython/Lib/test/test__opcode.py", line 131, in test_specialization_stats
    self.assertCountEqual(stats.keys(), specialized_opcodes)
    ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Element counts were not equal:
First has 0, Second has 1:  'jump_backward'

0:00:00 load avg: 0.97 [1/1/1] test__opcode failed (1 failure)

== Tests result: FAILURE ==

1 test failed:
    test__opcode

Total duration: 52 ms
Total tests: run=7 failures=1
Total test files: run=1/1 failed=1
Result: FAILURE

Environment

  • OS: Arch Linux (Linux 6.14.2-arch1-1)

CPython versions tested on:

CPython main branch, 3.14

Operating systems tested on:

Linux

Linked PRs

Activity

  1. added
    testsTests in the Lib/test dir
    type-bugAn unexpected behavior, bug, or error
    3.14bugs and security fixes
    on Apr 22, 2025
  2. furkanonder commented on Apr 22, 2025

    @furkanonder
    ContributorAuthor
  3. AndPuQing commented on Jun 17, 2025

    @AndPuQing
    Contributor

    In my bisect testing, it identified PR #129194 as the source of the issue. This PR added JUMP_BACKWARD to _specializations in Lib/_opcode_metadata.py.

    I've created a fix in PR #135606 to address this problem.

  4. added a commit that references this issue on Jun 17, 2025
  5. added a commit that references this issue on Jun 17, 2025
  6. vstinner commented on Jun 17, 2025

    @vstinner
    Member

    Fixed. Thanks for the bug report.

  7. added a commit that references this issue on Jun 17, 2025
  8. added a commit that references this issue on Jun 19, 2025
  9. added a commit that references this issue on Jul 12, 2025
  10. added a commit that references this issue on Aug 4, 2025
  11. added a commit that references this issue on Aug 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.14bugs and security fixestestsTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions