(Posting for the Steering Council, minus Savannah as PEP co-author)
A few weeks ago the PEP 836 authors (Brandt, Ken Jin and Savannah) attended Steering Council office hours to talk about the PEP, any concerns the SC might have, and whether the PEP adequately addresses all the concerns we raised in our request for a PEP. The SC didn’t have an answer ready at the time (we hadn’t really discussed the PEP among ourselves yet) so we agreed to discuss it and give feedback on the PEP before it’s sent to the SC for consideration. We don’t normally handle PEPs this way for a variety of reasons, but given that this is a special case in response to a specific request from us, it makes sense. Some of our feedback is about getting more community input on certain topics, so it also makes sense to post this response publicly. (We shared it with the PEP authors directly before posting it here.)
In the request for a PEP, the SC highlighted a few specific questions, which we’ll paraphrase as:
- What’s the plan for long-term maintenance and support?
- How much will the JIT break packages and users (including things that poke at internals, like profiling and debugging)?
- How do we measure the impact of the JIT?
- What is the position of the JIT in the wider Python ecosystem? How does it compare, compete, enable, co-exist with other JITs and eval hooks?
- How stable is the JIT implementation? Should it be considered still an experiment, or is there a concrete proposal?
The PEP does answer all of these questions, although perhaps some less convincingly than others, and we’ll get to some points we’d like to see discussed in more detail. One thing we want to make clear is that what we’re evaluating here is whether we want to continue with the JIT as an experiment in main. Part of the problem with allowing experimentation in main is the lack of unified design, and the uncertainty that core developers, package maintainers and users face as the experimentation changes behaviours and API surfaces. We are worried about both of those with the JIT, and the PEP does address this by proposing a design to continue as a specific experiment in main (rather than arbitrary experimentation in main).
We’re not evaluating, at this point, whether the JIT should be declared a supported feature, and we’re not setting the specific criteria the JIT needs to meet in order to be considered supported. Having realistic and aspirational goals on performance and user impact up front is important to make sure the design is even viable, but we don’t consider them necessarily hard requirements for a future “supported status” discussion.
The PEP is also a little vague about the long-term support plans and the performance criteria by which to judge the JIT. Both of those are understandable. Support is a community matter and difficult to dictate (by the JIT team or the SC), but the JIT team is doing the work to broaden the team, share knowledge and document the design and implementation. Committing to exact performance criteria is difficult because of the lack of good, representative performance measurements and benchmarks. The best we have is pyperformance, which can severely underrepresent common uses of Python. It is, however, the best we have available, and we’ll have to make do with it until something better comes along. It means we may have to reconsider the performance goals (and claims) in the future, and we (the SC, and the community) will have to be flexible in that.
There are a few things the SC thinks the PEP is too vague or optimistic about, which we’d like to see either spelled out in the PEP, or at least discussed and rejected. (To be clear, these are not all hard criteria blocking acceptance of the PEP, they’re things we would like to see considered.)
- Performance numbers: the PEP currently mentions performance in a single number, or at least a single range. Performance is likely to differ greatly between platforms, compilers,build modes, and applications though, and we’d like the PEP to call out what things could or would affect the numbers. The JIT team should probably consider engaging with a wide variety of existing projects to gauge the performance impact (positively or negatively) on real workloads.
- Memory impact: the PEP is pretty vague and optimistic about the memory impact of the JIT. This may be warranted, but we would still like to see some safeguards and measurements, similar to the performance ones.
- Design cohesion and sharing domain expertise: one of our concerns is with design decisions being made among a small group of developers, without critical review by the larger group of developers ultimately responsible for its development, maintenance and support. We want the JIT (and the interpreter, and all other parts of CPython) to have a cohesive design and architecture. How do we ensure that to be the case for the JIT, when we have different groups of people working in varying degrees of isolation? Do we need to require independent code review for changes to the JIT?
- Platform parity: the PEP mentions ignoring 32-bit platform support (despite 32-bit Windows still being a tier 1 platform). The reasons for this are sound and we have no problem with that. However, we do want the JIT to be designed platform-agnostically where possible. This is both to make sure it’s not a barrier for adoption of a new platform, and to limit the amount of platform-specific knowledge necessary to maintain and support the JIT. We don’t want a JIT whose design is tied to a specific platform, or trade bad performance on one platform for a speedup on another, or even add significant complexity to the JIT to benefit a single platform. This ties in with the previous point about design cohesion.
- Platform support: the PEP leans on PEP 11’s supported platform status for its support matrix. This is, however, a lower bound for support, and actual users exist on many systems that are technically different: different CPU architectures, compilers, libc, build modes (e.g. pydebug, sanitizers, embedding). Presumably the idea is not to leave them all out in the cold if there is no reason to, but the PEP does not currently mention anything beyond tier 1 support.
- User impact: we think the PEP is overly optimistic about the semantically observable difference with the JIT enabled. Having no such observable difference is a lofty goal and a good design principle, but we’re skeptical that that’s achievable in all cases, and may significantly hamper both design and implementation of the JIT if it is seen as an absolute. There are certainly (many, many!) cases where users and packages depend on idiosyncrasies in the interpreter design, as we’ve seen with other Python implementations or even just between major Python versions. The PEP should clarify how those will be handled, to what extent they’ll be considered bugs, how to handle situations where the difference in behaviour is unavoidable, and the process for gaining consensus when changes are required (such as one PEP, multiple PEPs, DPO discussions, etc.).
- Introspection tools: in a similar vein we’re afraid the PEP is overly optimistic about the work necessary to make introspection tools and other users reliant on the actual interpreter implementation. We want the PEP to be clear that it’s ultimately the JIT team’s responsibility to find solutions for these packages and tools, and how to deal with situations where a tool can’t be supported or made to work. This should of course happen in concert with the developers and projects involved, but the majority of the effort should be on the JIT team’s side. We can’t expect package maintainers or users to bear the brunt of the work.
- Compatibility review: the PEP mentions in its draft timeline an extensive compatibility review in the last half year of the proposed two and a half year timeline. We think that’s way, way too late, and the compatibility review should be an ongoing and continuous process starting as soon as possible. The goal with earlier testing isn’t to prove 100% compatibility, but to discover incompatibilities and areas for improvement and begin the likely lengthy resolution process early.
- Future PEPs: we would like the PEP to explicitly state that even though the JIT remains experimental, changes to support the JIT (e.g. to C APIs, libraries, build requirements, etc) may still require additional discussions, PEPS and approvals. (The PEP authors have made it clear this is how they see it already, we just want it to be explicit.)
- Security: this feels like an underserved area in the PEP, especially considering the global focus on security. We may have to consider a security review as part of the criteria for supported status, and a discussion with the PSRT on a clear stance on security and the JIT in the meantime.
Bottom line, the PEP mostly answers the questions we asked, and there are no significant missing pieces… but we do hope for a bit more discussion on a few topics so we can gauge community support and consensus before we’re asked to pronounce on this PEP.
(Posted for the SC.)