-
-
Notifications
You must be signed in to change notification settings - Fork 29.3k
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-117457: Correct pystats uop "miss" counts #117477
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Do you have an example of the new stats?
I'll run the whole thing on our infra (just to confirm it works there) and then post here. |
I now get a complaint regarding generated files on my PRs. Did you forget to Here's what I get if I do diff --git a/Python/executor_cases.c.h b/Python/executor_cases.c.h
index 9c6e42a1a8..a3447da004 100644
--- a/Python/executor_cases.c.h
+++ b/Python/executor_cases.c.h
@@ -3984,8 +3984,14 @@
case _CHECK_STACK_SPACE_OPERAND: {
uint32_t framesize = (uint32_t)CURRENT_OPERAND();
assert(framesize <= INT_MAX);
- if (!_PyThreadState_HasStackSpace(tstate, framesize)) JUMP_TO_JUMP_TARGET();
- if (tstate->py_recursion_remaining <= 1) JUMP_TO_JUMP_TARGET();
+ if (!_PyThreadState_HasStackSpace(tstate, framesize)) {
+ UOP_STAT_INC(uopcode, miss);
+ JUMP_TO_JUMP_TARGET();
+ }
+ if (tstate->py_recursion_remaining <= 1) {
+ UOP_STAT_INC(uopcode, miss);
+ JUMP_TO_JUMP_TARGET();
+ }
break;
}
PR: |
I'm surprised this didn't fail a CI test. |
Yes. IIRC, similar things have happened before, and I think we have an open issue for it. |
I imagine it's something that falls through the cracks between a new opcode being added, and the merge conflict detection not picking that up in this PR. |
Yeah, probably the CI for this PR ran on an older merge commit, then somebody pushed something that didn't conflict at the source level but changes after regen. (Exactly the sort of thing merge queues are meant to solve!) Thanks for the fix! |
These were "broken" after trace stitching because only "_DEOPT" and "_SIDE_EXIT" opcodes were being counted, rather than the instruction that jumped there.