broyojo.comยท9 november 2026
Formalizing CPython

AI agents
artificial intelligence
bug detection
code review
CPython
Formal verification
Lean
Proof checking
Python
Software Bugs
Software Development
software formalization
software proof
software reliability
software testing
broyojo.com
AI agents rewrote 613,318 lines of CPython's internals in Lean, a language for machine-checked proofs, uncovering 418 bugs. The project involved copying functions line by line, testing them against real Python, and verifying proofs with a second AI agent. About 55 of the bugs could crash the interpreter or corrupt memory. The effort aimed to formalize Python's behavior, especially in edge cases, and assess the reliability of AI-assisted proof generation.