kernels/attn_decode.py
The differential test passes
Random bf16 inputs on an RTX 4090, compared with a float64 PyTorch reference at the conventional lengths:
seq_len = 1 gives NaN, 17 gives an error of 0.73, 100 gives 0.20. And seq_len = 2047 still passes allclose: one missing token in 2047 stays inside the tolerance.
The verifier rejects it, on a CPU, in 2.5 s

correct only when seq_len % 16 == 0 explains why the tests passed. The suspect line names the expression to change and the expected one.
And the repro confirms it on the GPU

What to take away
- A test that samples inputs can only show the bug on the inputs it samples. The verifier searches the whole shape domain and reports the failing region.
- No GPU is needed to find the bug, only to look at it.
- After the fix (
tl.cdiv(seq_len, PAGE_SIZE)) the counterexample is gone. The kernel is UNKNOWN rather than PROVED, because paged online-softmax proofs are not wired in yet. See Limitations.
