Twelve adversarial gates, aimed outward at 2,638 machine-generated kernels a public system had already accepted, and inward at the first native tcgen05 training backward for the GDN family. The full paper is on arXiv at arXiv:2608.12700 and archived at doi.org/10.5281/zenodo.21563212.
Language-model kernel generators report high correctness from one loose test: a few random inputs at one fixed shape, accepted if close to a reference. A kernel can pass and still return a finite number where the answer is NaN, change on every run, or break at a new shape. Lethe builds a contract-grade verifier of twelve adversarial gates, several tolerance-free, and aims it in two directions.
Outward, it audits 2,638 kernels a public system had already accepted. Inward, it checks the first native Blackwell tcgen05 training backward for the gated-linear-recurrence (GDN) family, whose correctness we establish independently against a double-precision oracle, so a pass shows the battery is not tuned to flatter its author.
Kernel-generation benchmarks are only as trustworthy as the allclose test beneath them. Sarkar argues on twenty-four hand-built kernels that loose checks accept broken ones, but reports no rate on a real corpus. The Kernel Contracts taxonomy enumerates correctness classes; that taxonomy is theirs. Ours, to the best of our knowledge, is its first runnable, at-scale operationalization, audited on thousands of accepted, real kernels and passed by a certified native artifact.
Five sub-quadratic sequence models (linear attention, GLA, Mamba-2, KDA, and GDN) replace attention with a fixed-size recurrent state and form one family. Their superset is the gated DeltaNet (GDN) update of a matrix state S from keys kt and values vt, read by queries qt, with log-decay gt, erase bt, and write wt gates:
St = (I − kt(bt ⊙ kt)⊤) Diag(egt) St−1 + kt(wt ⊙ vt)⊤, ot = St⊤qt (1)
Equation (1) adds the delta rule (store the correction to what S predicts, not the raw value) to channel-wise decay. Fixing its gates recovers the other four, and roughly 80% of the parameterization is shared, so one backward through (1) yields training gradients for all five. Each reduction is checked against its own reference.
tcgen05/TMEM training backward for the GDN family, and a native reverse-state backward, the stage others still run in fla Triton.Each gate is an adversarial contract graded against a high-precision reference that refuses to run in reduced precision.
| Gate | Property checked |
|---|---|
| CMP-01 | correct on random and adversarial inputs (zeros, 10⁶, 10⁻⁶, denormals, long L) |
| CMP-02 | correct gradients, not only outputs (autograd versus finite difference) |
| CMP-03 | correct across batch, length, and width |
| ORD-01 | reordered summation within a derived ∝ √N rounding bound |
| ORD-02 | byte-identical across five repeats, no shared-buffer aliasing |
| ORD-03 | correct on an input built to expose a bad summation order |
| PRC-01 | correct in fp32, fp16, and bf16 |
| PRC-02 | fed fp16, still keeps an fp32 running total |
| EXC-01 | infinities and NaNs match the reference in position and sign |
| EXC-02 | subnormal flush-to-zero matches the reference |
| RES-01 | output on the same device as the input |
| RES-02 | compiled kernel fits hardware limits (registers, shared memory, TMEM) |
Tolerances are derived, not chosen (ORD-01: atol ≈ 4ε√N · scale), inputs are seeded, and the nineteen red-team kernels each embody one trick, from cached answers to swallowed infinities.
The corpus is Dr. Kernel / KernelGYM (MIT license): 8,920 fine-tuning trajectories, each ending in a Triton kernel. Its SSM-adjacent classes yield 3,134 kernels, each run sandboxed on a B200; keeping those with a positive recorded speedup and a floating-point input, minus toolchain artifacts, leaves 2,638. Five fairness rules push every ambiguous case toward the candidate.
Is the checker just stricter? Four separately falsifiable answers:
7f46226).KernelBench's paper-era check (allclose, atol=rtol=10⁻², five trials, fixed shapes) accepts 93.7% (2,472 of 2,638).
| Ours: PASS | Ours: FAIL | |
|---|---|---|
| KernelBench: PASS | 985 | 1,487 (918 tolerance-free) |
| KernelBench: FAIL | 14 | 152 |
The checks disagree almost entirely in one direction: a systematic blind spot, not a difference in strictness. Under KernelBench's hardened fp32 tolerance of 10⁻⁴, 1,263 kernels still pass theirs and fail ours.
A 300-kernel re-audit on torch 2.11 returns 68.6%, and the native-CUDA Sakana AI CUDA Engineer archive (213 kernels) shows a 20.2% environment-robust residual, mostly shape rigidity. The gap is neither toolchain-bound nor Triton-specific.
tcgen05 BackwardThe backward walks 64-step chunks in reverse, and two stages are hard:
Blackwell's tcgen05 tensor core keeps operands in Tensor Memory (TMEM), capped at 512 columns and managed by hand. In state-spaces/mamba#904, the official Mamba-3 backward requests 544 columns at its normal performance setting, so it fails to compile and falls back to a path reported 38.7× slower on GB200; we reproduced it on our B200. Our first multi-GEMM kernels crashed by releasing TMEM per matmul, which the hardware forbids. Porting the single-reservation lifecycle of NVIDIA's mamba2_ssd.py cleared it.
The native backward is slower than the Triton flash-linear-attention library, roughly 8× at L = 512 and about 78× at L = 2048, because the reverse scan is sequential and fp32 glue dominates. Against our own earlier pipeline, channel-wise fusion cut the captured backward 2.75× and tensor-memory tiling cut the d_v = 128 variant 2.98×. Speed is future work.
The gates that sink the most foreign kernels also caught our own bugs: our kernel twice produced non-finite values and propagated them, which exposed both bugs (EXC-01); CMP-03 caught the channel gap in §3.3; RES-02 detects the #904 constraint. A checker that flattered its author would not have caught the author's own bugs.
tl.dot run at num_warps 2/4/8, where the official kernel loses every ≥ 4 configuration; against it they run about 4× slower (0.22 to 0.36×), the cost of avoiding tl.dot. Priority on the MIMO backward is TileLang's.Every reported result in GPU-kernel generation rests on a correctness test too weak to carry it. One verifier, one standard, aimed both ways, exposes the gap and passes a backward certified independently. A small set of tolerance-free contracts (non-finite propagation, determinism, shape polymorphism) would close most of it at modest cost.
The full paper is on arXiv at arXiv:2608.12700 and archived at doi.org/10.5281/zenodo.21563212.
tl.dot path once Triton ships the #9093 tensor-memory fix, and less fp32 glue.Thanks to Google Cloud Singapore and E3A Healthcare for the compute, and to Rishav Shrestha for GPU access. The verifier operationalizes Cooper Veit's Kernel Contracts taxonomy (arXiv:2604.22032) and measures against KernelBench (arXiv:2502.10517) on the Dr. Kernel / KernelGYM corpus by Liu et al., ICML 2026 (arXiv:2602.05885, MIT license). The speed baseline is flash-linear-attention, the TMEM lifecycle follows NVIDIA's mamba2_ssd.py, and the bug is tracked at state-spaces/mamba#904.