AI
Researchers Use AI to Auto-Generate Compiler Fuzzing Tools, Uncovering Dozens of New Bugs
A new framework trains language models on historical compiler bug reports to synthesize mutation-testing tools that catch security flaws across Rust and C++.
Finding hidden bugs in compilers—the software that translates code into machine instructions—is notoriously difficult. Researchers have now developed an automated approach that uses large language models to invent and refine testing tools specifically designed to find compiler defects, without requiring manual engineering for each language.
The Challenge of Compiler Testing#
Mutation-based fuzzing is a proven technique for uncovering compiler bugs. It works by deliberately introducing small, controlled changes into program inputs and observing whether the compiler behaves unexpectedly. However, as programming languages grow more sophisticated with features like generics, macros, and templates, designing effective mutation strategies becomes increasingly complex and language-specific. Past efforts have leaned heavily on human expertise and iterative refinement, making it hard to scale across multiple languages or adapt to new ones.
How Mut4All Works#
The new framework, called Mut4All, automates the entire process by combining three specialized AI agents. The first identifies what kinds of code mutations are worth testing and creates detailed specifications for mutators using insights extracted from real compiler bug reports. The second agent synthesizes working implementations of these mutators, fine-tuned to understand compiler design patterns. A third agent validates and improves the generated code by running unit tests, catching bugs and fixing them.
The researchers fed the system 1,400 historical bug reports—700 from the Rust compiler project and 700 from C++—yielding 444 working Rust mutators and 561 C++ mutators. Creating each mutator cost roughly eight cents via GPT-4o.
Results and Real-World Impact#
When deployed in a custom fuzzer, these automatically generated mutators discovered 62 bugs in Rust compilers (44 new to researchers, 32 of which have been fixed) and 38 bugs in C++ compilers (17 new, 3 fixed). On benchmarks comparing mutation-based fuzzing approaches, Mut4All ranked first for Rust and second for C++, outperforming existing methods in both crash detection and code coverage.
Why This Matters#
The approach is language-agnostic: the same pipeline could theoretically generate mutators for Go, Java, Python, or any other compiler, with minimal human intervention. By extracting knowledge directly from past bugs rather than relying on expert-written rules, the system captures practical patterns that matter in real-world compiler defects. This promises to make compiler testing faster, cheaper, and more comprehensive—critical for languages that power millions of systems.

