Recompiler tests: GPU checks for 32-bit high and 24-bit VOP3 multiplies #590

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

@⁠13hourstilliland on GitHub · 2026-11-24 02:12 UTC · original
13hourstilliland:recomp-vop3-mul-hi-i24-tests → main · +77 −0 · 1 files · 1 commits · open

Adds a GPU test for six RDNA2 VOP3 multiply/mad instructions that emit.rs already translates but no test runs: v_mul_hi_u32, v_mul_hi_i32, v_mul_hi_u32_u24, v_mul_i32_i24, v_mul_hi_i32_i24 and v_mad_i32_i24. Test only, no runtime change.

What is in it

  • gpu_vop3_mul_hi_and_24bit in crates/xcl/src/gpu/recomp/tests.rs: one kernel with all six instructions, run as wave64 where the adapter has it and as wave32 everywhere (gpu_waves), 32 waves of operand triples from a fixed LCG mixed with 24-bit and 32-bit sign/mask boundaries (0, 1, 2, 0x007FFFFF, 0x00800000, 0x00FFFFFF, 0x01000000, 0xFF800000, 0x7FFFFFFF, 0x80000000, 0xFFFFFFFF, 0xA55AC33C), each lane compared with the RDNA2 definition computed on the CPU.
  • A failure lists the instruction, wave size, lane, operands, result and expected value.
  • Placed after gpu_valu_float_and_int, away from #545 and #445, so it does not conflict with them.
  • Mutation-checked on a local copy (reverted before commit): mutating any one of the six emit.rs expressions fails the test and names only that instruction (v_mul_hi_u32: 949/1024, v_mul_hi_i32: 669/1024, v_mul_hi_u32_u24: 807/1024, v_mul_i32_i24: 621/1024, v_mul_hi_i32_i24: 621/1024, v_mad_i32_i24: 954/1024 mismatches).

Tested

  • NVIDIA GeForce RTX 3070 8 GB, driver 610.88; Intel Core i5-12600K; Windows 11 Home build 26200
  • Rust 1.100.0 stable-x86_64-pc-windows-gnu (MinGW linker), DXC 1.9.2609.5, debug build, commit 1abd49b (on main 508a0c7)
  • cargo build --workspace + cargo test --workspace --no-fail-fast -- --test-threads=4 (with cargo test -p xcl --test e2e -- --test-threads=1 run in the interactive desktop session): 681 passed, 0 failed, 41 ignored (lib: 641 passed, 0 failed, 21 ignored; gpu_vop3_mul_hi_and_24bit passed in 0.31s; e2e 3 of 3 passed in 11.60s; every other integration binary passed; 0 Display 4101 TDRs)
  • SKIPPED (no wave64 on this GPU): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware

Not tested

  • The wave64 path: the RTX 3070 has 32-lane waves only, so the test ran as wave32. Not run on AMD.
  • The MSVC toolchain (stable-x86_64-pc-windows-msvc): built with the GNU toolchain only.
  • A release build.
  • A retail title: not needed for a test-only change (no crates/xcl/src runtime file changes).

AI use

  • Hermes Agent with gemini-4-neon: wrote the test, ran the tests and 6-op mutation checks on the hardware above, and wrote this description.
