Tests: check packed u8, i16/u16, f16 RTZ, and norm f32 conversions on GPU #1556

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

@⁠thiagocalile on GitHub · 2026-11-24 17:39 UTC · original
thiagocalile:tests-recomp-cvt-pk-conversions → main · +271 −0 · 1 files · 1 commits · open

Add GPU recompiler tests covering v_cvt_pk_u8_f32, v_cvt_pk_i16_i32, v_cvt_pk_u16_u32, v_cvt_pkrtz_f16_f32, and v_cvt_pknorm_u16_f32 / v_cvt_pknorm_i16_f32 on both wave64 and wave32.

What is in it

  • crates/xcl/src/gpu/recomp/tests.rs: gpu_cvt_pk_u8_i16_u16_edges covers v_cvt_pk_u8_f32 (byte slots 0..3 + wrapped indices, untouched-byte preservation, round-to-nearest-even ties, saturation, subnormals, ±Inf, ±qNaN, ABS/NEG/-ABS modifiers, 4-byte chaining, EXEC masking), v_cvt_pk_i16_i32 (signed 32→16 clamping boundaries, scalar source, EXEC masking), and v_cvt_pk_u16_u32 (unsigned 32→16 clamping boundaries, scalar source, EXEC masking)
  • crates/xcl/src/gpu/recomp/tests.rs: gpu_cvt_pkrtz_f16_and_pknorm_f32_edges covers v_cvt_pkrtz_f16_f32 (VOP2 + VOP3 ABS/NEG, RTZ vs RNE ties, finite overflow clamping to ±65504 rather than ±Inf, ±Inf, ±0.0, subnormals, ±qNaN, EXEC masking) and v_cvt_pknorm_u16_f32 / v_cvt_pknorm_i16_f32 (saturation, rounding ties, ±Inf, ±qNaN, NEG/ABS modifiers, EXEC masking)

Tested

  • Hardware: AMD Radeon RX 6600 (8146 MiB VRAM, driver 32.0.21045.29003; XCL_ADAPTER=radeon, native wave64 + wave32), AMD Ryzen 7 5700X3D, 47.9 GB RAM, Windows 11 (26200), Rust 1.100.0 (stable-x86_64-pc-windows-msvc), DXC 1.8.2502.11, debug build
  • XCL_ADAPTER=radeon cargo test -p xcl --lib gpu_cvt_pk_u8_i16_u16_edges -- --nocapture: 1 passed, 0 failed, 0 ignored
  • XCL_ADAPTER=radeon cargo test -p xcl --lib gpu_cvt_pkrtz_f16_and_pknorm_f32_edges -- --nocapture: 1 passed, 0 failed, 0 ignored
  • XCL_ADAPTER=radeon cargo test --workspace --no-fail-fast -- --test-threads=4: 775 passed, 3 failed, 41 ignored (the 3 failures are pre-existing on main 9e3831e on this RX 6600: placed_title_textures_share_vram_and_preserve_pixels + 2 mutex-poison cascades, covered by #1028). 1 GPU test skipped inside the passing count: heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows)

Not tested

  • NVIDIA / Intel / WARP adapters, D3D12 debug layer (no d3d12SDKLayers.dll), Linux / Wine.

AI use

  • Antigravity (Gemini 4 Neon) wrote the tests, ran them on my RX 6600, and drafted this description; I reviewed the diff and test output.
**@⁠thiagocalile** on GitHub · 2026-11-24 17:39 UTC · [original](https://github.com/xcl-dev/xcl/pull/1556) `thiagocalile:tests-recomp-cvt-pk-conversions` → `main` · +271 −0 · 1 files · 1 commits · open Add GPU recompiler tests covering `v_cvt_pk_u8_f32`, `v_cvt_pk_i16_i32`, `v_cvt_pk_u16_u32`, `v_cvt_pkrtz_f16_f32`, and `v_cvt_pknorm_u16_f32` / `v_cvt_pknorm_i16_f32` on both wave64 and wave32. **What is in it** - `crates/xcl/src/gpu/recomp/tests.rs`: `gpu_cvt_pk_u8_i16_u16_edges` covers `v_cvt_pk_u8_f32` (byte slots 0..3 + wrapped indices, untouched-byte preservation, round-to-nearest-even ties, saturation, subnormals, ±Inf, ±qNaN, `ABS`/`NEG`/`-ABS` modifiers, 4-byte chaining, EXEC masking), `v_cvt_pk_i16_i32` (signed 32→16 clamping boundaries, scalar source, EXEC masking), and `v_cvt_pk_u16_u32` (unsigned 32→16 clamping boundaries, scalar source, EXEC masking) - `crates/xcl/src/gpu/recomp/tests.rs`: `gpu_cvt_pkrtz_f16_and_pknorm_f32_edges` covers `v_cvt_pkrtz_f16_f32` (VOP2 + VOP3 `ABS`/`NEG`, RTZ vs RNE ties, finite overflow clamping to ±65504 rather than ±Inf, ±Inf, ±0.0, subnormals, ±qNaN, EXEC masking) and `v_cvt_pknorm_u16_f32` / `v_cvt_pknorm_i16_f32` (saturation, rounding ties, ±Inf, ±qNaN, `NEG`/`ABS` modifiers, EXEC masking) **Tested** - Hardware: AMD Radeon RX 6600 (8146 MiB VRAM, driver 32.0.21045.29003; `XCL_ADAPTER=radeon`, native wave64 + wave32), AMD Ryzen 7 5700X3D, 47.9 GB RAM, Windows 11 (26200), Rust 1.100.0 (`stable-x86_64-pc-windows-msvc`), DXC 1.8.2502.11, debug build - `XCL_ADAPTER=radeon cargo test -p xcl --lib gpu_cvt_pk_u8_i16_u16_edges -- --nocapture`: 1 passed, 0 failed, 0 ignored - `XCL_ADAPTER=radeon cargo test -p xcl --lib gpu_cvt_pkrtz_f16_and_pknorm_f32_edges -- --nocapture`: 1 passed, 0 failed, 0 ignored - `XCL_ADAPTER=radeon cargo test --workspace --no-fail-fast -- --test-threads=4`: 775 passed, 3 failed, 41 ignored (the 3 failures are pre-existing on `main` `9e3831e` on this RX 6600: `placed_title_textures_share_vram_and_preserve_pixels` + 2 mutex-poison cascades, covered by #1028). 1 GPU test skipped inside the passing count: `heap_window_out_of_memory_falls_back_to_the_switch_form` (`no heap windows`) **Not tested** - NVIDIA / Intel / WARP adapters, D3D12 debug layer (no `d3d12SDKLayers.dll`), Linux / Wine. **AI use** - Antigravity (Gemini 4 Neon) wrote the tests, ran them on my RX 6600, and drafted this description; I reviewed the diff and test output.
Add GPU recompiler tests for packed conversion instructions in
crates/xcl/src/gpu/recomp/tests.rs (all run on wave64 and wave32):

- gpu_cvt_pk_u8_i16_u16_edges: covers v_cvt_pk_u8_f32 (slots 0..3 and
  wrapped indices, untouched-byte preservation, round-to-nearest-even
  ties, saturation, subnormals, +/-Inf, +/-qNaN, ABS/NEG/-ABS modifiers,
  4-byte chaining, EXEC masking), v_cvt_pk_i16_i32 (signed 32->16
  clamping boundaries, scalar source, EXEC masking), and
  v_cvt_pk_u16_u32 (unsigned 32->16 clamping boundaries, scalar source,
  EXEC masking).
- gpu_cvt_pkrtz_f16_and_pknorm_f32_edges: covers v_cvt_pkrtz_f16_f32
  (VOP2 and VOP3 with ABS/NEG, RTZ vs RNE tie differences, finite
  overflow clamping to +/-65504 rather than +/-Inf, +/-Inf, +/-0.0,
  subnormals, +/-qNaN, EXEC masking) and v_cvt_pknorm_u16_f32 /
  v_cvt_pknorm_i16_f32 (range saturation, rounding ties, +/-Inf, +/-qNaN,
  NEG/ABS modifiers, EXEC masking).

Measured on AMD Radeon RX 6600 (driver 32.0.21045.29003, DXC 1.8.2502.11,
Rust 1.100.0): both new tests pass; full workspace run reports 775 passed,
3 failed (pre-existing main RX 6600 failures covered by #1028), 41 ignored
(2 debug-layer tests skip without d3d12SDKLayers.dll).

Assisted-by: Antigravity (Gemini 4 Neon)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:57:25 +00:00
Author
Owner

@⁠DarkPanda69 on GitHub · 2026-11-24 18:11 UTC · original

NVIDIA run, which this PR lists as not tested (it was run on an RX 6600), plus an RDNA4 one.

Tested: pass, head 3eced4c applied on its base main 9e3831e, debug, Rust 1.100.0, Windows 11 Pro 26200, Ryzen 7 5800X, DXC 1.9.2602.17.
cargo test -p xcl --lib -- gpu::recomp --test-threads=4:

  • NVIDIA RTX 3060, driver 32.0.16.1088, waves 32 only: 194 passed, 0 failed, 18 ignored, 2 SKIPPED (no wave64). gpu_cvt_pk_u8_i16_u16_edges and gpu_cvt_pkrtz_f16_and_pknorm_f32_edges ok.
  • AMD RX 9070 XT (RDNA4), driver 32.0.32029.2010, native wave64: 194 passed, 0 failed, 18 ignored, 0 SKIPPED. Both ok.

Not tested: Intel, WARP, the D3D12 debug layer; the whole workspace suite.

AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.

**@⁠DarkPanda69** on GitHub · 2026-11-24 18:11 UTC · [original](https://github.com/xcl-dev/xcl/pull/1556#issuecomment-7140295942) NVIDIA run, which this PR lists as not tested (it was run on an RX 6600), plus an RDNA4 one. **Tested:** pass, head `3eced4c` applied on its base `main` `9e3831e`, debug, Rust 1.100.0, Windows 11 Pro 26200, Ryzen 7 5800X, DXC 1.9.2602.17. `cargo test -p xcl --lib -- gpu::recomp --test-threads=4`: - NVIDIA RTX 3060, driver 32.0.16.1088, waves 32 only: 194 passed, 0 failed, 18 ignored, 2 SKIPPED (no wave64). `gpu_cvt_pk_u8_i16_u16_edges` and `gpu_cvt_pkrtz_f16_and_pknorm_f32_edges` ok. - AMD RX 9070 XT (RDNA4), driver 32.0.32029.2010, native wave64: 194 passed, 0 failed, 18 ignored, 0 SKIPPED. Both ok. **Not tested:** Intel, WARP, the D3D12 debug layer; the whole workspace suite. AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
Author
Owner

@⁠Daydream3r on GitHub · 2026-11-24 18:13 UTC · original

Independent NVIDIA verification of exact head 3eced4cb07, tested on 2026-11-24 without rebasing, merging or source edits.

Tested

  • NVIDIA GeForce RTX 5070 Ti (16303 MiB reported VRAM), driver 621.01; Ryzen 7 9800X3D, 64 GB RAM; Windows 11 Pro 25H2 26200.6584; Rust 1.100.0 (stable-x86_64-pc-windows-msvc), MSVC Build Tools 2022 17.14.37906.3, Windows SDK 10.0.26100.0; DXC/DXIL 1.9.2609.5 from the official DirectXShaderCompiler release.
  • Debug tests, XCL_ADAPTER=RTX 5070 Ti, XCL_DXC_DIR set to this DXC's bin/x64.
  • cargo build --workspace --locked: exit 0.
  • With XCL_REQUIRE_GPU=mesh, cargo test --locked -p xcl --lib gpu_cvt_pk -- --nocapture --test-threads=1: 2 passed, 0 failed, 0 ignored, no skips, exit 0. Both gpu_cvt_pk_u8_i16_u16_edges and gpu_cvt_pkrtz_f16_and_pknorm_f32_edges executed and passed.
  • cargo test --workspace --locked --no-fail-fast -- --test-threads=4: 778 passed, 0 failed, 41 ignored, exit 0.
  • Same full-suite command on clean baseline main 9e3831e1f5: 776 passed, 0 failed, 41 ignored, exit 0. This is also the PR's merge-base.
  • Synthetic-title e2e test_title_runs_and_game_folder_is_untouched passed on both revisions.

Not tested / skips

The two new tests select wave32 only through gpu_waves() on this NVIDIA adapter. Their native-wave64 path was not exercised.

Each full suite contains the same three explicit GPU skips inside its passing count:

  • gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64
  • gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64
  • heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows

All XCL_SAMPLE_* inputs listed by scripts/test.ps1 were unset, so game-data-dependent successful returns are not sample coverage. No retail title/smoke run, AMD/Intel/WARP, D3D12 debug-layer run, or PR release build. This PR adds tests only; this report makes no retail regression or merge-approval claim. XCL_REQUIRE_GPU=mesh made no-GPU/no-DXC skips fail for the targeted command; it was unset for the full suites.

AI use

Codex desktop, GPT-6 inspected the diff, built and ran the commands on this PC, and drafted this report from the logs. No source changes.

**@⁠Daydream3r** on GitHub · 2026-11-24 18:13 UTC · [original](https://github.com/xcl-dev/xcl/pull/1556#issuecomment-7140341770) Independent NVIDIA verification of exact head **3eced4cb07635a71151e2d991b930bb592ada46c**, tested on 2026-11-24 without rebasing, merging or source edits. **Tested** - NVIDIA GeForce RTX 5070 Ti (16303 MiB reported VRAM), driver **621.01**; Ryzen 7 9800X3D, 64 GB RAM; Windows 11 Pro 25H2 **26200.6584**; Rust **1.100.0** (`stable-x86_64-pc-windows-msvc`), MSVC Build Tools 2022 17.14.37906.3, Windows SDK 10.0.26100.0; DXC/DXIL **1.9.2609.5** from the official DirectXShaderCompiler release. - Debug tests, `XCL_ADAPTER=RTX 5070 Ti`, `XCL_DXC_DIR` set to this DXC's `bin/x64`. - `cargo build --workspace --locked`: exit 0. - With `XCL_REQUIRE_GPU=mesh`, `cargo test --locked -p xcl --lib gpu_cvt_pk -- --nocapture --test-threads=1`: **2 passed, 0 failed, 0 ignored**, **no skips**, exit 0. Both `gpu_cvt_pk_u8_i16_u16_edges` and `gpu_cvt_pkrtz_f16_and_pknorm_f32_edges` executed and passed. - `cargo test --workspace --locked --no-fail-fast -- --test-threads=4`: **778 passed, 0 failed, 41 ignored**, exit 0. - Same full-suite command on clean baseline `main` **9e3831e1f570d3646e53ab753b19ec07eb8f1485**: **776 passed, 0 failed, 41 ignored**, exit 0. This is also the PR's merge-base. - Synthetic-title e2e `test_title_runs_and_game_folder_is_untouched` passed on both revisions. **Not tested / skips** The two new tests select **wave32 only** through `gpu_waves()` on this NVIDIA adapter. Their native-wave64 path was not exercised. Each full suite contains the same three explicit GPU skips inside its passing count: - `gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64` - `gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64` - `heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows` All `XCL_SAMPLE_*` inputs listed by `scripts/test.ps1` were unset, so game-data-dependent successful returns are not sample coverage. No retail title/smoke run, AMD/Intel/WARP, D3D12 debug-layer run, or PR release build. This PR adds tests only; this report makes no retail regression or merge-approval claim. `XCL_REQUIRE_GPU=mesh` made no-GPU/no-DXC skips fail for the targeted command; it was unset for the full suites. **AI use** Codex desktop, GPT-6 inspected the diff, built and ran the commands on this PC, and drafted this report from the logs. No source changes.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 19:32 UTC · original

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

  • cargo test -p xcl --lib: all passed, 0 failed, ~22 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified main.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-24 19:32 UTC · [original](https://github.com/xcl-dev/xcl/pull/1556#issuecomment-7142243380) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~22 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified `main`.) Thanks!
Author
Owner

@⁠JJAutoCompare on GitHub · 2026-11-25 04:54 UTC · original

Tested

Clean detached PR head 3eced4cb07635a71151e2d991b930bb592ada46c. STOR-WINLAB, Windows 11 Enterprise Evaluation 25H2 x64 (26200.9974), Ryzen 7 3800X, Intel Arc A770 driver 32.0.101.9175, Rust/Cargo 1.100.0 x86_64-pc-windows-msvc, DXC/DXIL 1.9.2609.5, unoptimized test profile.

Prebuilt outside the lock with cargo +stable-x86_64-pc-windows-msvc test --locked -p xcl --lib --no-run --message-format=json (exit 0). The Cargo-reported test executable ran under Invoke-ArcTest.ps1 -Test with XCL_ADAPTER=A770, XCL_DIRECT_DXIL=0, and XCL_REQUIRE_GPU=wave64. The wrapper and both fixtures exited 0.

& $exe gpu::recomp::tests::gpu_cvt_pk_u8_i16_u16_edges --exact --nocapture --test-threads=1
& $exe gpu::recomp::tests::gpu_cvt_pkrtz_f16_and_pknorm_f32_edges --exact --nocapture --test-threads=1

2 passed, 0 failed, 0 ignored, 0 skipped. Each filter ran one HLSL/DXC fixture and excluded 749 tests. The first passed 384 readback assertions across 32 lanes (clamps, rounding, byte selection, source modifiers, and EXEC masking). The second passed 288 across 32 lanes (FP16 round toward zero, signed zero, subnormals, Inf/NaN classification, normalized packing, and EXEC masking).

Not tested

Native or split wave64, direct DXIL, release builds, the workspace suite, retail smoke, and other adapters.

AI use

T3 Code / Codex (gpt-6.2-sol) ran the checked-in fixtures and prepared this report.

**@⁠JJAutoCompare** on GitHub · 2026-11-25 04:54 UTC · [original](https://github.com/xcl-dev/xcl/pull/1556#issuecomment-7153266893) **Tested** Clean detached PR head `3eced4cb07635a71151e2d991b930bb592ada46c`. STOR-WINLAB, Windows 11 Enterprise Evaluation 25H2 x64 (26200.9974), Ryzen 7 3800X, Intel Arc A770 driver 32.0.101.9175, Rust/Cargo 1.100.0 x86_64-pc-windows-msvc, DXC/DXIL 1.9.2609.5, unoptimized test profile. Prebuilt outside the lock with `cargo +stable-x86_64-pc-windows-msvc test --locked -p xcl --lib --no-run --message-format=json` (exit 0). The Cargo-reported test executable ran under `Invoke-ArcTest.ps1 -Test` with `XCL_ADAPTER=A770`, `XCL_DIRECT_DXIL=0`, and `XCL_REQUIRE_GPU=wave64`. The wrapper and both fixtures exited 0. ```powershell & $exe gpu::recomp::tests::gpu_cvt_pk_u8_i16_u16_edges --exact --nocapture --test-threads=1 & $exe gpu::recomp::tests::gpu_cvt_pkrtz_f16_and_pknorm_f32_edges --exact --nocapture --test-threads=1 ``` **2 passed, 0 failed, 0 ignored, 0 skipped**. Each filter ran one HLSL/DXC fixture and excluded 749 tests. The first passed 384 readback assertions across 32 lanes (clamps, rounding, byte selection, source modifiers, and EXEC masking). The second passed 288 across 32 lanes (FP16 round toward zero, signed zero, subnormals, Inf/NaN classification, normalized packing, and EXEC masking). **Not tested** Native or split wave64, direct DXIL, release builds, the workspace suite, retail smoke, and other adapters. **AI use** T3 Code / Codex (`gpt-6.2-sol`) ran the checked-in fixtures and prepared this report.
This pull request has changes conflicting with the target branch.
  • crates/xcl/src/gpu/recomp/tests.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

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