Test report and cross-device VALU fuzz: RX 9070 (RDNA4) + gfx1036 iGPU (RDNA2) + WARP at 71652a2 #82

Open
opened 2026-11-26 03:35:13 +00:00 by github-bot · 0 comments
Owner

@⁠alexdeliu on GitHub · 2026-11-25 13:35 UTC · original

One machine: an RX 9070 (RDNA4, the same family as this fork's RX 9070 XT, driver 32.0.32029.2010), a Ryzen 7 7700 iGPU (gfx1036, RDNA2, the console's architecture, driver 32.0.21045.29003), and WARP. Windows 11. No game data.

Test suite (cargo test -p victory-shader --lib, unmodified 71652a2, VICTORY_DXIL = dxil.dll 1.8.2502.11)

  • RX 9070: 266 passed, 0 failed, 6 ignored. With the Windows SDK's older dxil.dll, 5 tests fail instead, at the validator (PSV0 mismatch): 3 barycentric_tests, packed_halves_with_row2_equal_to_row_read_the_unlisted_partner and rectangle_geometry_validates. That may explain similar reports from other testers.
  • gfx1036 (VICTORY_ADAPTER=radeon(tm), --test-threads=1): 264 passed and 2 failed. The 2 are the wave-size tests from #2: scalar_counted_in_a_divergent_loop_read_after_it and scalar_counted_in_nested_divergent_loops. So #2 reproduces on a second RDNA2 GPU, and both tests pass on RDNA4.
  • Run in parallel, the suite twice ended with 0xc0000005 mid-run (once per GPU). Serial reruns were clean.

Fuzz

