Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

GH-135904: Add tests for the JIT build process#136766

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
brandtbucher wants to merge12 commits intopython:main
base:main
Choose a base branch
Loading
frombrandtbucher:jit-tests

Conversation

brandtbucher
Copy link
Member

@brandtbucherbrandtbucher commentedJul 18, 2025
edited by bedevere-appbot
Loading

This is overdue, but it's especially valuable now that we're doing more subtle transformations on the machine code at JIT build time. This has a number of benefits:

  • When we add a new optimization at this level, we can directly see the impact on example code in the PR diff. And if it doesn't show up, we can add a test for it.
  • It gives us visibility into the quality of the generated code (without having the full stencils checked in yet). For example, making this PR helped me realize that there are three obvious quality issues on platforms I don't look at much:
    • On some platforms, system headers were putting unused writable data in our read-only data stencils. This is both wrong and wasteful. I fixed this issue as part of this PR (we just optimistically remove this data, and raise if it's actually used).
    • The JIT still inserts frame pointer pushes/pops on Intel-based Macs. I'll fix this in a follow-up PR.
    • LLVM has a bug that inserts unnecessary spills and reloads of C local variables on 32-bit Windows at the beginning and end of every stencil. I've filed an issue upstream:musttail generates redundant moves on 32-bit platforms llvm/llvm-project#147813

The new test is inLib/test/test_jit_stencils.py. This test usesTools/jit/test/test_executor_cases.c.h to generate a few small test stencils, and compares them to the expected output in the correspondingTools/jit/test/test_jit_stencils-*.h file.

Most of the changes inTools/jit/_targets.py are just cleanup to make the generated stencils simpler and more consistent, or to fix the writable-data bug I mentioned above.

@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by@brandtbucher for commit867a686 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F136766%2Fmerge

If you want to schedule another build, you need to add the🔨 test-with-buildbots label again.

@bedevere-botbedevere-bot removed the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelJul 18, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@savannahostrowskisavannahostrowskiAwaiting requested review from savannahostrowskisavannahostrowski is a code owner

@diegorussodiegorussoAwaiting requested review from diegorussodiegorusso is a code owner

Assignees

@brandtbucherbrandtbucher

Labels
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@brandtbucher@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp