I Fuzzed, and Vibe Fixed, the Vibed C Compiler
10 hours ago
- #fuzzing
- #code-generation
- #compiler-bugs
- John Regehr initially didn't take much interest in CCC (Claude's C Compiler) but became curious after fuzzing it with Csmith and YARPGen.
- CCC showed significant miscompilation rates: 14 out of 101 Csmith programs and 5 out of 101 YARPGen programs.
- Csmith and YARPGen are randomized compiler testing tools that have detected many compiler defects, including miscompilations.
- Regehr used YARPGen and C-Vise to reduce miscompilation bugs in CCC, then fixed them with the help of Codex (GPT-5.3-codex).
- After 11 bug fixes, CCC no longer miscompiled programs in overnight fuzzing runs with both YARPGen and Csmith.
- The bugs fixed were mostly surface-level, related to incorrect handling of C language semantics, such as sign-extension and narrowing optimizations.
- Regehr noted that production-grade compilers like GCC and Clang rarely have such surface-level bugs; most bugs are found in optimizers.
- CCC is impressive for a non-production compiler but lacks optimization and still has fundamental C interpretation issues.
- Regehr's fork of CCC, with fixes, is available on GitHub for further testing.
- The experiment showed that Codex can effectively fix compiler bugs without guidance, producing working solutions.