Tests: check f32 and f16 transcendental VALU ops on the GPU #1160

Open
microwave805 wants to merge 1 commit from upstream-pr/1169 into main
microwave805 commented 2026-11-24 12:49:39 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by microwave805 on 2026-11-24T12:49:39Z.


Adds GPU tests for 11 translated RDNA2 transcendental VALU instructions that currently have no GPU coverage in crates/xcl/src/gpu/recomp/tests.rs: v_exp_f32, v_log_f32, v_sqrt_f32, v_rsq_f32, v_rcp_f32, v_rcp_iflag_f32, v_exp_f16, v_log_f16, v_sqrt_f16, v_rsq_f16, and v_rcp_f16. (v_sin_* / v_cos_* are intentionally left out because #818 changes their range reduction.)

Uses four exact power-of-two lane patterns and checks both VOP1 and VOP3 encodings (ABS, NEG, CLAMP, high-half OP_SEL), verifying that the untouched half of every f16 vdst is preserved bit-for-bit.

What is in it

  • crates/xcl/src/gpu/recomp/tests.rs: add gpu_f32_and_f16_transcendentals covering all 11 instructions on the GPU.

Tested

  • NVIDIA GeForce RTX 3070 (driver 32.0.16.1742), AMD Ryzen 5 5600X, Windows 11 Pro (build 22631), DXC 1.9.2602.17 (Windows SDK 10.0.26100.0), Rust 1.100.0 (stable-x86_64-pc-windows-msvc, debug)
  • cargo test -p xcl --lib gpu_f32_and_f16_transcendentals -- --nocapture: 1 passed, 0 failed
  • .\scripts\test.ps1 (cargo build --workspace + cargo test --workspace -- --test-threads=4): 742 passed, 0 failed, 41 ignored
  • SKIPPED GPU tests: gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask, gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware (no wave64)
  • python -I scripts/pr_check.py --local on this PR's description and changed files: description ok

Regression run

  • Not needed: changes only crates/xcl/src/gpu/recomp/tests.rs (test-only).

Not tested

  • Native wave64 / AMD GPUs (ran on NVIDIA RTX 3070 via split-wave64)
  • Retail titles

AI use

  • Antigravity (Gemini 4 Neon): audited untested transcendental ops in emit.rs/tests.rs, wrote the GPU test and this PR description, and ran the test commands above.
<!-- greyfinch-sync:ivall/xcl:issue:5472464812 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1169). Originally posted by [microwave805](https://github.com/microwave805) on 2026-11-24T12:49:39Z. --- Adds GPU tests for 11 translated RDNA2 transcendental VALU instructions that currently have no GPU coverage in `crates/xcl/src/gpu/recomp/tests.rs`: `v_exp_f32`, `v_log_f32`, `v_sqrt_f32`, `v_rsq_f32`, `v_rcp_f32`, `v_rcp_iflag_f32`, `v_exp_f16`, `v_log_f16`, `v_sqrt_f16`, `v_rsq_f16`, and `v_rcp_f16`. (`v_sin_*` / `v_cos_*` are intentionally left out because #818 changes their range reduction.) Uses four exact power-of-two lane patterns and checks both VOP1 and VOP3 encodings (`ABS`, `NEG`, `CLAMP`, high-half `OP_SEL`), verifying that the untouched half of every f16 `vdst` is preserved bit-for-bit. **What is in it** - `crates/xcl/src/gpu/recomp/tests.rs`: add `gpu_f32_and_f16_transcendentals` covering all 11 instructions on the GPU. **Tested** - NVIDIA GeForce RTX 3070 (driver 32.0.16.1742), AMD Ryzen 5 5600X, Windows 11 Pro (build 22631), DXC 1.9.2602.17 (Windows SDK 10.0.26100.0), Rust 1.100.0 (stable-x86_64-pc-windows-msvc, debug) - `cargo test -p xcl --lib gpu_f32_and_f16_transcendentals -- --nocapture`: 1 passed, 0 failed - `.\scripts\test.ps1` (`cargo build --workspace` + `cargo test --workspace -- --test-threads=4`): 742 passed, 0 failed, 41 ignored - SKIPPED GPU tests: `gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware` (no wave64) - `python -I scripts/pr_check.py --local` on this PR's description and changed files: `description ok` **Regression run** - Not needed: changes only `crates/xcl/src/gpu/recomp/tests.rs` (test-only). **Not tested** - Native wave64 / AMD GPUs (ran on NVIDIA RTX 3070 via split-wave64) - Retail titles **AI use** - Antigravity (Gemini 4 Neon): audited untested transcendental ops in `emit.rs`/`tests.rs`, wrote the GPU test and this PR description, and ran the test commands above.
towiice commented 2026-11-24 13:09:30 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by towiice on 2026-11-24T13:09:30Z.

Review: COMMENTED


Tested:

  • Hardware: NVIDIA GeForce GTX 1650 SUPER (Turing TU116, 4 GB VRAM, wave32, driver 610.88), Windows 11 x64 (26H2 / build 26300), DXC v1.9.2609 (01b62ad4), toolchain stable-x86_64-pc-windows-gnullvm (llvm-mingw 23.1.6), debug build.
  • Test command: cargo test -p xcl --lib gpu_f32_and_f16_transcendentals -- --nocapture
  • Result: 1 passed, 0 failed (0.61 s) — gpu::recomp::tests::gpu_f32_and_f16_transcendentals passes cleanly on Turing wave32 hardware without skips.

Not tested: full workspace suite, release builds, AMD/Intel GPUs, retail titles (test-only PR).

<!-- greyfinch-sync:ivall/xcl:review:6039755823 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1169#pullrequestreview-6039755823). Originally posted by [towiice](https://github.com/towiice) on 2026-11-24T13:09:30Z. **Review:** COMMENTED --- **Tested:** - Hardware: NVIDIA GeForce GTX 1650 SUPER (Turing TU116, 4 GB VRAM, wave32, driver 610.88), Windows 11 x64 (26H2 / build 26300), DXC v1.9.2609 (`01b62ad4`), toolchain `stable-x86_64-pc-windows-gnullvm` (llvm-mingw 23.1.6), debug build. - Test command: `cargo test -p xcl --lib gpu_f32_and_f16_transcendentals -- --nocapture` - Result: **1 passed, 0 failed** (0.61 s) — `gpu::recomp::tests::gpu_f32_and_f16_transcendentals` passes cleanly on Turing wave32 hardware without skips. **Not tested:** full workspace suite, release builds, AMD/Intel GPUs, retail titles (test-only PR).
bjarngard commented 2026-11-24 14:06:32 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bjarngard on 2026-11-24T13:24:02Z.


Test report for head e983005 (AMD, native wave64)

Tested

  • AMD Radeon(TM) Graphics (Ryzen 9 9950X iGPU, RDNA2, native wave64), driver 32.0.21043.5001; Windows 11 build 26300; Rust 1.99.1 MSVC; DXC 1.9.2602.17; debug
  • XCL_ADAPTER=radeon cargo test --workspace --no-fail-fast -- --test-threads=4: 742 passed, 0 failed, 41 ignored, no SKIPPED
  • With XCL_REQUIRE_GPU=wave64: gpu_f32_and_f16_transcendentals passed

Not tested: retail titles, RDNA3/RDNA4.

AI use: the tests were run and this report was written by an AI agent, Claude Code (Claude Opus 5.5), on the hardware above. The numbers are copied from the actual test output.

<!-- greyfinch-sync:ivall/xcl:comment:7132775137 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1169#issuecomment-7132775137). Originally posted by [bjarngard](https://github.com/bjarngard) on 2026-11-24T13:24:02Z. --- Test report for head `e983005` (AMD, native wave64) **Tested** - AMD Radeon(TM) Graphics (Ryzen 9 9950X iGPU, RDNA2, native wave64), driver 32.0.21043.5001; Windows 11 build 26300; Rust 1.99.1 MSVC; DXC 1.9.2602.17; debug - `XCL_ADAPTER=radeon cargo test --workspace --no-fail-fast -- --test-threads=4`: 742 passed, 0 failed, 41 ignored, no SKIPPED - With `XCL_REQUIRE_GPU=wave64`: `gpu_f32_and_f16_transcendentals` passed **Not tested:** retail titles, RDNA3/RDNA4. **AI use:** the tests were run and this report was written by an AI agent, Claude Code (Claude Opus 5.5), on the hardware above. The numbers are copied from the actual test output.
JoaoPauluu commented 2026-11-24 14:06:38 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JoaoPauluu on 2026-11-24T13:45:14Z.


A run on Linux with vkd3d-proton, where the shaders go through dxil-spirv to Vulkan instead of a Windows driver's DXIL compiler.

Tested

  • RTX 3060 12 GB (NVIDIA 620.70.06, 32-lane waves), i5-10400F, 16 GB, CachyOS (kernel 7.3.3), Proton Experimental 11.0-20261112 with the patched vkd3d-proton 3.1 from #257 (DXIL → SPIR-V through dxil-spirv), DXC 1.9.2609.5. Release, cross-built for x86_64-pc-windows-gnu. e983005 as it is (based on 47efa2e), no uncommitted changes. The lib test binary runs under Wine.
  • gpu::recomp::tests::gpu_f32_and_f16_transcendentals (--exact, one process): ok, no SKIPPED. DXC compiled it and it ran on the GPU in about 0.8 s.

Not tested

  • the rest of the suite on this head; native Windows; AMD / native wave64.

AI use

  • Claude Code (Claude Opus 5.5) built the head, ran the tests and wrote this report. The account owner asked for test reports to be posted and has not reviewed this one.
<!-- greyfinch-sync:ivall/xcl:comment:7133285788 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1169#issuecomment-7133285788). Originally posted by [JoaoPauluu](https://github.com/JoaoPauluu) on 2026-11-24T13:45:14Z. --- A run on Linux with vkd3d-proton, where the shaders go through dxil-spirv to Vulkan instead of a Windows driver's DXIL compiler. **Tested** - RTX 3060 12 GB (NVIDIA 620.70.06, 32-lane waves), i5-10400F, 16 GB, CachyOS (kernel 7.3.3), Proton Experimental 11.0-20261112 with the patched vkd3d-proton 3.1 from #257 (DXIL → SPIR-V through dxil-spirv), DXC 1.9.2609.5. Release, cross-built for `x86_64-pc-windows-gnu`. `e983005` as it is (based on `47efa2e`), no uncommitted changes. The lib test binary runs under Wine. - `gpu::recomp::tests::gpu_f32_and_f16_transcendentals` (`--exact`, one process): **ok**, no SKIPPED. DXC compiled it and it ran on the GPU in about 0.8 s. **Not tested** - the rest of the suite on this head; native Windows; AMD / native wave64. **AI use** - Claude Code (Claude Opus 5.5) built the head, ran the tests and wrote this report. The account owner asked for test reports to be posted and has not reviewed this one.
JJAutoCompare commented 2026-11-25 05:08:29 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T04:56:15Z.


Tested

PR #1169 stayed open at e9830058b6e16630039f18c99901d3c68f1fba1b. The worktree was clean and detached at that SHA before and after the run.
STOR-WINLAB ran native Windows 11 Enterprise Evaluation 25H2 x64 build 26200.9974, with a Ryzen 7 3800X, Intel Arc A770 driver 32.0.101.9175, Rust/Cargo 1.100.0 x86_64-pc-windows-msvc, and DXC/DXIL 1.9.2609.5.

  • cargo test --locked -p xcl --lib --no-run completed outside the GPU lock in 30.18 s. The build used two jobs, incremental compilation disabled, dev/test debuginfo set to 0, and private TEMP and TMP at L:/XclTooling/pr1169.

  • A fresh PowerShell child used process-scoped RemoteSigned to invoke & 'L:/XclTooling/Invoke-ArcTest.ps1' -Test { ... } with XCL_ADAPTER=A770, XCL_DIRECT_DXIL=0, and XCL_DXC_DIR=%LOCALAPPDATA%/XclTooling/dxc-1.9.2609/bin/x64. The only fixture command was:

    & 'L:/XclTooling/pr1975-b62e6e3/target/debug/build/xcl/77aca8ccb20e299f/out/xcl-77aca8ccb20e299f.exe' gpu::recomp::tests::gpu_f32_and_f16_transcendentals --exact --nocapture --test-threads=1
    
  • 1 passed, 0 failed, 0 ignored, 0 capability skips, 719 filtered out in 0.26 s. All 1,408 assertions passed across 64 logical lanes in split wave64 on 32-lane hardware. These covered 512 FP32 result checks, 448 FP16 result checks, and 448 bit-exact checks that the untouched FP16 register half was preserved. The fixture checks exp2, log2, sqrt, reciprocal sqrt, reciprocal, FP32 RCP_IFLAG on finite negative inputs, and selected ABS, NEG, CLAMP, and FP16 half-selection cases.

  • Build, native fixture, and wrapper exits were each 0. The wrapper logged the Arc lock release.

Not tested

Native wave64 on this host, direct DXIL, special-value inputs, other fixtures, the workspace suite, and retail smoke runs.

AI use

T3 Code / Codex (gpt-6.2-sol) ran the verification and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7153298720 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1169#issuecomment-7153298720). Originally posted by [JJAutoCompare](https://github.com/JJAutoCompare) on 2026-11-25T04:56:15Z. --- **Tested** [PR #1169](https://github.com/xcl-dev/xcl/pull/1169) stayed open at `e9830058b6e16630039f18c99901d3c68f1fba1b`. The worktree was clean and detached at that SHA before and after the run. STOR-WINLAB ran native Windows 11 Enterprise Evaluation 25H2 x64 build 26200.9974, with a Ryzen 7 3800X, Intel Arc A770 driver 32.0.101.9175, Rust/Cargo 1.100.0 `x86_64-pc-windows-msvc`, and DXC/DXIL 1.9.2609.5. - `cargo test --locked -p xcl --lib --no-run` completed outside the GPU lock in 30.18 s. The build used two jobs, incremental compilation disabled, dev/test debuginfo set to `0`, and private `TEMP` and `TMP` at `L:/XclTooling/pr1169`. - A fresh PowerShell child used process-scoped `RemoteSigned` to invoke `& 'L:/XclTooling/Invoke-ArcTest.ps1' -Test { ... }` with `XCL_ADAPTER=A770`, `XCL_DIRECT_DXIL=0`, and `XCL_DXC_DIR=%LOCALAPPDATA%/XclTooling/dxc-1.9.2609/bin/x64`. The only fixture command was: ```powershell & 'L:/XclTooling/pr1975-b62e6e3/target/debug/build/xcl/77aca8ccb20e299f/out/xcl-77aca8ccb20e299f.exe' gpu::recomp::tests::gpu_f32_and_f16_transcendentals --exact --nocapture --test-threads=1 ``` - **1 passed, 0 failed, 0 ignored, 0 capability skips, 719 filtered out** in 0.26 s. All **1,408 assertions** passed across 64 logical lanes in split wave64 on 32-lane hardware. These covered 512 FP32 result checks, 448 FP16 result checks, and 448 bit-exact checks that the untouched FP16 register half was preserved. The fixture checks exp2, log2, sqrt, reciprocal sqrt, reciprocal, FP32 `RCP_IFLAG` on finite negative inputs, and selected ABS, NEG, CLAMP, and FP16 half-selection cases. - Build, native fixture, and wrapper exits were each `0`. The wrapper logged the Arc lock release. **Not tested** Native wave64 on this host, direct DXIL, special-value inputs, other fixtures, the workspace suite, and retail smoke runs. **AI use** T3 Code / Codex (`gpt-6.2-sol`) ran the verification and wrote this report.
DavidM1911 commented 2026-11-25 08:08:18 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T07:46:46Z.


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!

<!-- greyfinch-sync:ivall/xcl:comment:7156242814 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1169#issuecomment-7156242814). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T07:46:46Z. --- 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!
github-actions[bot] commented 2026-11-28 20:19:15 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-28T20:19:15Z.


Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

<!-- greyfinch-sync:ivall/xcl:comment:7245199595 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1169#issuecomment-7245199595). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-28T20:19:15Z. --- Nothing has happened on this PR for 3 days, so it is marked `stale` and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto `main` if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.
Foniass commented 2026-12-01 04:58:36 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T04:58:36Z.


Triage (#1607) – head e983005

#643 also tests the f32 / f16 rcp, rsq, sqrt, log and exp ops on the GPU, but checks accuracy and special values (zeros, infinities, NaN, sin/cos) against f64. This PR uses exact powers of two and covers what #643 does not: VOP3 abs / neg / clamp, f16 op_sel high-half source and destination, the preserved other half, and v_rcp_iflag_f32. The two overlap without being the same test. None of these tests are on main.
No problems found in the diff (the v4 high-half sentinel 7.5 is set but never checked).
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7301293933 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1169#issuecomment-7301293933). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T04:58:36Z. --- **Triage (#1607)** – head e983005 #643 also tests the f32 / f16 rcp, rsq, sqrt, log and exp ops on the GPU, but checks accuracy and special values (zeros, infinities, NaN, sin/cos) against f64. This PR uses exact powers of two and covers what #643 does not: VOP3 abs / neg / clamp, f16 op_sel high-half source and destination, the preserved other half, and v_rcp_iflag_f32. The two overlap without being the same test. None of these tests are on main. No problems found in the diff (the v4 high-half sentinel 7.5 is set but never checked). Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1169:upstream-pr/1169'
git switch 'upstream-pr/1169'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/1169'
git switch 'upstream-pr/1169'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1169'
git switch 'upstream-pr/1169'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1169'
git switch 'main'
git merge --squash 'upstream-pr/1169'
git switch 'main'
git merge --ff-only 'upstream-pr/1169'
git switch 'main'
git merge 'upstream-pr/1169'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!1160
No description provided.