Thanks for your comments, Thomas.
The timeline and method JIT proposal are providing what the SC asked for, and we put a lot of thought and time into forming a cohesive PEP around them because they were explicitly requested.
From the SC’s post (extracting the two relevant bullets):
Also in the same post:
We are providing a concrete proposal for an alternative implementation that a lot of people have suggested over the years, with clear, measurable success metrics and timelines for that alternative implementation, as well as setting expectations about how stable and unstable the different parts of the current JIT architecture are in light of that transition.
So I think it would be inappropriate for the PEP to not include these. Further, shifting to the alternative design directly affects the timeline/maintainability/etc., so a separate PEP seems like it makes the process more complicated and opaque, not less. Here, we have a way to present a complete story.
(And if the SC feels differently, it can totally say “We accept the PEP, but we want to stick with tracing because of X, Y, and Z.”)
I think this is a misunderstanding.
Firstly, I want to re-emphasize that the uop IR is what’s currently in main, we are not introducing a new IR with this PEP. The main reason why we like the existing uop IR so much and don’t want to change it is because it’s literally how the base interpreter itself is written. It’s not just “understandable”, it’s what’s actually used today to define every single bytecode instruction. Furthermore, lowering is trivial (and mostly generated), keeping the Python frame in a sane state is easy (because the IR operates on the exact same stack as the bytecode)… there are many nice things about sharing definitions between the two parts of the runtime, and a concatenative, stack-based IR is a very straightforward way to do that in our experience.
So I would argue that yes, this is already understood well by anyone who works in the interpreter loop. More importantly, is it maintainable by a small team due to deriving from the interpreter. If you’re interested, take a look at What’s new in Python 3.15 — Python 3.16.0a0 documentation; I count 14 contributors to the JIT optimizer, of which only four are core devs. I think this is pretty strong evidence that the current JIT IR can be understood and is accessible to other members outside the core team.
That’s a huge part of why the method JIT is part of the proposal. There are a lot more people familiar with whole-function compiler architectures than tracing ones. It turns out the uops/stack also have nice SSA properties if you’re careful, and so tons of relevant theory is directly applicable to the bytecode-fragment IR we already have.