Skip to content

gh-144651: Disable over-aggressive optimization for _GUARD_CODE_VERSION#145923

Open
Fidget-Spinner wants to merge 3 commits intopython:mainfrom
Fidget-Spinner:turn_off_code_opt
Open

gh-144651: Disable over-aggressive optimization for _GUARD_CODE_VERSION#145923
Fidget-Spinner wants to merge 3 commits intopython:mainfrom
Fidget-Spinner:turn_off_code_opt

Conversation

@Fidget-Spinner
Copy link
Member

@Fidget-Spinner Fidget-Spinner commented Mar 13, 2026

We still need the first check in the trace, the subsequent checks can be elided.

For now, let's just restore all checks for correctness reasons. We can come up with a smart way to track whether a code object has been checked in the future.

I don't know how to test this, as any assigning of code object on the function invalidates the function version. We'd need some indirect way of setting the code version?

@Fidget-Spinner
Copy link
Member Author

@markshannon I'm not actually sure this fix is right. It also smells like a possible function version problem in the function object files. Hopefully this helps you/gives you a solid hint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant