Skip to content

Tests: reduce fuzz seed 540, an RDNA2-only sext i1 -> i64 failure - #2170

Merged
raylitebull merged 1 commit into
xcl-dev:mainfrom
alexdeliu:tests/rdna2-sext-i1-i64
Nov 25, 2026
Merged

raylitebull merged 1 commit into
xcl-dev:mainfrom
alexdeliu:tests/rdna2-sext-i1-i64

Conversation

@alexdeliu

@alexdeliu alexdeliu commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

fuzz_validate_and_gpu_1 fails on an RDNA2 iGPU (gfx1036) at seed 540: res[833] = 0x7, CPU 0x6. Reduced, the cause is one cast. sext i1 (trunc in[lane]) to i64 gives 0x00000000_ffffffff for a set bit on AMD's RDNA2 driver: the high dword is 0, so only the low dword gets the sign. The RX 9070 (RDNA4) and WARP give 0xffffffff_ffffffff. sext i1 -> i32 is right on all three. Seed 540 itself then computes ashr(s, 63) - (-7), which reads 7 instead of 6.

This adds seed 540's shape to amd_reduced_seeds, next to 722 and 1599 (which fail only on RDNA4). It stays #[ignore] like the rest of that test. As far as I can see, no lowering emits sext i1 -> i64 today: sext64's callers in dxil/lower*.rs pass i32 values. So this documents a driver bug for anyone who adds such a cast; it fixes nothing at run time.

What is in it

  • crates/xcl/src/gpu/dxil/fuzz_tests.rs: an s540 shape with two variants in amd_reduced_seeds, the full seed 540 in its full-seed loop, and the doc comment naming which seeds fail on which GPU.

Tested

  • One machine: AMD Radeon RX 9070 (RDNA4, 32.0.32029.2010) and the Ryzen 7 7700 iGPU (gfx1036, 32.0.21045.29003). Windows 11 Pro 26200, rustc 1.100.0 msvc, debug, Windows SDK 10.0.26100 DXC (validator 1.7).
  • cargo test -p xcl --lib gpu::dxil::fuzz_tests::amd_reduced_seeds -- --ignored --nocapture:
    • XCL_ADAPTER=1 (gfx1036): both 540 variants and full seed 540 FAIL (res[64] = 0x0, CPU 0xffffffff); every 722 / 1599 variant and both full seeds PASS.
    • RX 9070: both 540 variants and full seed 540 PASS; both 722 variants, the two 1599 -> shift / Bfrev variants and both full seeds FAIL, as on main.
    • WARP: skipped (no wave32 GPU).
  • cargo test --workspace -- --test-threads=4 on this branch, RX 9070: 1152 passed, 2 failed, 46 ignored, 90 SKIPPED (81 of them because validator 1.7 < 1.8), the same as main. The 2 failures are fuzz_validate_and_gpu_1 / _3 (seeds 722 / 1599, RDNA4), as on main.

Not tested

  • (Rerun after the rebase: cargo test --workspace -- --test-threads=4 at this head on main 568e7db, RX 9070: 1152 passed, 2 failed (seeds 722 / 1599, as on main), 46 ignored, 90 SKIPPED.)
  • NVIDIA and Intel. Other RDNA2 parts (only the gfx1036 iGPU, one driver).
  • No retail title. The change is test-only.

AI use

  • Claude Code with Claude Opus 5.5 wrote the code, the tests and this description, and ran the tests above. The contributor opened it after reading the summary of the findings.

🤖 Generated with Claude Code

On a gfx1036 iGPU (driver 32.0.21045.29003), sext i1 -> i64 gives
0x00000000_ffffffff for a set bit (the high dword stays 0); an RX 9070
and WARP give 0xffffffff_ffffffff. Seed 540 then reads 7 for
ashr(s, 63) - (-7). Adds that shape to amd_reduced_seeds next to 722 and
1599 (which fail only on RDNA4), and seed 540 to its full-seed loop.

Assisted-by: Claude Code (Claude Opus 5.5)
@luckyteagirl

Copy link
Copy Markdown
Contributor

Independent RX 6800M run of the ignored reduced-seed test on exact PR head 2fe270de82b9bef9d883eb1a196b91bb82b601d5, plus a separate diagnostic control with the existing #1974 fix applied.

Tested

  • Windows 11 build 26200; Ryzen 9 5980HX; Radeon RX 6800M (RDNA2) driver 30.0.13002.13003; Rust 1.99.0 MSVC; DXC/DXIL 1.9.2609.5. XCL_ADAPTER=6800M, XCL_DIRECT_DXIL=1.
  • On the clean Tests: reduce fuzz seed 540, an RDNA2-only sext i1 -> i64 failure #2170 head, cargo test --locked -p xcl --lib -j 2 amd_reduced_seeds -- --ignored --test-threads=1 --show-output exited 101 (0 passed, 1 failed). Both new reduced 540 variants failed: bare sext i1 -> i64 at res[64] = 0x0 vs CPU 0xffffffff, and the shift/subtract form at res[0] = 0x7 vs CPU 0x6. All five 722/1599 reduced variants passed. The subsequent full seed 540 did not yield a value comparison: CreateComputePipelineState returned device suspension 0x887A0005.
  • Diagnostic control: on a separate Tests: reduce fuzz seed 540, an RDNA2-only sext i1 -> i64 failure #2170 worktree, I cherry-picked Direct DXIL: sign-extend i1 to i64 through i32 #1974 commit 848ac65b9a2061c01f4fc7574ab3a156fce5abc6 without committing. It changes only dxil/module.rs and adds its ops_tests.rs test. The same ignored command then reported PASS for both reduced 540 variants and the same five 722/1599 variants. The aggregate still exited 101 because full seed 540 again hit device suspension 0x887A0005; it is not a full-seed pass.

This extends the reported reduced 540 behavior from a gfx1036 iGPU to an RX 6800M dGPU on this older driver and directly checks that the existing i1 sign-extension fix in #1974 clears the reduced cases. I did not run a full workspace suite or retail title for this test-only PR. The full seed's device-suspension cause remains unresolved by this comparison.

AI-assisted checkout, testing, result comparison, and report drafting with OpenAI Codex (GPT-6). No game data was used.

@DavidM1911

Copy link
Copy Markdown
Contributor

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

Thanks!

@alexdeliu

Copy link
Copy Markdown
Contributor Author

Related: #1974 (Direct DXIL: sign-extend i1 to i64 through i32) is the fix for this case. With #1974 applied, both 540 variants and full seed 540 pass on the gfx1036, as they did on @luckyteagirl's RX 6800M. So this PR is the GPU regression test for #1974; results are on that PR. If #1974 lands first, amd_reduced_seeds stays green on RDNA2 for seed 540.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants