
Codex Agent Delivers 232x Faster QR Kernel in Auto-Research Contest
A developer competing in GPU Mode's auto-research contest placed 12th out of 183 participants with a QR decomposition kernel 232 times faster than the baseline, built by looping an OpenAI Codex agent over the leaderboard.
In an auto-research contest run by GPU Mode in collaboration with Core Automation, a developer writing as sankalp placed 12th out of 183 participants. His solution ran 232 times faster than the baseline QR decomposition kernel. In a blog post, he describes how he used OpenAI's Codex agent and a tight submission loop — an approach he also calls "loop engineering".
The problem: batched Householder QR
Competitors had to implement batched square compact-Householder QR factorization. The input was a batch of FP32 CUDA matrices of shape batch × n × n, and the output had to match the compact representation returned by torch.geqrf: the upper triangle of H holds R, the lower part stores Householder vectors, and a separate tau vector carries the reflector coefficients. A checker rebuilt Q with torch.linalg.householder_product(H, tau) and verified that A ≈ QR, QᵀQ ≈ I and QᵀA ≈ R.
Correct submissions were ranked by geometric-mean runtime across shapes and conditioning cases. The key sizes were batched square matrices such as 512×512, with larger 1024, 2048 and 4096 cases as well. Low-precision FP16, FP8 or NVFP4 math was allowed internally, but the returned factors still had to pass FP32-style QR checks.
Codex in the loop
GPU Mode provided a popcorn CLI that let agents test, benchmark and submit to the leaderboard directly. Over 14 days the author made more than 1,500 submissions. His Codex workspace held a problem statement, an AGENTS.md with submission instructions, and a log that tracked every attempt. He used the /goal command to give the model numeric targets, /btw to check on it without stopping the loop, and Modal plus NCU profiling to find bottlenecks.
To escape local maxima the author kept a "beam" of three to five candidate ideas alive instead of a single best, brought in a stronger advisor model for fresh approaches, and occasionally sent sub-agents after individual experiments.
From 419 ms to 1.8 ms
The baseline torch.geqrf path took roughly 419,000 microseconds overall. After implementing the blocked Householder route for the n = 512 shape, the author reached 5,000 microseconds within a day; the final tracked result was 1,805 microseconds. The blocked algorithm compresses a panel's reflectors into one rank-b WY update and turns the work on the trailing block into three matrix multiplications — the shape tensor cores handle best.
What transfers
The author concludes that domain expertise speeds up both harness design and steering: knowing a problem well turns unknown unknowns into known ones and sharpens the questions an agent can be asked. This was, he says, his first serious attempt at auto-research, and a second contest in the series — on eigendecomposition — is already under way.
SiTech — AI-powered web development
We build fast, modern websites and bring AI into real business workflows. Have a project or a question? We'd love to help.