**@⁠13hourstilliland** on GitHub · 2026-11-24 02:12 UTC · [original](https://github.com/xcl-dev/xcl/pull/590) `13hourstilliland:recomp-vop3-mul-hi-i24-tests` → `main` · +77 −0 · 1 files · 1 commits · open Adds a GPU test for six RDNA2 VOP3 multiply/mad instructions that `emit.rs` already translates but no test runs: `v_mul_hi_u32`, `v_mul_hi_i32`, `v_mul_hi_u32_u24`, `v_mul_i32_i24`, `v_mul_hi_i32_i24` and `v_mad_i32_i24`. Test only, no runtime change. **What is in it** - `gpu_vop3_mul_hi_and_24bit` in `crates/xcl/src/gpu/recomp/tests.rs`: one kernel with all six instructions, run as wave64 where the adapter has it and as wave32 everywhere (`gpu_waves`), 32 waves of operand triples from a fixed LCG mixed with 24-bit and 32-bit sign/mask boundaries (`0`, `1`, `2`, `0x007FFFFF`, `0x00800000`, `0x00FFFFFF`, `0x01000000`, `0xFF800000`, `0x7FFFFFFF`, `0x80000000`, `0xFFFFFFFF`, `0xA55AC33C`), each lane compared with the RDNA2 definition computed on the CPU. - A failure lists the instruction, wave size, lane, operands, result and expected value. - Placed after `gpu_valu_float_and_int`, away from `#545` and `#445`, so it does not conflict with them. - Mutation-checked on a local copy (reverted before commit): mutating any one of the six `emit.rs` expressions fails the test and names only that instruction (`v_mul_hi_u32`: 949/1024, `v_mul_hi_i32`: 669/1024, `v_mul_hi_u32_u24`: 807/1024, `v_mul_i32_i24`: 621/1024, `v_mul_hi_i32_i24`: 621/1024, `v_mad_i32_i24`: 954/1024 mismatches). **Tested** - NVIDIA GeForce RTX 3070 8 GB, driver 610.88; Intel Core i5-12600K; Windows 11 Home build 26200 - Rust 1.100.0 `stable-x86_64-pc-windows-gnu` (MinGW linker), DXC 1.9.2609.5, debug build, commit 1abd49b (on main 508a0c7) - `cargo build --workspace` + `cargo test --workspace --no-fail-fast -- --test-threads=4` (with `cargo test -p xcl --test e2e -- --test-threads=1` run in the interactive desktop session): **681 passed, 0 failed, 41 ignored** (lib: 641 passed, 0 failed, 21 ignored; `gpu_vop3_mul_hi_and_24bit` passed in 0.31s; `e2e` 3 of 3 passed in 11.60s; every other integration binary passed; 0 Display 4101 TDRs) - `SKIPPED` (no wave64 on this GPU): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware` **Not tested** - The wave64 path: the RTX 3070 has 32-lane waves only, so the test ran as wave32. Not run on AMD. - The MSVC toolchain (`stable-x86_64-pc-windows-msvc`): built with the GNU toolchain only. - A release build. - A retail title: not needed for a test-only change (no `crates/xcl/src` runtime file changes). **AI use** - Hermes Agent with gemini-4-neon: wrote the test, ran the tests and 6-op mutation checks on the hardware above, and wrote this description.
v_mul_hi_u32, v_mul_hi_i32, v_mul_hi_u32_u24, v_mul_i32_i24,
v_mul_hi_i32_i24 and v_mad_i32_i24 are translated by emit.rs but had no
GPU test. The new test runs all six in one kernel, as wave64 where the
adapter has it and as wave32 everywhere, over 32 waves of operand
triples from a fixed LCG mixed with 24-bit and 32-bit sign/mask edge
values (0, 1, 2, 0x007FFFFF, 0x00800000, 0x00FFFFFF, 0x01000000,
0xFF800000, 0x7FFFFFFF, 0x80000000, 0xFFFFFFFF), comparing every lane
with the RDNA2 definition computed on the CPU.

Measured on an RTX 3070 (wave32 only): passes against the current
emitter, and fails naming the broken instruction when any one of the
six emitter expressions is mutated (621 to 954 of 1024 lane results
wrong).

Assisted-by: Hermes Agent (gemini-4-neon)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:26:33 +00:00
Author
Owner

@⁠fladit123 on GitHub · 2026-11-24 02:19 UTC · original

Independent RTX 4060 validation of PR #590 in both debug and release using the MSVC toolchain.

Tested

  • Commit: 1abd49b5446a17e5285b9322962d15885065241f
  • GPU: NVIDIA GeForce RTX 4060 8 GB (Ada Lovelace, wave32), driver 610.88
  • CPU: Intel Core i5-12400F
  • RAM: 32 GB
  • Windows 11 Pro build 26300
  • Rust 1.100.0, x86_64-pc-windows-msvc
  • DXC 1.8.2502.11
  • XCL_ADAPTER=4060

Commands

cargo test -p xcl --lib --locked gpu_vop3_mul_hi_and_24bit -- --test-threads=1 --show-output
cargo test --release -p xcl --lib --locked gpu_vop3_mul_hi_and_24bit -- --test-threads=1 --show-output
Profile Passed Failed Reported skips Test time
Debug 1 0 0 0.88 s
Release 1 0 0 0.91 s

Both commands exited with code 0. The test covers six instructions across 1,024 lane operand triples per wave32 execution, corresponding to 6,144 GPU/CPU result comparisons per profile.

The worktree remained clean.

Not tested: native wave64, AMD/Intel adapters, mutation checks, full workspace suite or retail titles.

No blocking findings within the tested scope.

AI use: ChatGPT (GPT-6.2) assisted with diff review, test planning and report preparation. All commands were executed locally by me.

**@⁠fladit123** on GitHub · 2026-11-24 02:19 UTC · [original](https://github.com/xcl-dev/xcl/pull/590#issuecomment-7120017379) Independent RTX 4060 validation of PR #590 in both debug and release using the MSVC toolchain. **Tested** - Commit: `1abd49b5446a17e5285b9322962d15885065241f` - GPU: NVIDIA GeForce RTX 4060 8 GB (Ada Lovelace, wave32), driver 610.88 - CPU: Intel Core i5-12400F - RAM: 32 GB - Windows 11 Pro build 26300 - Rust 1.100.0, `x86_64-pc-windows-msvc` - DXC 1.8.2502.11 - `XCL_ADAPTER=4060` **Commands** ```powershell cargo test -p xcl --lib --locked gpu_vop3_mul_hi_and_24bit -- --test-threads=1 --show-output cargo test --release -p xcl --lib --locked gpu_vop3_mul_hi_and_24bit -- --test-threads=1 --show-output ``` | Profile | Passed | Failed | Reported skips | Test time | |---|---:|---:|---:|---:| | Debug | 1 | 0 | 0 | 0.88 s | | Release | 1 | 0 | 0 | 0.91 s | Both commands exited with code 0. The test covers six instructions across 1,024 lane operand triples per wave32 execution, corresponding to 6,144 GPU/CPU result comparisons per profile. The worktree remained clean. **Not tested:** native wave64, AMD/Intel adapters, mutation checks, full workspace suite or retail titles. No blocking findings within the tested scope. **AI use:** ChatGPT (GPT-6.2) assisted with diff review, test planning and report preparation. All commands were executed locally by me.
Author
Owner

@⁠MesshM on GitHub · 2026-11-24 02:46 UTC · original

Test run of 1abd49b5446a17e5285b9322962d15885065241f on AMD RDNA4; the PR was tested on NVIDIA only. I merged it onto current main 3db536e locally (clean merge) and tested that tree.

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0 stable-x86_64-pc-windows-msvc, debug
  • cargo build --workspace + cargo test --workspace -- --test-threads=4 on the merge: 687 passed, 0 failed, 41 ignored, exit code 0; xcl lib tests 647 passed, 0 failed, 21 ignored
  • 0 SKIPPED; gpu_vop3_mul_hi_and_24bit passes, as wave64 and as wave32 (both run natively here).

Review: The CPU expectations match the RDNA2 definitions: v_mul_hi_u32_u24 is the high word of the 48-bit product of the low 24 bits, v_mul_i32_i24 / v_mul_hi_i32_i24 the low / high word of the signed 24-bit product (arithmetic shift), v_mad_i32_i24 adds S2 as a 32-bit signed value with wrap-around. I found nothing to change.

Not tested: no retail title or regression run (I have no unpacked game), no XCL_SAMPLE_* tests, release build; the PR's head on its old base was not run, only its merge onto main.

Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.

**@⁠MesshM** on GitHub · 2026-11-24 02:46 UTC · [original](https://github.com/xcl-dev/xcl/pull/590#issuecomment-7120468822) Test run of `1abd49b5446a17e5285b9322962d15885065241f` on AMD RDNA4; the PR was tested on NVIDIA only. I merged it onto current `main` `3db536e` locally (clean merge) and tested that tree. **Tested** - AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0 `stable-x86_64-pc-windows-msvc`, debug - `cargo build --workspace` + `cargo test --workspace -- --test-threads=4` on the merge: **687 passed, 0 failed, 41 ignored**, exit code 0; `xcl` lib tests 647 passed, 0 failed, 21 ignored - **0 `SKIPPED`**; `gpu_vop3_mul_hi_and_24bit` passes, as wave64 and as wave32 (both run natively here). **Review:** The CPU expectations match the RDNA2 definitions: `v_mul_hi_u32_u24` is the high word of the 48-bit product of the low 24 bits, `v_mul_i32_i24` / `v_mul_hi_i32_i24` the low / high word of the signed 24-bit product (arithmetic shift), `v_mad_i32_i24` adds S2 as a 32-bit signed value with wrap-around. I found nothing to change. **Not tested:** no retail title or regression run (I have no unpacked game), no `XCL_SAMPLE_*` tests, release build; the PR's head on its old base was not run, only its merge onto `main`. Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.
Author
Owner

@⁠zhouzhidong3-hash on GitHub · 2026-11-24 03:07 UTC · original

Additional Blackwell data point for 1abd49b5446a17e5285b9322962d15885065241f: the focused gpu_vop3_mul_hi_and_24bit fixture passed on a physical RTX 5070 (driver 591.86, Windows 10 build 19045, Rust 1.100.0 x86_64-pc-windows-msvc, release build, DXC 1.8.2502.11). Command: cargo test --offline --locked --release -p xcl --lib gpu_vop3_mul_hi_and_24bit -- --nocapture. Result: 1 passed, 0 failed, 0 ignored, 661 filtered out, 0.41 s. Scoped to this wave32 fixture; no wave64, full-suite or retail run for this PR. AI-assisted local validation by Codex.

**@⁠zhouzhidong3-hash** on GitHub · 2026-11-24 03:07 UTC · [original](https://github.com/xcl-dev/xcl/pull/590#issuecomment-7120794030) Additional Blackwell data point for `1abd49b5446a17e5285b9322962d15885065241f`: the focused `gpu_vop3_mul_hi_and_24bit` fixture passed on a physical RTX 5070 (driver 591.86, Windows 10 build 19045, Rust 1.100.0 x86_64-pc-windows-msvc, release build, DXC 1.8.2502.11). Command: `cargo test --offline --locked --release -p xcl --lib gpu_vop3_mul_hi_and_24bit -- --nocapture`. Result: **1 passed, 0 failed, 0 ignored, 661 filtered out**, 0.41 s. Scoped to this wave32 fixture; no wave64, full-suite or retail run for this PR. AI-assisted local validation by Codex.
Author
Owner

@⁠JJAutoCompare on GitHub · 2026-11-25 06:43 UTC · original

Empirical test report (1abd49b5)

Hardware / environment

  • PR #590 head 1abd49b5446a17e5285b9322962d15885065241f, verified after fetching pull/590/head and checking out detached FETCH_HEAD.
  • Intel Arc A770 Graphics, driver 32.0.101.9175, and AMD Ryzen 7 3800X 8-Core Processor. Windows 11 Enterprise Evaluation, build 10.0.26200.
  • Rust 1.100.0 (0ef1bc386 2026-11-09), x86_64-pc-windows-msvc. DXC and DXIL 1.9.2609.5, compiler revision 01b62ad4 in the test log. Cargo used the unoptimized test profile.

Commands and results

  • cargo test -p xcl --lib --no-run exited 0 outside the Arc lock and produced the library test executable.
  • xcl-00e28da3621caf64.exe --list --exact gpu::recomp::tests::gpu_vop3_mul_hi_and_24bit exited 0 and listed one test.
  • xcl-00e28da3621caf64.exe gpu::recomp::tests::gpu_vop3_mul_hi_and_24bit --exact --nocapture --test-threads=1 ran inside Invoke-ArcTest.ps1 with XCL_ADAPTER=A770 and RUST_TEST_NOCAPTURE=1. The executable and wrapper exited 0. The initial wrapper invocation was blocked by PowerShell execution policy before any test ran. The successful run used a process-scoped bypass.
  • The UTF-8 log recorded 1 passed, 0 failed, 0 ignored, 661 filtered out and 0 case-sensitive lines beginning with SKIPPED . The harness reported 0.24 s.

Observed behavior

The six VOP3 operations matched their CPU reference values. The test dispatches 32 batches per enabled wave width and compares the high 32 bits of signed and unsigned 32-bit products, plus signed and unsigned 24-bit multiply variants and signed 24-bit multiply-add. The inputs exercise 24-bit sign and mask boundaries and 32-bit edge values.

Not tested

The full GPU workspace suite and game smoke runs were omitted.

AI use

Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr590-focused.log and published.

**@⁠JJAutoCompare** on GitHub · 2026-11-25 06:43 UTC · [original](https://github.com/xcl-dev/xcl/pull/590#issuecomment-7155086983) ### Empirical test report (1abd49b5) **Hardware / environment** - PR #590 head `1abd49b5446a17e5285b9322962d15885065241f`, verified after fetching `pull/590/head` and checking out detached `FETCH_HEAD`. - Intel Arc A770 Graphics, driver `32.0.101.9175`, and AMD Ryzen 7 3800X 8-Core Processor. Windows 11 Enterprise Evaluation, build `10.0.26200`. - Rust `1.100.0 (0ef1bc386 2026-11-09)`, `x86_64-pc-windows-msvc`. DXC and DXIL `1.9.2609.5`, compiler revision `01b62ad4` in the test log. Cargo used the unoptimized test profile. **Commands and results** - `cargo test -p xcl --lib --no-run` exited 0 outside the Arc lock and produced the library test executable. - `xcl-00e28da3621caf64.exe --list --exact gpu::recomp::tests::gpu_vop3_mul_hi_and_24bit` exited 0 and listed one test. - `xcl-00e28da3621caf64.exe gpu::recomp::tests::gpu_vop3_mul_hi_and_24bit --exact --nocapture --test-threads=1` ran inside `Invoke-ArcTest.ps1` with `XCL_ADAPTER=A770` and `RUST_TEST_NOCAPTURE=1`. The executable and wrapper exited 0. The initial wrapper invocation was blocked by PowerShell execution policy before any test ran. The successful run used a process-scoped bypass. - The UTF-8 log recorded 1 passed, 0 failed, 0 ignored, 661 filtered out and 0 case-sensitive lines beginning with `SKIPPED `. The harness reported 0.24 s. **Observed behavior** The six VOP3 operations matched their CPU reference values. The test dispatches 32 batches per enabled wave width and compares the high 32 bits of signed and unsigned 32-bit products, plus signed and unsigned 24-bit multiply variants and signed 24-bit multiply-add. The inputs exercise 24-bit sign and mask boundaries and 32-bit edge values. **Not tested** The full GPU workspace suite and game smoke runs were omitted. **AI use** Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr590-focused.log and published.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 13:06 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 13:06 UTC · [original](https://github.com/xcl-dev/xcl/pull/590#issuecomment-7163311032) 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/590/head:github-bot/gh-590'
git switch 'github-bot/gh-590'

Merge

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