-
-
Notifications
You must be signed in to change notification settings - Fork 31k
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-104584: Baby steps towards generating and executing traces #105924
Conversation
I
|
Use '#define X 1' instead.
Benchmark results say "1.00x slower": https://github.com/faster-cpython/benchmarking/blob/main/results/bm-20230619-3.13.0a0-6b23e0f/bm-20230619-linux-x86_64-gvanrossum-optim_exec-3.13.0a0-6b23e0f-vs-base.png (sorry, access only for Faster CPython team members). |
(Macros inherit flags from components, but shouldn't inherit IS_UOP.)
The |
Now test_mmap on Windows passes, and hopefully so does test_threading on UNIX.
Instead of `int oparg` we now have `uint64_t operand`. In the Tier 2 interpreter, we add `int oparg` and set it to a truncated version of `operand` so instructions can reference it.
The latest change indeed fixes I had hoped it would also fix
I will continue to debug this for a bit, but I'll probably choose to just disable the offending bytecode again. UPDATE: I gave up. I have a hunch it's related to a trace that contains two |
Apparently the fix using SET_LOCALS_FROM_FRAME() isn't enough (it fixes some but not all failures). Possibly the problem is due to having *two* BEFORE_WITH uops in one trace? Unclear what's wrong with that opcode.
🤖 New build scheduled with the buildbot fleet by @gvanrossum for commit 4bd7bb6 🤖 If you want to schedule another build, you need to add the 🔨 test-with-refleak-buildbots label again. |
Regarding new files, I don't think it will stand in the way of progress if this were merged with the superblock creation code in Python/optimizer.c and the trace interpreter in Python/ceval.c. If at some point in the future that becomes a problem we can refactor it then. I'd like this PR to remain a spike, not become a marathon. Last bits of work:
|
The uops optimizer is enabled in the main interpreter when either: - -Xuops is passed; or - PYTHONUOPS=1 is set. The env var for uops debugging is now called PYTHONUOPSDEBUG. It only has an effect when configured --with-pydebug *and* the uops optimizer is enabled (see above). Also fixed a compiler warning about %ld with an int64 arg.
Those tests now only fail when run with -Xuops. We should probably fix the uop executor instead. Also, test_embed now passes even with -Xuops. This reverts commit 91dd86c.
🤖 New build scheduled with the buildbot fleet by @gvanrossum for commit 6606c5d 🤖 If you want to schedule another build, you need to add the 🔨 test-with-refleak-buildbots label again. |
@markshannon I have a niggling suspicion that if the very first uop in a trace ends with a failing DEOPT_IF (or ERROR_IF?), it will do the wrong thing, since |
The refleaks run failed, but that was an existing issue (#105273). They didn't test there were no refleaks left, because I also pushed the change that requires |
|
This is mostly so we can benchmark how bad the overhead is.