Recompiler tests: GPU checks for VOP3 bit-field, perm, align and min3/max3/med3 #445

Open
github-bot wants to merge 1 commit from github-bot/gh-445 into main AGit
Owner

@⁠AC-Storm-YT on GitHub · 2026-11-24 00:22 UTC · original
AC-Storm-YT:recomp-vop3-int-tests → main · +88 −0 · 1 files · 1 commits · open

Eleven 32-bit VOP3 integer instructions the recompiler translates had no test: v_bfi_b32, v_bfm_b32, v_perm_b32, v_alignbit_b32, v_alignbyte_b32 and v_min3 / v_max3 / v_med3 for u32 and i32. This adds one GPU test for them. Test only: nothing outside tests.rs changes.

What is in it

  • gpu_vop3_integer_bit_and_minmax3 (crates/xcl/src/gpu/recomp/tests.rs): one kernel with all eleven instructions, run as wave64 and wave32 (gpu_waves), 32 dispatches of operand triples from a fixed LCG – edge values (0, 1, 31, 32, 33, 0x7FFFFFFF, 0x80000000, 0xFFFFFFFF, every v_perm_b32 selector kind: bytes 0..7, the sign selectors 8..11, 12 and 13+) mixed with arbitrary words. Each result is compared bit for bit with the instruction's RDNA2 definition computed on the CPU (not with the emitted HLSL).

Tested

  • AMD Radeon RX 9070 XT (RDNA4, wave64), driver 32.0.32029.2010; AMD Ryzen 7 9800X3D; Windows 11 Pro build 26200; Rust 1.100.0 stable-x86_64-pc-windows-msvc, debug; DXC 1.8.2502.11
  • cargo test --workspace -- --test-threads=4 on this branch's head: 677 passed, 0 failed, 41 ignored. No SKIPPED tests.
  • The new test fails when the emitter is broken: with each of these changes made to emit.rs by hand (and reverted), it reported wrong results for that instruction – v_med3_i32 compared unsigned (1407 results), v_perm_b32 selector 8 reading s0 (37), v_alignbyte_b32 shifting by 4 bits a byte (1215), v_bfm_b32 with the wrong zero-width case (488), v_max3_u32 ignoring src2 (629).

Regression run
Not needed: the PR changes only crates/xcl/src/gpu/recomp/tests.rs.

Not tested

  • NVIDIA / Intel and wave32-only GPUs: wave32 ran on the RX 9070 XT only.
  • Operand modifiers (neg / abs / clamp / op_sel) and inline-constant or SGPR operands: every source is a VGPR.

AI use

  • Claude Code with Claude Opus 5.5 wrote the test and this description, and ran the tests and the emitter-break checks on my machine. I can't review the bit-level semantics myself.
