Python Tier 2 Interpreter Experiment (PyLBBV + Copy and patch JIT)

Experimenting with type propagation, Lazy Basic Block Versioning and finally a JIT in CPython

First Half: Type Propagation and Lazy Basic Block Versioning

The first half of this project is a joint work with @Kenjin.

We attempted to remove the overhead associated with dynamic typing in CPython by experimenting with our variant of Lazy Basic Block Versioning, and experimented with a (to our knowledge) novel type propagator for CPython bytecode.

I mostly worked on the type propagator and Kenjin worked on the codegen (this part required a lot of CPython knowledge).

First Half Report

Second Half: Refining PyLBBV and integrating a JIT

The second half of this project is a joint work with @Kenjin again. We mostly fixed a ton of issues with our previous implementation of PyLBBV, and then we incorporated @BrandtButcher's awesome CPython bytecode stencil compiler, which basically precompiles CPython's bytecode into machine code. Brandt's code presents majority of the work in integrating the jit into PyLBBV.

Me and Kenjin wanted to get some academic credits for work we are gonna do anyways, so we applied for a Year 1 software engineering credit bearing blah blah, so annoyingly we had to comply with a bunch of annoying deliverables like posters, videos, pitches, and ughhhhhhhhhhh. Kenjin did most of that though, I mostly just made pretty diagrams.

Also fun fact we got dropped to one of the lower “achievement” levels because of a lack of new features.