The PyPy Project
pypyproject.bsky.social
The PyPy Project
@pypyproject.bsky.social
The developers of the PyPy project: a fast, compliant, open source Python interpreter.

https://pypy.org/
https://github.com/pypy/pypy
Adding heap operations to Z3 didn't actually find any bugs in the JIT optimizer for heap operations. Maybe that's not entirely surprising, because miscompilations in that area tend to lead to crashes pretty quickly. In any case, it's good to have that infrastructure for the future.
May 21, 2025 at 8:16 AM
We also added limited support for generating random heap operations to our JIT optimizer fuzzer. This extends previous work, which supported only int operations in Z3:

pypy.org/posts/2022/1...
pypy.org
May 21, 2025 at 8:16 AM
Christoph Jung, another student @cfbolz.bsky.social, added a memory model to our Z3 based translation validation. Now our CI checks whether our optimizer unit tests contain invalid optimizations using Z3.
pypy.org
May 21, 2025 at 8:16 AM
Micro-benchmarks for both optimizations look great, but both are hard to see in the performance of bigger programs.
May 21, 2025 at 8:16 AM
An unrelated optimization we also merged was to make store-to-load and load-to-load forwarding work for array reads and writes where the index is a variable. This already worked for constant indexes before.
May 21, 2025 at 8:16 AM
We've already had type based alias analysis before, but only taking the RPython level types into account. Unfortunately instances of different Python classes get represented as instances of the same RPython type, making the old JIT logic useless for distinguishing them, which is now fixed.
May 21, 2025 at 8:16 AM
Interestingly enough PyPy 3.x is mostly smaller than 2.7. E.g. PyPy 3.11 is 58.8 MiB, despite having a bunch more features. I never quite figure out why. Just for comparison, CPython 3.11 is 25.2 MiB.
February 13, 2025 at 8:04 PM
This is the size of PyPy 2.7, btw. It doesn't make sense to use the 3.x variant for this, because the size of that changes due to newer Python versions being implemented over time.
February 13, 2025 at 8:04 PM
So far this is a rather low-level mechanism, there's no convenient pdb integration yet. We plan to add something like that later, for now you can use a third-party package such as sdb to get an actual remote debugger going: github.com/ryanpetrello...
GitHub - ryanpetrello/sdb: a socket-based remote debugger for Python
a socket-based remote debugger for Python. Contribute to ryanpetrello/sdb development by creating an account on GitHub.
github.com
February 7, 2025 at 7:53 AM
The other new feature an implementation of the draft PEP 768, "Safe external debugger interface" (again, Linux only so far). PEP was written by @pablogsal.com et al. It allows you to remotely attach to a running PyPy process and inject Python code into it.

doc.pypy.org/en/latest/re...
Remote Debugging — PyPy documentation
doc.pypy.org
February 7, 2025 at 7:53 AM
We have further features planned for VMProf, including a stochastic memory profiler hopefully coming out later this year.
February 7, 2025 at 7:47 AM
Here's a screenshot of the Firefox Profiler UI showing VMProf output. The blue functions are native functions, yellow is Python functions and orange jitted functions (no example of that is in the screenshot).
February 7, 2025 at 7:47 AM
It works best by combining it with vmprof-firefox-profile, which converts vmprof output to a format the Firefox Profiler UI can read: github.com/Cskorpion/vm...
(We're still working on a PyPI release of this tool.)
GitHub - Cskorpion/vmprof-firefox-converter: Firefox-Profiler as UI for VMProf
Firefox-Profiler as UI for VMProf. Contribute to Cskorpion/vmprof-firefox-converter development by creating an account on GitHub.
github.com
February 7, 2025 at 7:47 AM