Show HN: carmen – testing AI-written GPU kernels A tool called carmen, built by an independent developer and posted to Hacker News, caught all 75 realistic bugs planted in AI-written Metal GPU kernels, while the standard single-input correctness check caught only 40. On an M4 MacBook Pro (16 GB), Claude-written fused kernels beat Apple's MLX by 1.82× on masked softmax and 1.41× on add + rmsnorm, but inside real Qwen 2.5 4-bit models the gains were +2–3% at 0.5B (214 to 220 tok/s) and negative at 1.5B (94 to 87 tok/s) and 3B (44 to 42 tok/s), because MLX already runs close to the Mac's memory-bandwidth ceiling. carmen measured a larger real-model gain from speculative decoding, an existing mlx-lm feature, at 1.48× on Qwen 3B. An LLM writes GPU kernels for Apple Silicon and carmen tests every one. Then it measures whether a real model on a Mac actually gets faster. TL;DR tldr · The CLI the-cli · Try it try-it · The problem the-problem · How it works how-carmen-works · Results results · What I learned what-i-learned - Most AI-kernel results are graded by a check that misses a lot. I planted 75 realistic bugs in GPU kernels: the usual check caught 40. carmen's tests caught all 75. - The kernels that passed were also faster. Claude's masked softmax ran 1.82× faster than Apple's MLX MLX does it in 3 steps, Claude's in 1 , and add + rmsnorm 1.41× . - But in a real model they barely mattered: +2–3% on Qwen 0.5B, nothing on bigger models, because MLX already reads the model's weights about as fast as the Mac allows. What did speed up bigger models was speculative decoding, an existing mlx-lm feature carmen measured: 1.48× on Qwen 3B. The home screen: what's been proven, the models you can speed up, and the kernels carmen has written. A model's page Qwen 2.5 3B : everything measured on it, and what you can run. Run carmen , press m , pick a model: it shows what's been measured on it and what you can run, no API key needed. LLMs can write GPU kernels, but a kernel can pass a quick test and still be wrong. Most AI-kernel benchmarks try a single input and accept any answer that's roughly close. So a kernel that works on 1,024 numbers but forgets the last one when there are 1,025, or one whose answers are slightly off, still counts as correct one study found this kind of check misses most precision bugs https://arxiv.org/abs/2609.22220 . And even a kernel that really is correct and faster on its own may not make the model any faster. I wanted to know if an LLM could make a model on my Mac faster, and prove it. At its core it's a loop: Claude writes a Metal kernel, carmen tests it, and the fastest correct one is kept and improved. Plenty of projects do that. The difference is that carmen doesn't trust the loop, because a plain loop fools itself in three ways: - The tests miss bugs. So carmen's tests are tested: I planted 75 realistic bugs in correct kernels. carmen caught all 75; the usual one-input check caught 40. Failures tell Claude exactly where it went wrong. - The model learns to pass the tests instead of being correct. So part of the test set is hidden: inputs Claude never sees, for correctness and for speed. Without that, 30% of LLM kernel "wins" on Metal broke https://arxiv.org/abs/2608.08722 on inputs nobody had tested. - "Faster" doesn't mean the model gets faster. So every win is timed against MLX's own fusion with error bars, then checked again inside a real model. That's how carmen found that kernels which win on their own barely move Qwen at all. Everything here ran on my M4 MacBook Pro 16 GB . Numbers in brackets are the range the real value is 95% likely to be in. Single kernels. Claude beat MLX where MLX splits the work into several small steps. On matmul and attention, which Apple has already tuned heavily, it lost: | kernel | MLX | carmen | speedup | |---|---|---|---| | masked softmax | 3 kernels | 1 fused kernel | 1.82× | | add + rmsnorm | 2 kernels | 1 fused kernel | 1.41× | | matmul | Apple's tuned kernel | 1 kernel | 0.93× | | attention | Apple's tuned kernel | 1 kernel | 0.54× | Against MLX's own automatic fusion mx.compile , the first two are still 1.38× and 1.43×. In real models, carmen's fused MLP kernels tuned on 0.5B mostly disappear, because MLX is already close to the fastest the Mac can go: | Qwen 2.5, 4-bit | MLX | carmen | speedup | fastest possible | |---|---|---|---|---| | 0.5B | 214 tok/s | 220 tok/s | 1.02× 1.01–1.02 | ~337 tok/s | | 1.5B | 94 tok/s | 87 tok/s | 0.93× 0.93–0.95 | ~108 tok/s | | 3B | 44 tok/s† | 42 tok/s | 0.95× 0.93–0.97 | ~53 tok/s |