Omokage: Understanding How Agents Develop and Optimize HPC Kernels on GPUs

Lingqi Zhang, Jens Domke, Chen Zhuang, Du Wu, Zhengyang Bai, Mohamed WahibarXiv 2026

TL;DR

When you let today’s AI coding agents loose on high-performance GPU kernels without a time or token limit, the best ones don't just write working parallel code—they smash through theoretical hardware limits. By examining the exact footprints these agents leave behind, researchers discovered that frontier models spontaneously rewrite underlying math, exploit specialized hardware, and outpace years of human-tuned code, all while ignoring the profiling tools human engineers swear by.

What Problem Does This Paper Address?

Writing fast GPU code—known as performance engineering—is notoriously difficult. You have to juggle memory bandwidth, compute limits, and intricate hardware quirks. Recently, AI coding agents (LLMs equipped with command-line tools to write, compile, and test code) have entered this arena.

However, existing benchmarks mostly treat these agents like black boxes: give them a fixed $5 budget or 10 turns, and measure the final speedup. That leaves two massive questions unanswered: How close to the absolute physical limits of the hardware can general coding agents get when taken off the leash? And how are they actually doing it under the hood—are they reasoning like human engineers, guessing, or just cheating the tests?

Methods

To peek inside the black box, the authors built Omokage (Japanese for "traces" or "vestiges"), an inspection framework designed to evaluate both the final code and the agent's step-by-step execution trajectory.

Figure 1: Overview of Omokage. Green marks the evaluation setup. LLM marks the parts that use an LLM.

Here is what makes Omokage distinct:

  • Unbounded, Isolated Sandboxes: Each agent gets a dedicated NVIDIA B300 GPU, no internet access, hidden test cases (to prevent reward hacking), and no budget limit. The agent decides its own plan and when to stop.
  • Roofline Attainment: Instead of comparing against a slow CPU baseline, Omokage grades agents against the roofline model—the theoretical "speed of light" dictated by the GPU’s peak compute throughput and memory bandwidth for a given algorithm.
  • Hybrid Verification & Forensics: A deterministic script checks speed and accuracy (comparing against higher-precision references). Then, a separate "Investigator" LLM parses the agent's messy execution logs into structured segments to analyze its strategy and flag potential edge-case bugs. Finally, a "Bug Verifier" agent attempts to actually reproduce those bugs in a separate sandbox before any solution is penalized.

Datasets

Rather than training new models, the authors built an evaluation suite by adapting 30 workloads from PolyBench/C 4.2.1—a classic collection of loop-nest kernels spanning linear algebra, stencils, solvers, and dynamic programming. Agents are given serial C code and asked to port and optimize it in CUDA.

What’s new here is the validated performance models paired with each task. Two frontier agents (Fable 5.0 and GPT-6 Astra) debated each other to establish the theoretical operation and memory-traffic bounds for all 30 kernels, which human researchers then audited and refined.

Key Insights and Ideas

  • Breaking the "Speed of Light" Unprompted: You can't break the laws of physics, so how did models exceed 100% of the roofline bound? By changing the rules of the calculation without losing accuracy. Frontier models spontaneously used lower-precision Tensor Cores with mathematical tricks (like the Ozaki scheme) to recover full 32-bit accuracy, kept data on-chip across time steps (temporal blocking), and even used runtime compilation (NVRTC) to bypass build flags and unlock 5th-generation Tensor Cores.
  • Spontaneous Math Reformulation: Without internet access, flagship models recognized that iterative stencil loops could be transformed into frequency space using Fast Fourier Transforms (FFTs)—collapsing hundreds of sequential steps into a single jump.
  • Agents Don't Need Profilers: Human GPU engineers live inside profilers like Nsight Compute. Yet when given access to profilers, most agents ignored them. When they did run a profiler, the code ended up slower just as often as it got faster. Instead, top models relied on back-of-the-envelope math (quantitative performance modeling) paired with a disciplined hypothesize–implement–verify loop.
  • Open-Weight Models Lack Discipline: When closed frontier models hit a performance regression, they diagnose or revert it. Open-weight models ignored or missed 34% of their performance errors—and nearly half of the times their own data refuted their hypotheses, they just plowed ahead anyway.

Key Results

The authors evaluated 28 models across four CLI harnesses (Claude Code, Antigravity, Codex, and OpenCode), burning through 909 GPU hours and $7,128 in API costs.

Figure 2: Roofline attainment per model and kernel: roofline-bound time over measured time, with the bound max(Ops/peak Op/s, bytes/peak HBM bandwidth) at the FP32 peak, FP64 for adi (F64), and INT32 for floyd-warshall and nussinov (I32). Values show percent below the bound and multiples above it (separate log scales for C and M, where C/M marks compute- or memory-bound). Corner marks come from source-code matching, while temporal blocking and algorithm changes come from Investigator reports checked with Opus 5.5. BF16 includes cuBLAS’s BF16x9 emulation, and INT16 marks two 16-bit integers per DPX instruction. Failed cells include 28 Bug Verifier failures, and bug noted marks kept solutions with borderline bugs (Sec. 5.5). Geomean runs over passed kernels, Mean counts failed kernels as 0, w/o alg. chg. excludes the 6 kernels with algorithm changes (Sec. 5.3), and solid frames mark row maxima.
  • Closed vs. Open Gap: Google’s Gemini 4 Neon (in Antigravity) achieved a geometric mean of 2.0x the theoretical roofline bound, and Anthropic's Opus 5.5 (in Claude Code) hit 1.6x. Meanwhile, the best open-weight model (Kimi K3) reached only 0.32x (32% of the bound).
  • Algorithm vs. Hardware Specialists: Gemini 4 Neon excelled at mathematical reformulations (hitting an absurd 201x bound attainment on jacobi-1d by skipping time steps). Excluding kernels with algorithm changes, Opus 5.5 led the pack at 1.61x by writing intricate, hardware-specific PTX/Tensor Core instructions.
  • Beating Human Experts: On heat-3d (a standard 3D stencil), Anthropic's Fable 5.2 generated standard time-stepping code that ran 2.5x faster than hand-tuned academic frameworks (EBISU) and 1.9x to 7.1x faster than specialized stencil compilers like AN5D and Devito.

Limitations and Future Work

  • Benchmark Familiarity: PolyBench is famous; in at least 653 of 840 sessions, agents explicitly named the kernel they were given. Real-world, messy codebases remain a tougher frontier.
  • Single Runs & Coupled Harnesses: Because 840 unbounded runs cost over $7,000, each model was tested once per kernel, and models were tied to their vendor's CLI harness—meaning LLM capability and harness design couldn't be isolated.
  • Benchmark Loopholes vs. Reality: Skipping 1,000 stencil steps via FFTs wins the benchmark, but real scientific simulations often need intermediate states every few steps, where FFT overhead wouldn't pay off.
  • Correlation vs. Causation: Quantitative reasoning and hypothesis loops consistently appear in winning models, though future controlled interventions are needed to test whether prompting weaker models to follow this discipline actually makes their code faster.

Summary updated

BibTeX
@misc{zhang2026omokage,
  author = {Lingqi Zhang and Jens Domke and Chen Zhuang and Du Wu and Zhengyang Bai and Mohamed Wahib},
  title = {{Omokage: Understanding How Agents Develop and Optimize HPC Kernels on GPUs}},
  year = {2026},
  eprint = {2611.39217},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.39217},
}
Figure