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-108866: Guarantee forward progress in executors. by markshannon · Pull Request #113006 · python/cpython

Conversation

@markshannon

@markshannon markshannon commented Dec 12, 2023 •
edited by bedevere-app Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Changes the return value of executor functions, so that the next instruction can be a branch target.
Starts the optimizer at the target of the jump when optimizing from back edges to guarantee forward progress.

This simplifies ENTER_EXECUTOR a bit, as we can now rely on the executor to make forward progress.

  • Issue: We need to change the contract and interface of _PyExecutorObject and _PyOptimizerObject #108866

Sorry, something went wrong.

Uh oh!

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

All reactions
markshannon added 3 commits December 12, 2023 04:46
@markshannon
Change return value of executor function to _Py_CODEUNIT and guarante…
30bade1
…e forward progress.
@markshannon
Add news
fd58cce
@markshannon
Update frame when returning from custom executor
6cbaa9b
@markshannon
markshannon requested a review from gvanrossum as a code owner December 12, 2023 12:11
@bedevere-app bedevere-app Bot added the awaiting core review label Dec 12, 2023
@bedevere-app bedevere-app Bot mentioned this pull request Dec 12, 2023
We need to change the contract and interface of _PyExecutorObject and _PyOptimizerObject #108866
Closed
@markshannon markshannon added skip news and removed skip news labels Dec 12, 2023
@Eclips4 Eclips4 added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Dec 12, 2023
@brandtbucher

brandtbucher commented Dec 12, 2023 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Hm, I'm a bit confused. Does this mean that an executor can never stop executing in a frame other than the one it started in? That seems like a big step backward if so, since it means that we can't have specialized instructions in inlined calls...

(If this isn't intended, maybe you're just missing a frame = tstate->current_frame and locals reload?)

All reactions

Sorry, something went wrong.

Uh oh!

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

@markshannon

markshannon commented Dec 12, 2023 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member Author

Just missing frame = tstate->current_frame. And a test for it. It is basically impossible to test for, as that path is only hit for custom optimizers.

All reactions

Sorry, something went wrong.

Uh oh!

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

@markshannon

markshannon commented Dec 12, 2023

Copy link
Copy Markdown
Member Author

Reviewed offline.

All reactions

Sorry, something went wrong.

Uh oh!

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

@markshannon
markshannon merged commit 9560238 into python:main Dec 12, 2023
@bedevere-app bedevere-app Bot removed the awaiting core review label Dec 12, 2023
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
@markshannon @aisk
pythonGH-108866: Guarantee forward progress in executors. (pythonGH-1…
85397f7
…13006)
@markshannon
markshannon deleted the executor-forward-progress branch August 6, 2024 10:18
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
@markshannon @Glyphack
pythonGH-108866: Guarantee forward progress in executors. (pythonGH-1…
6caea92
…13006)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@gvanrossum gvanrossum Awaiting requested review from gvanrossum

Uh oh!

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

Assignees

No one assigned

Labels

interpreter-core (Objects, Python, Grammar, and Parser dirs)

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

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