**@⁠AC-Storm-YT** on GitHub · 2026-11-24 00:22 UTC · [original](https://github.com/xcl-dev/xcl/pull/445) `AC-Storm-YT:recomp-vop3-int-tests` → `main` · +88 −0 · 1 files · 1 commits · open Eleven 32-bit VOP3 integer instructions the recompiler translates had no test: `v_bfi_b32`, `v_bfm_b32`, `v_perm_b32`, `v_alignbit_b32`, `v_alignbyte_b32` and `v_min3` / `v_max3` / `v_med3` for `u32` and `i32`. This adds one GPU test for them. Test only: nothing outside `tests.rs` changes. **What is in it** - `gpu_vop3_integer_bit_and_minmax3` (`crates/xcl/src/gpu/recomp/tests.rs`): one kernel with all eleven instructions, run as wave64 and wave32 (`gpu_waves`), 32 dispatches of operand triples from a fixed LCG – edge values (0, 1, 31, 32, 33, `0x7FFFFFFF`, `0x80000000`, `0xFFFFFFFF`, every `v_perm_b32` selector kind: bytes 0..7, the sign selectors 8..11, 12 and 13+) mixed with arbitrary words. Each result is compared bit for bit with the instruction's RDNA2 definition computed on the CPU (not with the emitted HLSL). **Tested** - AMD Radeon RX 9070 XT (RDNA4, wave64), driver 32.0.32029.2010; AMD Ryzen 7 9800X3D; Windows 11 Pro build 26200; Rust 1.100.0 `stable-x86_64-pc-windows-msvc`, debug; DXC 1.8.2502.11 - `cargo test --workspace -- --test-threads=4` on this branch's head: 677 passed, 0 failed, 41 ignored. No SKIPPED tests. - The new test fails when the emitter is broken: with each of these changes made to `emit.rs` by hand (and reverted), it reported wrong results for that instruction – `v_med3_i32` compared unsigned (1407 results), `v_perm_b32` selector 8 reading `s0` (37), `v_alignbyte_b32` shifting by 4 bits a byte (1215), `v_bfm_b32` with the wrong zero-width case (488), `v_max3_u32` ignoring `src2` (629). **Regression run** Not needed: the PR changes only `crates/xcl/src/gpu/recomp/tests.rs`. **Not tested** - NVIDIA / Intel and wave32-only GPUs: wave32 ran on the RX 9070 XT only. - Operand modifiers (neg / abs / clamp / op_sel) and inline-constant or SGPR operands: every source is a VGPR. **AI use** - Claude Code with Claude Opus 5.5 wrote the test and this description, and ran the tests and the emitter-break checks on my machine. I can't review the bit-level semantics myself.
v_bfi_b32, v_bfm_b32, v_perm_b32, v_alignbit_b32, v_alignbyte_b32 and
v_min3 / v_max3 / v_med3 (u32 and i32) are translated but had no test.
One kernel runs all eleven as wave64 and wave32 over 32 dispatches of
operand triples (edge values and every v_perm_b32 selector kind, mixed
with arbitrary words by a fixed LCG), and compares each result with the
instruction's RDNA2 definition computed on the CPU.

Checked that it fails when the emitter is broken: v_med3_i32 compared
unsigned, v_perm_b32 selector 8 reading s0, v_alignbyte_b32 shifting by
4 bits a byte, v_bfm_b32's zero-width case and v_max3_u32 ignoring src2
each made it report wrong results.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:22:02 +00:00
Author
Owner

@⁠PHeitor1 on GitHub · 2026-11-24 00:44 UTC · original

Tested 77eab20 merged onto main 2997c9a.

RTX 5060 Ti 8 GB (Blackwell, 32-lane waves), NVIDIA 621.24, Ryzen 5 5600X, Windows 11 Pro 26300 (native, Graphics Tools + XGameRuntime installed, so the debug-layer tests run), rustc 1.100.0 MSVC, debug, cargo test --workspace --no-fail-fast -- --test-threads=4, no XCL_SAMPLE_*.

Pass: 677 passed, 0 failed, 41 ignored. SKIPPED: only the 2 no wave64 tests (gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware). gpu_vop3_integer_bit_and_minmax3 runs on the GPU and passes. Build clean.

Run and written with Claude Code (Claude Opus 5.5).

**@⁠PHeitor1** on GitHub · 2026-11-24 00:44 UTC · [original](https://github.com/xcl-dev/xcl/pull/445#issuecomment-7118382181) Tested `77eab20` merged onto `main` `2997c9a`. RTX 5060 Ti 8 GB (Blackwell, 32-lane waves), NVIDIA 621.24, Ryzen 5 5600X, Windows 11 Pro 26300 (native, Graphics Tools + XGameRuntime installed, so the debug-layer tests run), rustc 1.100.0 MSVC, debug, `cargo test --workspace --no-fail-fast -- --test-threads=4`, no `XCL_SAMPLE_*`. **Pass:** 677 passed, 0 failed, 41 ignored. SKIPPED: only the 2 `no wave64` tests (`gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`). `gpu_vop3_integer_bit_and_minmax3` runs on the GPU and passes. Build clean. _Run and written with Claude Code (Claude Opus 5.5)._
Author
Owner

@⁠CryingLaughing on GitHub · 2026-11-24 01:01 UTC · original

The exact PR head 77eab20adfdb2472c77a747db16c3e9e6e7fabb4 passed on an RTX 4080. This adds Ada wave32 coverage alongside the RDNA4 and Blackwell runs above.

Tested

  • NVIDIA RTX 4080, driver 621.01, Core i5-13600K, Windows 11 25H2 build 26200.9974, Rust 1.100.0 MSVC x64, DXC 1.8.2502.11, debug. XCL_ADAPTER=4080, synthetic fixtures, all XCL_SAMPLE_* variables unset.
  • cargo test -p xcl --lib --locked -j 4 gpu_vop3_integer_bit_and_minmax3 -- --show-output passed 1/1 on native wave32. The fixture checks 11 instructions across 32 waves of 32 lane inputs against Rust results.
  • cargo build --workspace --locked -j 4 passed. cargo test --workspace --locked -j 4 -- --test-threads=4 --show-output reported 677 passed, 0 failed, 41 ignored. That includes four explicit capability skips and opt-in game-data tests that returned early.
  • SKIPPED for native wave64: gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware. SKIPPED for D3D12 debug-layer availability: test_title_draws_with_a_root_signature_under_the_debug_layer and uploads_start_from_each_subresources_state.

Not tested

  • Native wave64, other adapters, release builds, retail titles.

AI use

  • OpenAI Codex (GPT-6 family, exact variant unavailable) ran the commands, checked the logs, and drafted this report.
**@⁠CryingLaughing** on GitHub · 2026-11-24 01:01 UTC · [original](https://github.com/xcl-dev/xcl/pull/445#issuecomment-7118667873) The exact PR head `77eab20adfdb2472c77a747db16c3e9e6e7fabb4` passed on an RTX 4080. This adds Ada wave32 coverage alongside the RDNA4 and Blackwell runs above. **Tested** - NVIDIA RTX 4080, driver 621.01, Core i5-13600K, Windows 11 25H2 build 26200.9974, Rust 1.100.0 MSVC x64, DXC 1.8.2502.11, debug. `XCL_ADAPTER=4080`, synthetic fixtures, all `XCL_SAMPLE_*` variables unset. - `cargo test -p xcl --lib --locked -j 4 gpu_vop3_integer_bit_and_minmax3 -- --show-output` passed 1/1 on native wave32. The fixture checks 11 instructions across 32 waves of 32 lane inputs against Rust results. - `cargo build --workspace --locked -j 4` passed. `cargo test --workspace --locked -j 4 -- --test-threads=4 --show-output` reported 677 passed, 0 failed, 41 ignored. That includes four explicit capability skips and opt-in game-data tests that returned early. - `SKIPPED` for native wave64: `gpu_geometry_wave32_prefix_count_over_a_mask` and `gpu_wave32_program_in_wave64_hardware`. `SKIPPED` for D3D12 debug-layer availability: `test_title_draws_with_a_root_signature_under_the_debug_layer` and `uploads_start_from_each_subresources_state`. **Not tested** - Native wave64, other adapters, release builds, retail titles. **AI use** - OpenAI Codex (GPT-6 family, exact variant unavailable) ran the commands, checked the logs, and drafted this report.
Author
Owner

@⁠13hourstilliland on GitHub · 2026-11-24 01:35 UTC · original

Adding an Ampere 8 GB (RTX 3070, 32-lane waves) run on the exact PR head 77eab20.

Tested

  • Commit: 77eab20adfdb2472c77a747db16c3e9e6e7fabb4 (PR #445 head), clean worktree
  • Hardware: NVIDIA GeForce RTX 3070 8 GB, driver 610.88; Intel Core i5-12600K, 31.8 GB RAM; Windows 11 Home build 26200.9974
  • Toolchain: Rust 1.100.0 (stable-x86_64-pc-windows-gnu, not MSVC); DXC 1.9.2609.5 (01b62ad4) via XCL_DXC_DIR; debug build; no XCL_SAMPLE_* set
  • Targeted command: cargo test -p xcl --lib -- gpu_vop3_integer_bit_and_minmax3 --show-output
    • Result: 1 passed, 0 failed, 0 ignored (ran on the GPU, no skip)
  • Full workspace command: cargo test --workspace --no-fail-fast -- --test-threads=4 --show-output (interactive desktop session)
    • Result: 677 passed, 0 failed, 41 ignored across 16 test binaries (xcl lib: 637 passed, 0 failed, 21 ignored; e2e: 3/0)
  • SKIPPED (4, not coverage):
    • no wave64 (2): gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask, gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware
    • no D3D12 debug layer (2): test_title_draws_with_a_root_signature_under_the_debug_layer, uploads_start_from_each_subresources_state

Not tested

  • AMD / wave64 hardware, MSVC toolchain, release build, retail title / scripts/smoke.ps1, D3D12 debug-layer tests

AI use

  • Hermes Agent, gemini-4-neon: ran the commands and wrote this report from the logs; the human reviewed it.
**@⁠13hourstilliland** on GitHub · 2026-11-24 01:35 UTC · [original](https://github.com/xcl-dev/xcl/pull/445#issuecomment-7119245119) Adding an Ampere 8 GB (RTX 3070, 32-lane waves) run on the exact PR head `77eab20`. **Tested** - Commit: `77eab20adfdb2472c77a747db16c3e9e6e7fabb4` (PR #445 head), clean worktree - Hardware: NVIDIA GeForce RTX 3070 8 GB, driver 610.88; Intel Core i5-12600K, 31.8 GB RAM; Windows 11 Home build 26200.9974 - Toolchain: Rust 1.100.0 (`stable-x86_64-pc-windows-gnu`, not MSVC); DXC 1.9.2609.5 (`01b62ad4`) via `XCL_DXC_DIR`; debug build; no `XCL_SAMPLE_*` set - Targeted command: `cargo test -p xcl --lib -- gpu_vop3_integer_bit_and_minmax3 --show-output` - Result: **1 passed, 0 failed, 0 ignored** (ran on the GPU, no skip) - Full workspace command: `cargo test --workspace --no-fail-fast -- --test-threads=4 --show-output` (interactive desktop session) - Result: **677 passed, 0 failed, 41 ignored** across 16 test binaries (`xcl` lib: 637 passed, 0 failed, 21 ignored; `e2e`: 3/0) - `SKIPPED` (4, not coverage): - `no wave64` (2): `gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware` - `no D3D12 debug layer` (2): `test_title_draws_with_a_root_signature_under_the_debug_layer`, `uploads_start_from_each_subresources_state` **Not tested** - AMD / wave64 hardware, MSVC toolchain, release build, retail title / `scripts/smoke.ps1`, D3D12 debug-layer tests **AI use** - Hermes Agent, `gemini-4-neon`: ran the commands and wrote this report from the logs; the human reviewed it.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 14:15 UTC · original

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

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-25 14:15 UTC · [original](https://github.com/xcl-dev/xcl/pull/445#issuecomment-7165004221) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/445/head:github-bot/gh-445'
git switch 'github-bot/gh-445'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-445'
git switch 'github-bot/gh-445'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-445'
git switch 'github-bot/gh-445'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-445'
git switch 'main'
git merge --squash 'github-bot/gh-445'
git switch 'main'
git merge --ff-only 'github-bot/gh-445'
git switch 'main'
git merge 'github-bot/gh-445'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.