When I read about projects that combine formal methods and AI, I’m often looking...

@dwallach@discuss.systems

When I read about projects that combine formal methods and AI, I’m often looking for “bang for the buck”, by which I mean that the token-spending will yield something that will have substantial longevity. So, for the recent projects that have spent tokens to synthesize proofs over compiled binaries, they’re the opposite of this, because every time you make a tiny tweak to the program and recompile it, you have to then resynthesize all the proofs.

Instead, here’s a fun project from UT Austin where they decided to start with the CompCert C compiler, which was built long before modern AI. CompCert has been proven correct in very interesting ways. They have a proof that every code optimization phase will have no observable change in the program’s behavior before and after the optimization is applied, for absolutely any program going through the optimizer. Very cool stuff, but adding a new optimization to the compiler requires writing more proofs. AI to the rescue!

ut-infraai.github.io/2026/11/1

The authors compared the assembly output of GCC and CompCert, identified where new optimizations would close performance gaps, then implemented them. Repeat this enough times, and they got CompCert to achieve performance somewhere between GCC -O1 and -O2, versus the original CompCert not even doing as well as -O1. By working within the formal implementation of CompCert, and AI synthesis of the proofs, they could move relatively fast without breaking things. The authors do note that they had to pay careful attention to seemingly reasonable requests from the AI to relax the equivalence rules, so human judgment was a very important ingredient here. You need to really know your way around the backend of a modern compiler to have tackled this project.

And the result, due to the formal scaffolding, means that anybody using CompCert can have comfort using the new optimizations. The only reason somebody would use CompCert is because they really, really, really never want to worry about a compiler bug, and now they all just got a pleasant performance boost, without having to spend a single AI token.

Needless to say, there’s a lot of room for this line of work to keep going, whether that means implementing more optimizations, or building front-ends for other languages, or even connecting language-level verification tools (e.g., Verus for Rust) to lower their proofs down to the compiled binary, perhaps achieving a modern version of George Necula’s way-ahead-of-its-time proof carrying code concept of the late 1990s.

(There is a team at Shanghai Jiao Tong University and the University of Minnesota working on a Rust front-end to CompCert. As of their February 2026 short paper, they have specified a subset of Rust and built a front-end for it on top of the CompCert backend, along with a reimplemented borrow checker. Verification work is reported to be ongoing.)