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-109369: Exit tier 2 if executor is invalid #111657

Merged
merged 11 commits into from
Nov 9, 2023

Conversation

markshannon
Copy link
Member

@markshannon markshannon commented Nov 2, 2023

Fixes GH-109369.
Adds a _CHECK_VALIDITY uop which is inserted after any escaping operations.
Ensures that uop traces will be exited promptly if the code is instrumented.

@markshannon markshannon marked this pull request as ready for review November 6, 2023 14:36
Python/optimizer.c Outdated Show resolved Hide resolved
Tools/cases_generator/flags.py Show resolved Hide resolved
markshannon and others added 2 commits November 8, 2023 12:28
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
@brandtbucher
Copy link
Member

So, on the JIT branch, we don't actually keep the executor handy when executing instructions (only when entering/exiting traces). I'm guessing we'll need it a lot more in the future once we start doing stitching and such, but I wonder: can we just stick it on the tstate or the frame? It feels a bit painful to dedicate a register to this thing, especially since it'll be hardly used in optimized traces (I think).

Not a big deal though, and can be deferred to a later date. Just something to ponder, or to do if it's easy now.

@brandtbucher
Copy link
Member

brandtbucher commented Nov 8, 2023

Idea: put the executor's address in _CHECK_VALIDITY's operand? Then the JIT would require no modifications to support this change.

@brandtbucher
Copy link
Member

Ah, never mind, the JIT can burn in the executor. I withdraw my comments. :)

@markshannon markshannon merged commit 25c4956 into python:main Nov 9, 2023
29 checks passed
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
@markshannon markshannon deleted the exit-if-invalid 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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Executors might ignore instrumentation.
3 participants