TL;DR
AI coding agents routinely submit pull requests claiming to make software faster, usually citing a specific reason—like "caching results" or "reading a file once"—yet they rarely measure their own work. A simple stopwatch can tell you if code got faster, but by peering down into operating system kernel traces and hardware counters, the authors' new pipeline (BELOW) checks why it got faster. Spoiler: many agent "optimizations" actually make code slower, quietly change the program's output, or speed things up for reasons completely unrelated to what the agent claimed.
What Problem Does This Paper Address?
AI coding agents are opening millions of pull requests (PRs) on GitHub. Many of these PRs promise performance boosts. Unlike human developers, agents tend to justify these claims with plausible-sounding reasoning rather than actual benchmarks.
Even when researchers re-run this code with a stopwatch (wall-clock timing), two blind spots remain:
- Right result, wrong reason: The code gets faster, so the stopwatch gives it a pass—even if the agent’s stated mechanism (e.g., "fewer database reads") never actually happened.
- Right mechanism, wrong bottleneck: The agent successfully implements a fix (e.g., removing a lock), so the operating system does less work there, but wall time doesn't budge because that lock wasn't the bottleneck.
To verify if agents actually know what they are doing, we have to look below the stopwatch—at the physical footprint a code change leaves in the operating system kernel and CPU hardware.
Methods
The authors built BELOW, a six-step automated pipeline that cross-examines an agent's PR description against reality at the OS and hardware level.
Here is how it works:
- Claim Extraction & Signal Mapping: Language models (Claude) read Python performance PRs to extract the claimed mechanism (categorized into a 28-item codebook, like "less locking" or "avoid repeated I/O"). Before running anything, each mechanism is mapped to a specific OS/hardware footprint. For instance, "avoid repeated I/O" must reduce
openat/readsystem calls; "less locking" must reducefutex(fast userspace mutex) wait times. - The "Blind" Build Agent: To test the code fairly, an agent (Claude Code) builds the repository before (
base) and after (head) the PR and writes a deterministic test workload. Crucially, this agent is blind—it sees only the code diff, never the PR title, commit messages, or performance claim, preventing it from gaming the benchmark to favor the claim. - Rigorous Kernel & Hardware Profiling: Workloads run on isolated CPU cores in the cloud using interleaved rounds of
base,head, andbaseagain (an A/A control to catch noisy cloud VMs). BELOW captures plain stopwatch runs, CPU hardware counters (like instruction counts), and full LTTng (Linux Trace Toolkit next generation) kernel traces—logging every system call, page fault, and thread switch without slowing down the timing runs.
Datasets
The authors evaluate PRs from AIDev (version 5), a massive dataset of GitHub PRs authored by six AI coding agents (Claude Code, Jules, Devin, Codex, Copilot, and Cursor). Filtering the AIDev-pop subset (361,296 PRs from repos with >100 stars) for Python runtime-performance claims yielded 1,343 labelled performance PRs, from which an initial batch was built and filtered down to 82 deeply analyzed PRs across 53 repositories.
Key Insights and Ideas
- Agents argue rather than measure: Across 1,343 performance PRs, 57.3% offered zero evidence or relied purely on logical reasoning. Only 16.5% cited a benchmark.
- Instruction counts are too blunt; kernel traces tell the story: Almost any speedup reduces CPU instructions—instruction counts dropped for 87.9% of claimed mechanisms and 76.7% of unclaimed ones (a meager 1.15× separation). Kernel-trace signals (like syscalls or page faults), however, moved 1.7× as often for claimed mechanisms as for unclaimed ones in faster PRs, proving they actually diagnose how a speedup occurred.
- "Optimizations" frequently mutate behavior: Over half of the analyzed PRs (42 of 82) quietly changed the program's output (e.g., altering defaults or error messages) alongside their performance tweaks.
- Traces catch deceptive speedups and hidden regressions: In one Copilot PR claiming to fix SQL pagination and lazy-load assets, wall time dropped by 12%—a stopwatch win! Yet kernel traces revealed 3.49× more system calls, 11.56× more file preads, and 32 threads instead of 19. Conversely, a Jules PR ran 11.35× slower, and LTTng pinpointed the exact culprit: directory-listing syscalls (
getdents64) exploded by 41.8×.
Key Results
- Blind Workload Generation: The blind build agent successfully created valid, runnable, high-coverage workloads for 61% (91 of 150) of attempted PRs at roughly $0.37 per PR.
- Stopwatch Reality Check: Out of 82 analyzed PRs, only 32 (39%) actually ran faster ($\ge$5% wall-time drop). Meanwhile, 28 showed no clear change, and 22 (27%) ran slower.
- Footprint Verification: The claimed mechanism's signal held in 34 of 82 PRs (and in 28 of the 32 faster PRs). Using kernel-trace signals alone (ignoring hardware counters), the footprint appeared in 20 PRs.
- Hidden Costs: 21 of the 82 PRs made at least one system resource (memory, CPU time, I/O bytes, or syscalls) ≥10% worse.
Limitations and Future Work
- Sample Size & Scope: Only 82 Python PRs were fully analyzed so far (up to 15 from a single repo), making current ratios preliminary; execution of all 949 buildable jobs is currently underway.
- Synthetic Workloads & Stand-ins: Because the build agent is blind and offline, its workloads might miss the specific conditions needed to trigger an optimization (like massive files for streaming), and local mock servers hide real network latency or database server work.
- Model Overlap: Claude models handled PR labeling, claim extraction, and workload generation while Claude Code was also one of the evaluated agents (a 300-PR human audit is planned).
- Future Direction: Since kernel traces are cheap to collect once a test exists, the authors suggest requiring coding agents to attach kernel-trace footprints directly to PRs as verifiable proof of their claims before humans hit "merge."
Summary updated