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-126599: Remove the `PyOptimizer` API by brandtbucher · Pull Request #129194 · python/cpython

Conversation

@brandtbucher

@brandtbucher brandtbucher commented Jan 22, 2025 •
edited by bedevere-app Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

The first commit removes the PyOptimizer API, which also nicely removes the ability to toggle the JIT on or off at runtime. The second commit "specializes" JUMP_BACKWARD so that we don't constantly check whether the JIT is enabled on backedges.

This should be covered by the NEWS entry from GH-126853.

  • Issue: Remove the _PyOptimizer APIs #126599

Sorry, something went wrong.

Uh oh!

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

All reactions
brandtbucher added 2 commits January 21, 2025 19:32
@brandtbucher
Remove the PyOptimizer API
07500fd
@brandtbucher
"Specialize" JUMP_BACKWARD for JIT on/off
085e172
@brandtbucher brandtbucher added skip news interpreter-core (Objects, Python, Grammar, and Parser dirs) topic-JIT labels Jan 22, 2025
@brandtbucher brandtbucher self-assigned this Jan 22, 2025
@brandtbucher
brandtbucher requested review from ericsnowcurrently, markshannon and savannahostrowski as code owners January 22, 2025 19:42
@bedevere-app bedevere-app Bot added the awaiting core review label Jan 22, 2025
@bedevere-app bedevere-app Bot mentioned this pull request Jan 22, 2025
Remove the _PyOptimizer APIs #126599
Closed
@brandtbucher
Emit unused_guard in more places
cb3d982
markshannon
markshannon reviewed Jan 23, 2025
View reviewed changes
Comment thread Python/bytecodes.c Outdated
tier1 op(_SPECIALIZE_JUMP_BACKWARD, (--)) {
#if ENABLE_SPECIALIZATION
if (this_instr->op.code == JUMP_BACKWARD) {
if (tstate->interp->jit) {

@markshannon markshannon Jan 23, 2025

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (tstate->interp->jit) {
this_instr->op.code = (tstate->interp->jit) ? JUMP_BACKWARD_JIT : JUMP_BACKWARD_NO_JIT;

Sorry, something went wrong.

Uh oh!

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

All reactions
markshannon
markshannon reviewed Jan 28, 2025
View reviewed changes

@markshannon markshannon left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.
_SPECIALIZE_JUMP_BACKWARD looks oddly asymmetric, though.

Sorry, something went wrong.

Uh oh!

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

All reactions
brandtbucher added 2 commits January 28, 2025 12:37
@brandtbucher
Remove asymmetry in JUMP_BACKWARD specialization
66d7b56
@brandtbucher
Catch up with main
7fd68c3
@brandtbucher
brandtbucher merged commit 828b276 into python:main Jan 29, 2025
@bedevere-app bedevere-app Bot removed the awaiting core review label Jan 29, 2025
This was referenced Jan 30, 2025
gh-126204: Add a sys._jit_enabled helper #126247
Closed
Add a Py_JIT_ENABLED variable to pyconfig.h #126204
Closed
@AndPuQing AndPuQing mentioned this pull request Jun 17, 2025
test__opcode fails with missing 'jump_backward' in specialization stats #132815
Closed
@efimov-mikhail efimov-mikhail mentioned this pull request Nov 3, 2025
gh-140936: Fix JIT assertion crash at finalization if some generator is alive #140969
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@markshannon markshannon markshannon left review comments
@ericsnowcurrently ericsnowcurrently Awaiting requested review from ericsnowcurrently ericsnowcurrently is a code owner
@savannahostrowski savannahostrowski Awaiting requested review from savannahostrowski

Uh oh!

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

Assignees

@brandtbucher brandtbucher

Labels

interpreter-core (Objects, Python, Grammar, and Parser dirs) skip news topic-JIT

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.

2 participants

@brandtbucher @markshannon
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.