gh-144145: Track nullness of properties in the Tier 2 JIT optimizer#144122
gh-144145: Track nullness of properties in the Tier 2 JIT optimizer#144122Fidget-Spinner merged 20 commits into
Conversation
|
This PR seems unrelated to the issue. It tracks the internal state of objects, not the uniqueness of references. Tracking the internal state of objects is tricky, as we need to keep track of where code might escape and invalidate any knowledge prior to the escape. So far, we have only tracked properties of stateless objects, so it isn't an issue. In future, I would also advise waiting to see if there is general support on the issue before spending time on the implementation. |
Sorry, something went wrong.
|
Thanks for reply!
Sorry, I'm linking to this issue because I discussed the implementation logic with @Fidget-Spinner in this issue, and I think this should be a pre-task for unique reference tracking (if I'm wrong, please point it out, thanks!). I'll create a new issue to link to this PR.
Sorry again for overlooking object escape. I think may be Ken Jin's original requirement was just to add tracking for the Slots object(if I'm wrong, please point it out again, thanks!). Perhaps I should remove the optimization in the
Thanks for the reminder. I'll be more careful in the future. |
Sorry, something went wrong.
__slots__ object property tracking for the Tier 2 JIT optimizer
Yeah we need to track for escapes. I mentioned it here how to do it #143414 (comment). It got lost in the noise though, so no worries.
I advised @cocolato to embark on this issue. I think there is value in doing it. They waited for me to give my go-ahead before doing it. So I think they didn't do anything wrong. |
Sorry, something went wrong.
|
@Fidget-Spinner Hi, one thing i want to know. Should this PR flag which property escape during escape handling UOPs (e.g. |
Sorry, something went wrong.
|
Sorry I'm busy for these 2 days. I'll try to review on Saturday. If Mark reviews it earlier, we can go with his ideas. |
Sorry, something went wrong.
No. The problem is any uop that escapes must be handled. For example, anything with |
Sorry, something went wrong.
|
Updated, added |
Sorry, something went wrong.
|
Cool, this LGTM now I think. This deserves a news entry. Potentially call it: I know it's not just nullness, but in all practicality due to the escapes, it's just nullness for now. |
Sorry, something went wrong.
Fidget-Spinner
left a comment
There was a problem hiding this comment.
Thanks
Sorry, something went wrong.
1dc12b2
into
python:main
Jan 30, 2026
|
Thanks! Do you want to handle STORE_ATTR_WITH_HINT Too? |
Sorry, something went wrong.
Sure, I will work on it :) |
Sorry, something went wrong.
|
@Fidget-Spinner I noticed a slight decrease in JIT performance yesterday: https://doesjitgobrrr.com, which seems related to this PR. Should we look into it? |
Sorry, something went wrong.
|
@cocolato I suggest waiting for one more day. If it's real, please investigate. Thank you! |
Sorry, something went wrong.
|
I'm going to have to ask for this PR to be reverted, because:
We also need to decide whether we want to track whether execution has escaped. |
Sorry, something went wrong.
…IT optimizer (pythonGH-144122)" This reverts commit 1dc12b2.
|
Sorry about that, revert it by #144391. I will do some more safe changes in the future. |
Sorry, something went wrong.
|
Don't worry. Occasionally things need to be reverted. I think something like this is worth doing, but we should discuss it a bit more on the issue first. |
Sorry, something went wrong.
…pythonGH-144391) Revert "pythongh-144145: Track nullness of properties in the Tier 2 JIT optimizer (pythonGH-144122)" This reverts commit 1dc12b2.
…pythonGH-144391) Revert "pythongh-144145: Track nullness of properties in the Tier 2 JIT optimizer (pythonGH-144122)" This reverts commit 1dc12b2.
This PR implements symbolic tracking for
__slots__object attributes in the Tier 2 JIT optimizer.Currently, when the JIT optimizer encounters
_LOAD_ATTR_SLOT, it creates a new unknown symbol (<!NULL>) even if the same slot was previously written in the same trace. This prevents the optimizer from:Before(set PYTHON_OPT_DEBUG=5):
Now:
__slots__object and its property in the Tier 2 optimizer #144145