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
Test failures when running with Tier 2 enabled #113657
Comments
e96f260 is the first bad commit. Cc: @markshannon |
This is blocking JIT stuff too: #113465 (comment) I’ll see if I can figure out what’s causing it today. |
It appears that exceptions aren't being caught by some |
Minimal reproducer (needs tier two enabled): >>> for _ in range(18):
... try:
... 0 / 0
... except:
... pass
...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
for _ in range(18):
^
ZeroDivisionError: division by zero Note that the line shown in the traceback is wrong, supporting the idea that the instruction pointer is off (which is why the exception isn't getting caught). |
Here is the
It looks like we're missing a |
Found it. This fixes things: diff --git a/Python/optimizer_analysis.c b/Python/optimizer_analysis.c
index 8b471d70a1..52d0217a7a 100644
--- a/Python/optimizer_analysis.c
+++ b/Python/optimizer_analysis.c
@@ -4,6 +4,7 @@
#include "pycore_opcode_metadata.h"
#include "pycore_opcode_utils.h"
#include "pycore_pystate.h" // _PyInterpreterState_GET()
+#include "pycore_uop_metadata.h"
#include "pycore_uops.h"
#include "pycore_long.h"
#include "cpython/optimizer.h"
@@ -35,13 +36,13 @@ remove_unneeded_uops(_PyUOpInstruction *buffer, int buffer_size)
break;
}
else {
- if (OPCODE_HAS_ESCAPES(opcode)) {
+ if (_PyUop_Flags[opcode] & HAS_ESCAPES_FLAG) {
maybe_invalid = true;
if (last_set_ip >= 0) {
buffer[last_set_ip].opcode = _SET_IP;
}
}
- if (OPCODE_HAS_ERROR(opcode) || opcode == _PUSH_FRAME) {
+ if (_PyUop_Flags[opcode] & HAS_ERROR_FLAG || opcode == _PUSH_FRAME) {
if (last_set_ip >= 0) {
buffer[last_set_ip].opcode = _SET_IP;
} I'll open a PR soon. |
Bug report
Bug description:
Over the last two weeks, some test failures were introduced when the Tier 2 compiler is turned on, such that building with
--pgo
and Tier 2 fails.I am going to bisect to see if I can find the moment at which the failures were introduced and will report back.
Full build log
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Linked PRs
_SET_IP
uops in tier two #113662The text was updated successfully, but these errors were encountered: