Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-108866: Guarantee forward progress in executors. #113006

Merged
merged 3 commits into from
Dec 12, 2023

Conversation

markshannon
Copy link
Member

@markshannon markshannon commented Dec 12, 2023

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.

@brandtbucher
Copy link
Member

brandtbucher commented Dec 12, 2023

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?)

@markshannon
Copy link
Member Author

markshannon commented Dec 12, 2023

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.

@markshannon
Copy link
Member Author

Reviewed offline.

@markshannon markshannon merged commit 9560238 into python:main Dec 12, 2023
32 checks passed
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants