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 — gh-143158: Hot cold code splitting for JIT compiler by waterlens · Pull Request #149292 · python/cpython

Conversation

@waterlens

@waterlens waterlens commented May 2, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Issue: gh-143158

This PR implements trace-level hot/cold code splitting for the JIT.

Previously, each uop stencil was emitted as one contiguous code block, so hot fast-path code and rarely executed cold/error-path code were interleaved
throughout the compiled trace:

[uop0 hot+cold][uop1 hot+cold][uop2 hot+cold]...

This change separates each stencil into hot and cold code and emits the trace as:

[uop0 hot][uop1 hot][uop2 hot]...[uop0 cold][uop1 cold][uop2 cold]...

Plan:

  • Move cold code after _JIT_CONTINUE and introduce _JIT_COLD_START for positioning.
  • Split cold / hot code when emitting stencils

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-app

bedevere-app Bot commented May 2, 2026

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@python-cla-bot

python-cla-bot Bot commented May 2, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot mentioned this pull request May 2, 2026
Hot-cold splitting for JIT stencils #143158
Open
@read-the-docs-community

read-the-docs-community Bot commented May 2, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #32638145 | 📁 Comparing d6ce2a1 against main (3a1df78)

  🔍 Preview build  

79 files changed · ± 78 modified · - 1 deleted

± Modified

  • c-api/buffer.html
  • c-api/code.html
  • c-api/concrete.html
  • c-api/descriptor.html
  • c-api/exceptions.html
  • c-api/gen.html
  • c-api/intro.html
  • c-api/perfmaps.html
  • c-api/set.html
  • c-api/typeobj.html
  • and 68 more...

- Deleted

  • c-api/sentinel.html
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app

bedevere-app Bot commented May 11, 2026

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@waterlens
waterlens force-pushed the hot-cold-splitting branch from d6ce2a1 to c180cc0 Compare May 11, 2026 15:31
@bedevere-app

bedevere-app Bot commented May 11, 2026

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

waterlens added 2 commits May 18, 2026 22:40
@waterlens
Move cold code after _JIT_CONTINUE
d2da9a5
@waterlens
Split JIT stencils into hot and cold code
f56e969
@waterlens
waterlens force-pushed the hot-cold-splitting branch from c180cc0 to f56e969 Compare May 18, 2026 14:40
@bedevere-app

bedevere-app Bot commented May 18, 2026

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@waterlens
Fix some issues
a20783f
`replace` didn't preserve relocation;
root block should be at the start of the block list;
fix the pc-relative addressing of branching between hot and cold sections
@bedevere-app

bedevere-app Bot commented May 18, 2026

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@waterlens
Preserve block order before _JIT_ENTRY
b618909
@bedevere-app

bedevere-app Bot commented May 19, 2026

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@waterlens
Reformat changed files
5a395d2
@bedevere-app

bedevere-app Bot commented May 19, 2026

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@waterlens

waterlens commented May 19, 2026

Copy link
Copy Markdown
Author

@Fidget-Spinner would you mind helping me mark this PR with skip news? I think there is no news for JIT internals changes.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@eendebakpt eendebakpt added the skip news label May 19, 2026
@waterlens
Clarify hot/cold JIT relocation handling
93c2179
@waterlens
waterlens marked this pull request as ready for review May 23, 2026 04:44
@waterlens
waterlens requested review from brandtbucher, diegorusso and savannahostrowski as code owners May 23, 2026 04:44
@bedevere-app bedevere-app Bot added the awaiting review label May 23, 2026
@markshannon

markshannon commented May 26, 2026

Copy link
Copy Markdown
Member

I think we need to do hot/cold splitting in the code generator.
#143158 (comment)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown

This PR is stale because it has been open for 90 days with no activity.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@brandtbucher brandtbucher Awaiting requested review from brandtbucher brandtbucher is a code owner
@savannahostrowski savannahostrowski Awaiting requested review from savannahostrowski
@diegorusso diegorusso Awaiting requested review from diegorusso diegorusso is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

awaiting review skip news stale Stale PR or inactive for long period of time.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@waterlens @markshannon @eendebakpt
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.