This is the fuzzer from Marvisak/VIctory#1614, run on this fork: 307 opcodes, 160 inputs each, compared bit for bit across the three devices. 38 opcodes differ.

  1. Both AMD GPUs give wrong results, and WARP and the CPU agree: the 8 ordered v_cmp_*_{i64,u64}. The cause is AMD's compiler mis-ordering an i64 compare when the two operands share a dword. Fixed in #81 (a port of VIctory#1599, with a GPU test that fails here on both AMD GPUs and passes with the PR).

  2. 16 opcodes differ here but agree on upstream main 940d32f (same fuzzer, same machine). Upstream fixed these after this fork's base 8e79c80, among other places in 77053a0 (f16 rounding, f32 min/max denormals, med3):

    • v_min_f32, v_max_f32, v_min3_f32, v_max3_f32, v_med3_f32;
    • v_add_f16, v_sub_f16, v_subrev_f16, v_pk_add_f16;
    • v_fma_legacy_f32, v_fmac_legacy_f32;
    • v_fma_f16, v_fmac_f16, v_pk_fma_f16, v_pk_fmac_f16, v_fma_mix{lo,hi}_f16.

    In the f16 FMA family it is the gfx1036 that differs from the RX 9070 and WARP.

  3. This fork's own f64 lowering: v_add_f64 and v_mul_f64 (upstream refuses them). With separate source pairs (v[1:2], v[3:4]) all three devices match the CPU. With source pairs sharing a dword (v[1:2], v[2:3]), the RX 9070 is wrong. For example, 1.5 + makeDouble(0x3ff80000, 0) gives the high dword 0x40080000 (3.0), as if both operands were v[1:2]. The gfx1036 is right through this fork's i64 path, but goes wrong too when the dwords are passed to makeDouble directly. So this is the same family of AMD compiler bug, and I have no clean workaround yet. It matters only if titles use overlapping f64 pairs. Standalone DXIL vectors made from this fork's lowering, with disjoint controls, are in rdna2-conformance (bug 2). The same operation written in HLSL passes everywhere.

  4. WARP alone differs; known and harmless for AMD: v_cubesc/tc_f32, v_sin/cos_f32, v_sin_f16, v_cvt_f32_u32, v_log_f32, and both v_cvt f32/f64 conversions. v_cmp_f/v_cmp_tru (f16 and f32) suspend the WARP device (upstream VIctory#1326).

The full report, with the inputs and the instruction words of each finding: results/2026-11-25-fuzz-belobug-71652a2.md.

AI use: Claude Code (Claude Opus 5.5) ran this on my machine.

**@⁠alexdeliu** on GitHub · 2026-11-25 13:35 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/issues/82) One machine: an RX 9070 (RDNA4, the same family as this fork's RX 9070 XT, driver 32.0.32029.2010), a Ryzen 7 7700 iGPU (gfx1036, RDNA2, the console's architecture, driver 32.0.21045.29003), and WARP. Windows 11. No game data. ## Test suite (`cargo test -p victory-shader --lib`, unmodified 71652a2, `VICTORY_DXIL` = dxil.dll 1.8.2502.11) - RX 9070: 266 passed, 0 failed, 6 ignored. With the Windows SDK's older `dxil.dll`, 5 tests fail instead, at the validator (PSV0 mismatch): 3 `barycentric_tests`, `packed_halves_with_row2_equal_to_row_read_the_unlisted_partner` and `rectangle_geometry_validates`. That may explain similar reports from other testers. - gfx1036 (`VICTORY_ADAPTER=radeon(tm)`, `--test-threads=1`): 264 passed and 2 failed. The 2 are the wave-size tests from #2: `scalar_counted_in_a_divergent_loop_read_after_it` and `scalar_counted_in_nested_divergent_loops`. So #2 reproduces on a second RDNA2 GPU, and both tests pass on RDNA4. - Run in parallel, the suite twice ended with `0xc0000005` mid-run (once per GPU). Serial reruns were clean. ## Fuzz This is the fuzzer from Marvisak/VIctory#1614, run on this fork: 307 opcodes, 160 inputs each, compared bit for bit across the three devices. 38 opcodes differ. 1. **Both AMD GPUs give wrong results, and WARP and the CPU agree: the 8 ordered `v_cmp_*_{i64,u64}`.** The cause is AMD's compiler mis-ordering an i64 compare when the two operands share a dword. Fixed in #81 (a port of VIctory#1599, with a GPU test that fails here on both AMD GPUs and passes with the PR). 2. **16 opcodes differ here but agree on upstream `main` 940d32f** (same fuzzer, same machine). Upstream fixed these after this fork's base `8e79c80`, among other places in `77053a0` (f16 rounding, f32 min/max denormals, med3): - `v_min_f32`, `v_max_f32`, `v_min3_f32`, `v_max3_f32`, `v_med3_f32`; - `v_add_f16`, `v_sub_f16`, `v_subrev_f16`, `v_pk_add_f16`; - `v_fma_legacy_f32`, `v_fmac_legacy_f32`; - `v_fma_f16`, `v_fmac_f16`, `v_pk_fma_f16`, `v_pk_fmac_f16`, `v_fma_mix{lo,hi}_f16`. In the f16 FMA family it is the gfx1036 that differs from the RX 9070 and WARP. 3. **This fork's own f64 lowering:** `v_add_f64` and `v_mul_f64` (upstream refuses them). With separate source pairs (`v[1:2]`, `v[3:4]`) all three devices match the CPU. With source pairs sharing a dword (`v[1:2]`, `v[2:3]`), the RX 9070 is wrong. For example, `1.5 + makeDouble(0x3ff80000, 0)` gives the high dword `0x40080000` (3.0), as if both operands were `v[1:2]`. The gfx1036 is right through this fork's i64 path, but goes wrong too when the dwords are passed to `makeDouble` directly. So this is the same family of AMD compiler bug, and I have no clean workaround yet. It matters only if titles use overlapping f64 pairs. Standalone DXIL vectors made from this fork's lowering, with disjoint controls, are in [rdna2-conformance](https://github.com/alexdeliu/rdna2-conformance/blob/main/AMD-DRIVER-BUGS.md) (bug 2). The same operation written in HLSL passes everywhere. 4. **WARP alone differs; known and harmless for AMD:** `v_cubesc/tc_f32`, `v_sin/cos_f32`, `v_sin_f16`, `v_cvt_f32_u32`, `v_log_f32`, and both `v_cvt` f32/f64 conversions. `v_cmp_f`/`v_cmp_tru` (f16 and f32) suspend the WARP device (upstream VIctory#1326). The full report, with the inputs and the instruction words of each finding: [results/2026-11-25-fuzz-belobug-71652a2.md](https://github.com/alexdeliu/rdna2-conformance/blob/main/results/2026-11-25-fuzz-belobug-71652a2.md). AI use: Claude Code (Claude Opus 5.5) ran this on my machine.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:35:13 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.