GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||
GeezerVison is showing github.com — gh-133273: Keep instruction definitions in `bytecodes.c` and `optimizer_bytecodes.c` in sync by tomasr8 · Pull Request #133320 · python/cpython Conversation
|
|
Thanks! Personally, I'm not sure that requiring the names to be in sync gains us anything. What's really useful is making sure that the stack effects are the same; if not, it's a serious bug in the optimizer. Making the names match just sort of creates busywork for anyone adding new optimizer cases. And I think it's totally normal for something that's used in the bytecodes to be unused in the optimizer, and vice-versa. So I'd rather just have a special case for when one is I'll wait for others to chime in, though. It's not a huge deal. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| (void)counter; | ||
| } | ||
|
|
||
| op(_UNPACK_SEQUENCE, (seq -- unused[oparg], top[0])) { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to tell the validator that unused matches anything (both ways)?
So unused in optimizer_bytecodes/bytecodes isn't name-validated.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I agree on the unused part (see the comment above), but I think having names matching is useful, if just for the sake of standardization. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Thanks for the feedback! I updated the PR:
Thanks to special-casing I also added (I'll wait for the CI to pass and then mark it as ready) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| } | ||
|
|
||
| op(_CREATE_INIT_FRAME, (self, init, args[oparg] -- init_frame: _Py_UOpsAbstractFrame *)) { | ||
| op(_CREATE_INIT_FRAME, (init, self, args[oparg] -- init_frame: _Py_UOpsAbstractFrame *)) { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Looks like we found one case where checking the name is useful
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Awesome. This is exactly what we need this for!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I plan to merge this after 3.14 beta 1 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
(fixed a conflict) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@brandtbucher merging this in the next 24 hours. Watch out for merge conflicts! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…ptimizer_bytecodes.c` in sync (pythonGH-133320)
…ptimizer_bytecodes.c` in sync (pythonGH-133320)
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.