← Latest papers
💻 computer science

GapForge: Directed Compiler Fuzzing via Coverage-Gap Analysis

GapForge is a targeted LLM-based compiler fuzzing technique that systematically identifies and bridges long-tail coverage gaps by prioritizing undercovered files, inferring fine-grained triggering requirements through path-difference analysis, and iteratively synthesizing prompts to significantly outperform existing methods in coverage and bug discovery on GCC and LLVM.

Original authors: Mingxuan Zhu, Qingyuan Liang, Junjie Chen, Zhihong Xue, Dan Hao

Published 2026-07-20
📖 4 min read☕ Coffee break read

Original authors: Mingxuan Zhu, Qingyuan Liang, Junjie Chen, Zhihong Xue, Dan Hao

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine the software that runs your phone, your car, or the internet as a giant, invisible factory. Inside this factory, there are millions of tiny workers (lines of code) that take your high-level instructions and turn them into machine language the computer understands. This factory is called a compiler. If even one worker is lazy, confused, or breaks a rule, the whole factory can produce garbage products—programs that crash, freeze, or secretly do the wrong thing. Because these factories are so huge and complex, it's incredibly hard to make sure every single worker is being watched and tested.

Enter the world of software testing. Think of this as sending in a team of inspectors to see if the factory is working right. For years, inspectors have used two main tricks: either they throw random darts at the factory (random testing) or they try to break things by twisting existing instructions (mutation testing). But here's the problem: the inspectors keep hitting the same easy-to-reach corners of the factory, leaving the dusty, dark, hard-to-reach backrooms completely ignored. These "blind spots" are where the most dangerous bugs hide, waiting to cause trouble. Recently, scientists started using Large Language Models (LLMs)—super-smart AI that can write code—to help with inspections. But even these AI helpers often wander aimlessly, not knowing exactly which dark corners need the most light.

This is where a new technique called GapForge comes in, acting like a detective with a magical map. Instead of just throwing darts or guessing, GapForge looks at a map of the factory to see exactly which rooms have never been visited. It then uses its AI brain to figure out the specific "secret handshake" (a specific type of code and a special setting) needed to unlock those locked doors. The researchers tested this on two of the world's biggest compiler factories, GCC and LLVM. They found that GapForge is a master at finding these hidden rooms. In just 72 hours, it covered 68.13% of the core GCC code and 69.11% of the LLVM code. That might not sound like 100%, but remember, the previous best AI method only managed about 64.62% and 65.02%. GapForge didn't just nudge the numbers up; it found 24,736 more lines of code in GCC and 19,798 more in LLVM that the other methods completely missed.

How does it do this? Think of GapForge as a three-step process. First, it scans the factory map and picks the "dirtiest" room—the one with the most untested code. Second, instead of just looking at the whole room, it zooms in on the specific dusty spot and asks the AI, "What kind of key do we need to open this?" The AI analyzes the surrounding clean areas to guess the exact combination of code structures and factory settings (like turning on a specific switch) required to reach the spot. Third, if the AI tries a key and it doesn't work, GapForge remembers that failure. It tells the AI, "Don't try that again; try something different," and sends it back with a better plan. This cycle repeats, slowly but surely lighting up every dark corner.

The results were impressive. Not only did GapForge cover more ground than eight other top-tier techniques, but it also found 12 real-world bugs that had been hiding in the shadows. These included 8 crashes (where the compiler just gave up and stopped) and 4 miscompilations (where the compiler silently built a broken program that looked perfect). The researchers showed that every part of GapForge's process mattered; if they removed the "map reading," the "key guessing," or the "learning from failure," the results got significantly worse. While other methods were busy generating thousands of test programs, GapForge generated fewer but much smarter ones, proving that in the world of software testing, quality and direction often beat sheer quantity.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →