Five small DXIL compute shaders give wrong results on AMD hardware. Each one passes the DXIL validator, runs correctly on WARP, and is checked against a CPU reference. The same operations written in HLSL and compiled by DXC run correctly on every adapter, so each bug depends on the exact DXIL shape. GPU code translators emit those shapes.
Hardware (one PC), re-checked on 2026-11-25:
- Radeon RX 9070 (RDNA4, device 0x7550), driver 32.0.32029.2010
- Ryzen 7 7700 integrated graphics (RDNA2, gfx1036, device 0x164E), driver 32.0.21045.29003
- Windows 11 Pro 26200, with WARP 10.0.26100.9818 as the reference
- Another user’s RX 9070 XT gives the same results, and an RX 7900 XT (RDNA3) reproduces bug 1.
The bugs:
-
Ordered i64 compare (icmp slt/ult/sgt/ugt) where both i64 operands are built from dwords, and one dword is the high half of one operand and the low half of the other. The compare orders as if each operand’s dwords were swapped; eq is correct. Example: 0 < 0x1_0000_0000 returns false. Wrong on RDNA4 and RDNA2.
-
f64 fadd/fmul of two doubles made with makeDouble from dwords the two sources share (as in v[1:2] and v[2:3]). The result is computed as if both sources were the first pair. Example: 1.5 + x, with x a tiny double, returns 3.0 (high dword 0x40080000, expected 0x3FF80000). Disjoint pairs are correct. Wrong on RDNA4; wrong on RDNA2 when makeDouble takes the dwords directly.
-
sext i1 → i64 leaves the high dword 0x00000000 instead of 0xFFFFFFFF. Wrong on RDNA2; correct on RDNA4.
-
WaveReadLaneFirst inside a divergent switch case returns another lane’s value (0x00000001, expected 0x7FFFFFFF). Wrong on RDNA4; correct on RDNA2.
-
Bfrev(Countbits(0x80000000)), constant-folded, returns 0x80000001 instead of 0x80000000. Bfrev of a runtime value is correct. Wrong on RDNA4; correct on RDNA2.
cargo run --releaseruns every vector on every D3D12 adapter and prints a pass/fail matrix with the first wrong value.- Each vector is a .dxil container plus a .txt with its inputs, root layout and expected outputs:
- bug 1:
vectors/victory-v-cmp-*-shared-dword - bug 2:
vectors/belobug-*-f64-shared-dword-*, with*-disjoint-*as controls - bug 3:
xcl-sext-i1-to-i64,xcl-seed-540 - bug 4:
xcl-seed-722 - bug 5:
xcl-seed-1599
- bug 1:
- Per-bug write-up:
AMD-DRIVER-BUGS.mdin the same repository.
These were found while testing open-source translators of Xbox Series (RDNA2) shader code to DXIL: VIctory, a VIctory fork for AMD, and XCL. Fixes that avoid these shapes are merged or proposed in each of them. A driver fix would also protect any other DXIL producer that emits these shapes.
I can run a test driver or more variants on both GPUs if that helps.