Ten one-question kernels that turned a vadd hang into a rule about VGPR blocks.
vadd hung on its first run.
The harness printed rptr 0, signal 1 and c[0] 0. The packet never retired, and the kernel never reached its store. The log showed no fault.
Every experiment costs one GPU reset. So each kernel answers one question, and the order gets the most information per reset.
Every kernel runs with one wave, one element, and the harness unchanged.
The kernels and what each one shows:
sdump shows that every register vadd depends on is correct: a, b, n, the workgroup id and the lane id.
| kernel | what it isolates | result |
|---|---|---|
| store42 (wg 256) | 8 waves of a known-good kernel | pass |
| vadd (wg 1) | vadd code as one wave | hang |
| vadd (wg 1, fine data) | coarse vs fine data | hang |
| vload | one vector load, then store | pass |
| sload | vadd's 3 scalar loads incl. 128-bit | pass |
| sdump | dump s4..s7, s10, s2, v0 to memory | all correct |
| vbranch | vadd's exec-mask and branch, no loads | pass |
| vadd2 | vadd using v0..v3 only | pass |
| v4probe | vload with the value through v4 | pass |
| vadd16 | vadd bytes, descriptor asks 16 VGPRs | pass |
Two dwords make the difference.
vadd2 is vadd with the second load in v0 instead of v4. Nothing else changes, and vadd2 passes.
Their descriptors are identical. The assembler counts VGPRs in blocks of 8 for wave32, so 4 and 5 registers encode to the same block.
vadd16 is vadd's exact bytes with the register field one block higher. It runs.
Rule 3: ask the assembler for 8 more VGPRs than the code uses.
Block 0 does not give a wave five usable registers, whatever the encoding says.
v4probe passes alone, so one load into v4 does not hang a wave. The failure needs a second load in flight. The mechanism is not known. The rule is.
On timeout the harness prints rptr, signal and c[0]. So a hang still reports whether the packet retired and whether the kernel stored.
The bisect kernels are in src/kernels/.
docs/lessons.mdsrc/kernels/tools/asm