D3D12 shader compiler: 5 miscompiles of validator-passing DXIL on RX 9070 (RDNA4) and RDNA2, with repro vectors

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:

  1. 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.

  2. 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.

  3. sext i1 → i64 leaves the high dword 0x00000000 instead of 0xFFFFFFFF. Wrong on RDNA2; correct on RDNA4.

  4. WaveReadLaneFirst inside a divergent switch case returns another lane’s value (0x00000001, expected 0x7FFFFFFF). Wrong on RDNA4; correct on RDNA2.

  5. Bfrev(Countbits(0x80000000)), constant-folded, returns 0x80000001 instead of 0x80000000. Bfrev of a runtime value is correct. Wrong on RDNA4; correct on RDNA2.

Repro: GitHub - alexdeliu/rdna2-conformance: GPU driver probes for console RDNA2 -> DXIL shader translators (VIctory, XCL): which AMD/NVIDIA/Intel drivers break which DXIL · GitHub

  • cargo run --release runs 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
  • Per-bug write-up: AMD-DRIVER-BUGS.md in 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.

Hey, thanks, such a thorough report.

Since you offered to run more variants, here’s one that would help a lot. Radeon Developer Panel’s Driver Experiments can disable shader compiler optimizations, and separately floating-point optimizations, for the next app that connects. Re-running the matrix with each would hint at which bugs come from an optimization pass, which seems especially likely for bug 5’s constant fold. You can also send the same repo through the AMD Bug Report Tool, which reports bugs directly to AMD, alongside your forum post. Once again thanks for reporting.

Thanks for the pointer. I re-ran the full matrix with each experiment through RadeonDeveloperPanelCLI (Radeon Developer Tool Suite 2026-10-02-1872), with a process filter on the runner. The CLI log confirms each override was sent to the runner (“Successfully sent 1 user overrides”).

Results: no change with either experiment. All 5 bugs reproduce exactly as before, with the same failing vectors and the same wrong-output counts on both GPUs:

run RX 9070 (RDNA4) Ryzen 7 7700 iGPU (RDNA2)
default bugs 1, 2, 4, 5 bugs 1, 2, 3
dx12/Disable shader compiler optimizations=true same same
dx12/Disable floating-point optimizations=true same same

That includes bug 5: Bfrev(Countbits(0x80000000)) still returns 0x80000001 with shader compiler optimizations disabled. So if it is a constant fold, it happens in a step that this experiment doesn’t turn off.

Control, showing the experiments reach both GPUs: I used dx12/Compute shader wave size on a test whose result depends on the wave width.

  • iGPU: fails by default (wave32), passes with =2 (force 64).
  • RX 9070: passes by default (wave64), fails with =3 (force 32).

Drivers: 32.0.32029.2010 (RX 9070) and 32.0.21045.29003 (iGPU), Windows 11 Pro 26200.

I’ll also send the repo through the AMD Bug Report Tool, linking this thread. If another experiment or a test driver would help narrow these down, I’m happy to run it on both GPUs.

1 Like

More on bugs 1 and 2: they look like one bug, and plain HLSL hits it. Compiled by DXC (-T cs_6_6, default build or -Gis), the shaders below give wrong results on both GPUs when two 64-bit values are built from constant-buffer dwords that overlap. That happens with the user data in root constants and through an ordinary CBV descriptor alike:

struct UD { uint4 v; uint4 w; };
[RootSignature("RootFlags(CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED), RootConstants(num32BitConstants=8, b0)")]
[numthreads(1, 1, 1)]
void main() {
    ConstantBuffer<UD> cb = ResourceDescriptorHeap[1];   // a plain CBV
    RWByteAddressBuffer o = ResourceDescriptorHeap[cb.w.x >> 5];
    double a = asdouble(cb.v.x, cb.v.y);
    double b = asdouble(cb.v.y, cb.v.z);   // shares v.y with a
    uint lo, hi;
    asuint(a + b, lo, hi);
    o.Store(0, lo);
}

With v = (0, 0x3FF80000, 0, 0x40020000), the sum should be 1.5 (high dword 0x3FF80000). It comes out 3.0 (0x40080000), as if b were a. The uint64_t version, a = (uint64_t(v.y) << 32) | v.x and b = (uint64_t(v.z) << 32) | v.y, gets a < b wrong in the same way, for ult and slt.

plain HLSL, two 64-bit values from the same 3 dwords RX 9070 RDNA2 iGPU WARP
f64 add, dwords from a CBV or root constants wrong wrong right
i64 < (ult, slt), dwords from a CBV or root constants wrong wrong right
i64 add (low and high dword), same dwords right right right
disjoint dwords (.x,.y and .z,.w), f64 or i64 right right right
the same dwords from a UAV, per lane or uniform right right right

It doesn’t depend on fast-math: -Gis fails the same way. The wrong results match the translators’ bugs 1 and 2: the same vectors, the same counts. HLSL sources, DXIL, inputs and results are in the repo, under vectors/hlsl-cbv-* and vectors/hlsl-cbuffer-*: rdna2-conformance/AMD-DRIVER-BUGS.md at main · alexdeliu/rdna2-conformance · GitHub

Since any shader that reads doubles or 64-bit integers from a constant buffer can meet this, I hope these smaller repros help.