TL;DR
Existing benchmarks for automated program repair (APR) rarely tackle the monolithic complexity, deep hardware dependencies, and concurrency bugs of the Linux kernel, while prior kernel-repair systems require pricey cloud infrastructure or unrealistic oracle file hints. The authors introduce RGym, an open, platform-agnostic testing framework that runs locally on commodity hardware, alongside a simple, cost-effective APR pipeline. By replacing oracle-guided localization with bug-inducing commits (BICs) and call stacks, their method reaches up to a 43.36% pass rate for less than $0.20 per bug.
What Problem Does This Paper Address?
Popular benchmarks like SWE-bench evaluate LLMs almost exclusively on user-space applications. The Linux operating system kernel is far tougher: it spans tens of millions of lines of code, interacts directly with hardware, and features pervasive concurrency.
Recent attempts to evaluate kernel APR have major pain points:
- kGym relies strictly on Google Cloud Platform (GCP) instances—costing upwards of $1,000 every two weeks—and suffers frequent build failures due to distribution dependency drift. Moreover, it assumes an unrealistic "oracle" (knowing which file to patch ahead of time) and achieves low success rates.
- CrashFixer reached high oracle-assisted pass rates (~65.6%), but relies on an expensive, multi-stage debug-tree pipeline costing $21.62 per bug and remains closed-source.
The authors aim to make Linux kernel APR reproducible, realistic (no oracle file lookups), and inexpensive.
Methods
The authors build an end-to-end framework consisting of RGym and a specialized repair pipeline:
- RGym Infrastructure: Runs completely on local commodity hardware via Docker (to bundle kernel version–matched compilers and toolchains) and QEMU (to boot VMs and run Syzkaller/C reproducers). Patches are evaluated across 26 parallel VMs for 10 minutes to reliably catch non-deterministic and race-prone bugs.
- Function-Wise Patching: Instead of asking the LLM to output git diffs (which often break due to inaccurate line numbers), the model names candidate functions, receives their full implementations, and outputs updated function bodies. RGym constructs the unified diff automatically, slashing patch application failures by 76%.
- Realistic Localization: Drops oracle file hints. Instead, it localizes bugs using sanitizer call stacks (e.g., KASAN) and developer-curated or tool-derived Bug-Inducing Commits (BICs) via bisection tools like SymBisect.
- Agent Designs:
- Simple Agent: Uses few-shot in-context learning tailored to memory corruption bug classes (out-of-bounds, use-after-free, null pointer dereference).
- Function Exploration Agent: Allows the model to iteratively request definitions of adjacent functions to develop its own root-cause mental model without bug-type specialization.
- Feedback Module: Automatically summarizes build failures or sanitizer traces and triggers retries.
Datasets
- Curated Syzbot / KASAN Dataset: Derived from Google's Syzbot repository of 6,088 kernel bugs. The authors filtered for severe KASAN bugs (memory corruption) having fix commits, reproducers, crash reports, kernel configs, and developer-curated bug-inducing commits.
- Reproducibility Verification: Each bug was tested on the patch parent commit to verify reproducibility, resulting in a clean, reproducible set of 143 verified KASAN bugs.
Key Insights and Ideas
- Diff syntax is a hidden bottleneck: Raw LLMs are terrible at outputting exact diff line offsets for large kernel files. Simply switching to function-level replacement reduced "bad patch" failures from ~52% to ~12%.
- Bug-Inducing Commits beat oracles in practice: Using the BIC plus the sanitizer call stack yielded higher repair rates (21.67%) than kGym's oracle setup (10.49%), proving that historical bisection context provides a strong semantic hint for root causes.
- Retries compound value efficiently: Adding feedback loops (up to 3 retries) nearly doubled repair rates (from 21.67% to 37.76%) while only doubling API costs, because earlier failures fail fast during compilation.
- Simpler beats overly complex pipelines: Sophisticated reasoning models (such as GPT-5 Thinking) paired with a straightforward prompt pipeline achieve results competitive with complex debug-tree agents like CrashFixer, at a fraction of the cost (~120× cheaper).
Key Results
- Pass Rates (Table 1):
- kGym baseline (oracle, GPT-4o): 2.8% (10.49% with function-wise patching).
- Simple Agent (No BIC, GPT-4o): 17.48% ($0.05/bug).
- Simple Agent (with BIC, GPT-4o): 21.67% ($0.08/bug).
- Simple Agent + Feedback (3 retries, GPT-4o): 37.76% ($0.17/bug).
- Simple Agent (Claude Opus 4.1): 32.16% ($0.73/bug).
- Simple Agent (GPT-5 Thinking): 43.36% at only $0.18/bug.
- Combined Performance: Taking the union of solved bugs across configurations reached 68.53%, demonstrating strong complementarity between models and agent architectures.
- Plausible Correctness: A manual check of 31 GPT-4o patches showed that 32.23% were plausibly correct and 22.58% were helpful workarounds—matching the manual correctness rates reported by CrashFixer.
Limitations and Future Work
- Absence of Crashes $\neq$ Correctness: Nearly 45% of patches that silenced the crash reproducer were semantically wrong upon manual inspection (e.g., suppressing symptoms rather than fixing root causes).
- Dataset Scope: Evaluated exclusively on memory-safety/KASAN bugs (OOB, UAF, NPD); non-memory logic bugs or filesystem-specific crashes were not evaluated.
- API Bottlenecks: Modern reasoning models (e.g., GPT-5 Thinking, Claude Opus 4.1) led to prolonged runtimes due to API rate limits, request retries, and high generation latency.
- Future Work: Further exploring automated bisection pipelines (e.g., integrating SymBisect directly end-to-end) and developing better automated semantic validators to reject superficially "quenched" crashes.
Summary updated