NEWSFEVER
Technology worth discussing24 / 7 · RU + EN
Back to feedDevelopment & Open Source

CPython formalization project reports 418 bug reports

Formalizing CPython uses AI agents to model interpreter code in Lean, with roughly 55 reported issues capable of crashing Python or corrupting memory.

Published: 10 Nov 2026, 07:00 UTC
Two connected structures of program blocks pass through a verification gate, with amber fractures marking detected mismatches.
Editorial illustration: comparing interpreter code with a formal model to uncover bugs.

The authors of Formalizing CPython say their effort to model CPython 3.15.2 has produced 418 bug reports. Using Opus 5.5, AI agents reproduce interpreter functions line by line in Lean, a language for machine-checked proofs. Most reported issues are minor, but about 55 can crash the interpreter or corrupt memory through ordinary Python code, according to the project.

Each model is tested against real Python on tens of thousands of inputs before its properties are proved. A separate agent that did not write the model must then accept the work. Since the project began on 29 October 2026, 4,071 of 26,004 targeted functions have passed review, or 15.7%. The work comprises 613,318 lines of Lean across 1,539 files, with 18,898 theorems and lemmas.

The authors stress that a checked proof establishes a claim about the model, which may still misrepresent Python. Testing exposed models that overlooked allocation failures, extra nested calls during an initial codec load and exception inheritance. Accepted claims are therefore also checked against the running interpreter.

Each report includes a reproduction script for Python 3.15.2, with most issues also reproduced on the development version. Reports absent from CPython’s tracker are being submitted. The authors describe the crash and memory issues as ordinary bugs because Python does not treat hostile Python execution as a security boundary. Most of CPython remains unmodelled, and multithreading is currently outside the project’s scope.

Original source: broyojo.com ↗

Comments on source platforms

Rank is the maximum of the latest discussion counts. These are source metrics.

Hacker News