Skip to Main Content

Compilers are excellent, but not perfect: even at clang -O3, their maximum optimization level, they still miss faster ways to compute the same thing, and finding these missed optimizations by hand is slow expert work. An AI model can propose faster versions, but a compiler cannot accept a rewrite on trust: a single wrong one silently breaks every program built with it. qed-superopt removes the need for trust. It lets an AI optimize code past clang -O3, and it accepts nothing without a mathematical proof. Muse Spark invents a faster version of a function. Alive2, a formal verifier, checks it for every possible input. If the rewrite is wrong, the model gets the exact input that breaks it and tries again. Whatever comes out is proven correct, not just tested. And it works. On a frozen benchmark of 134 functions, Muse Spark produced a proven rewrite for 132. 51 of them are confirmed faster on two real CPUs. For 39 of those, experts already knew a better solution existed: the AI reached a faster result without ever seeing it. In our best example, a date function adapted from libc++, it removed 9 of 35 instructions and ran up to 1.54x faster, on its first attempt, for 14 cents. Meta's open-weight model does it too. Muse Spark Open, served on a Modal Shared Endpoint, ran the same loop on the same benchmark: a proven rewrite for 127 functions, and 54 confirmed faster on a real CPU (timed on one CPU so far), for 9.72 dollars. The whole Muse Spark run cost about 36 dollars, roughly 70 cents per confirmed win. That changes the economics of compiler work: hunting for missed optimizations is usually slow expert labor, and here it ran across a whole benchmark in days. The payoff compounds, because the compiler stack behind Chrome, Android, PlayStation games and Rust programs only has to learn a pattern once for every program that contains it to benefit. We have already reported our first findings to LLVM, issues 237771 and 237772. The idea is simple: let the model be creative, and let a proof decide. We have started taking it from isolated functions to real programs: our first whole-program tests, on PNG decoding and on SQLite, found proven rewrites in real code but no reliable speedup of the whole program yet, so the next step is to give the model larger code to rewrite, not just small functions. Everything can be checked. One command proves all 1,252 recorded proofs again, and we publish what did not hold, along with the limits, in the README and the video. We built the propose, prove and repair loop, the prompts, the corpus and the measurements during the hackathon. We use LLVM, Alive2, Z3 and Meta's models as they are.

Team

julesreyn

More from Meta Global AI Developer Hackathon

Cardo turns the world around you into Kurdish flashcards. Kurdish is spoken by tens of millions of people, but it has very few learning tools, and most…

Kurdolingo project preview

oqed is an LLM-guided superoptimizer for x86-64. You point it at a C or C++ project and it does the rest: - builds the project and runs its workload…

oqed project preview

Playtest Agent plays a game from screenshots, looks for bugs, then replays each report and has a judge check it. I make games alone. Solo developers and…

Adrian project preview

Open-source npm malware detection on Meta's models: a live monitor that flags new malware about a day before the public lists, a Muse agent that investigates…

Gatekeeper project preview

Video2URDF turns one short phone video of a real articulated object (a laptop lid, a drawer, a desk lamp, a microwave door) into a measured URDF/MJCF a robot…

Video2URDF project preview

Glimmer Scope opens up Muse Glimmer 30B so you can see and steer the concepts it thinks with. I trained sparse autoencoders on nine layers of Glimmer's…

Kroonen AI project preview