Tests: VOP1 bit scans, bit reversal and not on the GPU #736

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

@⁠marquezinii on GitHub · 2026-11-24 04:20 UTC · original
marquezinii:tests/vop1-bit-scans → main · +89 −0 · 1 files · 1 commits · open

v_ffbh_u32, v_ffbl_b32, v_ffbh_i32, v_bfrev_b32 and v_not_b32 are translated by emit.rs but no test runs them, and no open PR covers them (#445, #638, #703 and #699 take the other untested integer ops). This adds one GPU test for the five. Test only: nothing outside tests.rs changes.

What is in it

  • gpu_vop1_bit_scans_and_reverse (crates/xcl/src/gpu/recomp/tests.rs): one kernel run through gpu_waves. Inputs are 20 edge words (0, 1, -1, -2, the sign bit alone and with bit 0, 0x7FFFFFFF, 0xBFFFFFFF, 0xC0000000, …) followed by LCG words, half of them with their low bits cleared so the scans from the bottom see long zero runs. Each result is compared with the ISA pseudo-code written as the loops it describes, not the closed forms emit.rs uses. Besides VGPR sources it covers an SGPR source, the inline constant 0 and a literal.

Tested

  • NVIDIA GeForce RTX 5070 (wave32 only), driver 621.24; Windows 11 Pro 26300; rustc 1.99.1 stable-x86_64-pc-windows-msvc, debug; DXC 1.9.2602.17 (Windows SDK 10.0.26100.0)
  • cargo test --workspace -- --test-threads=1 on this branch: 702 passed, 0 failed, 41 ignored
  • cargo test --workspace -- --test-threads=4: the first run on main f4ce27c was 701 passed, 0 failed, 41 ignored. After that, every run of the same command failed 3 tests, with this branch and with main alike: placed_title_textures_share_vram_and_preserve_pixels ("cubemap extra_pages must be reused at same va"), then transitions_apply_when_their_list_is_submitted and d32s8_targets_take_their_own_size_of_video_memory on the poisoned lock it leaves. They pass alone and single-threaded. This looks like the interaction in #343 / #447, not this change.
  • SKIPPED GPU tests: gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware (no wave64)
  • The test fails when the emitter is broken. With each of these edits made to emit.rs by hand (and reverted) it reported wrong results: v_ffbh_u32 without its zero case (33), ffbh_i without the sign inversion (48), v_bfrev_b32 as a plain move (61). Removing the zero case of v_ffbl_b32 does not fail it, because HLSL's firstbitlow(0) is already 0xFFFFFFFF.

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

Not tested

  • AMD / Intel GPUs and the wave64 run: the RTX 5070 has 32-lane waves only, so gpu_waves ran the kernel as wave32
  • VOP3 forms and operand modifiers: all five are VOP1 here

AI use

  • Claude Code (Claude Opus 5.5) wrote the test and this description, and ran the tests and the emitter-break checks on the machine above.
**@⁠marquezinii** on GitHub · 2026-11-24 04:20 UTC · [original](https://github.com/xcl-dev/xcl/pull/736) `marquezinii:tests/vop1-bit-scans` → `main` · +89 −0 · 1 files · 1 commits · open `v_ffbh_u32`, `v_ffbl_b32`, `v_ffbh_i32`, `v_bfrev_b32` and `v_not_b32` are translated by `emit.rs` but no test runs them, and no open PR covers them (#445, #638, #703 and #699 take the other untested integer ops). This adds one GPU test for the five. Test only: nothing outside `tests.rs` changes. **What is in it** - `gpu_vop1_bit_scans_and_reverse` (`crates/xcl/src/gpu/recomp/tests.rs`): one kernel run through `gpu_waves`. Inputs are 20 edge words (0, 1, -1, -2, the sign bit alone and with bit 0, `0x7FFFFFFF`, `0xBFFFFFFF`, `0xC0000000`, …) followed by LCG words, half of them with their low bits cleared so the scans from the bottom see long zero runs. Each result is compared with the ISA pseudo-code written as the loops it describes, not the closed forms `emit.rs` uses. Besides VGPR sources it covers an SGPR source, the inline constant 0 and a literal. **Tested** - NVIDIA GeForce RTX 5070 (wave32 only), driver 621.24; Windows 11 Pro 26300; rustc 1.99.1 `stable-x86_64-pc-windows-msvc`, debug; DXC 1.9.2602.17 (Windows SDK 10.0.26100.0) - `cargo test --workspace -- --test-threads=1` on this branch: 702 passed, 0 failed, 41 ignored - `cargo test --workspace -- --test-threads=4`: the first run on `main` f4ce27c was 701 passed, 0 failed, 41 ignored. After that, every run of the same command failed 3 tests, with this branch and with `main` alike: `placed_title_textures_share_vram_and_preserve_pixels` ("cubemap extra_pages must be reused at same va"), then `transitions_apply_when_their_list_is_submitted` and `d32s8_targets_take_their_own_size_of_video_memory` on the poisoned lock it leaves. They pass alone and single-threaded. This looks like the interaction in #343 / #447, not this change. - SKIPPED GPU tests: `gpu_geometry_wave32_prefix_count_over_a_mask` and `gpu_wave32_program_in_wave64_hardware` (no wave64) - The test fails when the emitter is broken. With each of these edits made to `emit.rs` by hand (and reverted) it reported wrong results: `v_ffbh_u32` without its zero case (33), `ffbh_i` without the sign inversion (48), `v_bfrev_b32` as a plain move (61). Removing the zero case of `v_ffbl_b32` does not fail it, because HLSL's `firstbitlow(0)` is already `0xFFFFFFFF`. **Regression run** Not needed: the PR changes only `crates/xcl/src/gpu/recomp/tests.rs`. **Not tested** - AMD / Intel GPUs and the wave64 run: the RTX 5070 has 32-lane waves only, so `gpu_waves` ran the kernel as wave32 - VOP3 forms and operand modifiers: all five are VOP1 here **AI use** - Claude Code (Claude Opus 5.5) wrote the test and this description, and ran the tests and the emitter-break checks on the machine above.
v_ffbh_u32, v_ffbl_b32, v_ffbh_i32, v_bfrev_b32 and v_not_b32 are
translated but no test ran them. The new test compares each with the
ISA's pseudo-code (the loops, not the closed forms emit.rs uses) on 20
edge words and LCG words, as wave64 and wave32, with VGPR, SGPR,
inline-constant and literal sources.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:30:57 +00:00
Author
Owner

@⁠MesshM on GitHub · 2026-11-24 04:27 UTC · original

Test run of 490d605cf249e5097cb27daff72987b491a95180 on AMD RDNA4. I merged it onto current main 64b3f35 locally (clean merge) and tested that tree.

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4), 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: 702 passed, 0 failed, 41 ignored, exit code 0; xcl lib tests 661 passed, 0 failed, 21 ignored
  • 0 SKIPPED; gpu_vop1_bit_scans_and_reverse passes, as wave64 and wave32 (both native here).

Review: The references match the ISA: the bit scans return −1 (0xFFFFFFFF) for 0, v_ffbh_i32 also for −1, and v_bfrev_b32 / v_not_b32 are plain bit operations. 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 04:27 UTC · [original](https://github.com/xcl-dev/xcl/pull/736#issuecomment-7122042337) Test run of `490d605cf249e5097cb27daff72987b491a95180` on AMD RDNA4. I merged it onto current `main` `64b3f35` locally (clean merge) and tested that tree. **Tested** - AMD Radeon RX 9060 XT 16 GB (RDNA4), 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: **702 passed, 0 failed, 41 ignored**, exit code 0; `xcl` lib tests 661 passed, 0 failed, 21 ignored - **0 `SKIPPED`**; `gpu_vop1_bit_scans_and_reverse` passes, as wave64 and wave32 (both native here). **Review:** The references match the ISA: the bit scans return −1 (0xFFFFFFFF) for 0, `v_ffbh_i32` also for −1, and `v_bfrev_b32` / `v_not_b32` are plain bit operations. 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

@⁠ItsMrDubey on GitHub · 2026-11-24 04:57 UTC · original

Test report for 490d605cf249e5097cb27daff72987b491a95180 (this PR's head)

Tested

  • NVIDIA GeForce RTX 4070 Ti 12 GB (Ada), driver 617.14; Intel Core i9-10900K, 32 GB RAM; Windows 11 Pro build 26300
  • Rust 1.88.0 (stable-x86_64-pc-windows-msvc), debug; DXC 1.9.2602.17 from Windows SDK 10.0.26100
cargo build --workspace
cargo test --workspace --no-fail-fast -- --test-threads=4

17 test binaries: 701 passed, 1 failed, 41 ignored. Same machine, main 64b3f3559: 700 passed, 1 failed, 41 ignored.

This PR's tests:

  • gpu::recomp::tests::gpu_vop1_bit_scans_and_reverse: ok

Failures:

  • hle::kernelx::tests::xmem_virtual_query_marks_cpu_readable_memory fails on this machine on every run, on this PR's head and on main 64b3f3559 alike (5 of 5 reruns on main), so it is not from this PR. #650 fixes it here.

SKIPPED (no wave64 on this GPU): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.

AI use: Claude Code (Claude Opus 5.5) ran the builds and tests and wrote this report from their output.

**@⁠ItsMrDubey** on GitHub · 2026-11-24 04:57 UTC · [original](https://github.com/xcl-dev/xcl/pull/736#issuecomment-7122491152) Test report for `490d605cf249e5097cb27daff72987b491a95180` (this PR's head) **Tested** - NVIDIA GeForce RTX 4070 Ti 12 GB (Ada), driver 617.14; Intel Core i9-10900K, 32 GB RAM; Windows 11 Pro build 26300 - Rust 1.88.0 (`stable-x86_64-pc-windows-msvc`), debug; DXC 1.9.2602.17 from Windows SDK 10.0.26100 ``` cargo build --workspace cargo test --workspace --no-fail-fast -- --test-threads=4 ``` 17 test binaries: **701 passed, 1 failed, 41 ignored**. Same machine, `main` `64b3f3559`: 700 passed, 1 failed, 41 ignored. This PR's tests: - `gpu::recomp::tests::gpu_vop1_bit_scans_and_reverse`: ok Failures: - `hle::kernelx::tests::xmem_virtual_query_marks_cpu_readable_memory` fails on this machine on every run, on this PR's head and on `main` `64b3f3559` alike (5 of 5 reruns on `main`), so it is not from this PR. #650 fixes it here. SKIPPED (no wave64 on this GPU): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. AI use: Claude Code (Claude Opus 5.5) ran the builds and tests and wrote this report from their output.
Author
Owner

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

Empirical test report (490d605c)

PR #736, commit 490d605cf249e5097cb27daff72987b491a95180.

Hardware / environment

  • Intel Arc A770 selected with XCL_ADAPTER=A770. Windows x64 build 26200, AMD64 Family 23 Model 113 Stepping 0. GPU driver version was not recorded.
  • rustc 1.100.0 (0ef1bc386 2026-11-09), host x86_64-pc-windows-msvc. DXC and DXIL 1.9.2609.5 (DXC commit 01b62ad4). Cargo test profile unoptimized, with debug info and incremental compilation disabled.

Commands and results

  • cargo test -p xcl --lib --no-run completed outside the GPU lock (exit 0).
  • xcl-00e28da3621caf64.exe gpu::recomp::tests::gpu_vop1_bit_scans_and_reverse --exact --nocapture --test-threads=1 ran inside Invoke-ArcTest.ps1 with RUST_TEST_NOCAPTURE=1 (exit 0).
  • 1 passed, 0 failed, 0 ignored, 0 skipped, 681 filtered out. Libtest reported 0.17s for the focused run.

Observed behavior

  • The fixture finished after loading DXC. Its per-lane GPU readback assertions passed for v_ffbh_u32, v_ffbl_b32, v_ffbh_i32, v_bfrev_b32, and v_not_b32.
  • The fixture checks vector-register inputs drawn from 20 edge words and deterministic generated words. It also checks selected operations with a scalar register, inline zero, and a literal. The code always runs the wave32 program when the GPU and DXC are ready, and adds a wave64 case if the adapter reports support. The log has no per-wave result.

Not tested

The full GPU workspace suite and game smoke runs were omitted. This report covers one fixture on one adapter.

AI use

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

**@⁠JJAutoCompare** on GitHub · 2026-11-25 06:10 UTC · [original](https://github.com/xcl-dev/xcl/pull/736#issuecomment-7154520756) ### Empirical test report (490d605c) PR #736, commit `490d605cf249e5097cb27daff72987b491a95180`. **Hardware / environment** - Intel Arc A770 selected with `XCL_ADAPTER=A770`. Windows x64 build 26200, AMD64 Family 23 Model 113 Stepping 0. GPU driver version was not recorded. - `rustc 1.100.0 (0ef1bc386 2026-11-09)`, host `x86_64-pc-windows-msvc`. DXC and DXIL `1.9.2609.5` (DXC commit `01b62ad4`). Cargo test profile unoptimized, with debug info and incremental compilation disabled. **Commands and results** - `cargo test -p xcl --lib --no-run` completed outside the GPU lock (exit 0). - `xcl-00e28da3621caf64.exe gpu::recomp::tests::gpu_vop1_bit_scans_and_reverse --exact --nocapture --test-threads=1` ran inside `Invoke-ArcTest.ps1` with `RUST_TEST_NOCAPTURE=1` (exit 0). - 1 passed, 0 failed, 0 ignored, 0 skipped, 681 filtered out. Libtest reported 0.17s for the focused run. **Observed behavior** - The fixture finished after loading DXC. Its per-lane GPU readback assertions passed for `v_ffbh_u32`, `v_ffbl_b32`, `v_ffbh_i32`, `v_bfrev_b32`, and `v_not_b32`. - The fixture checks vector-register inputs drawn from 20 edge words and deterministic generated words. It also checks selected operations with a scalar register, inline zero, and a literal. The code always runs the wave32 program when the GPU and DXC are ready, and adds a wave64 case if the adapter reports support. The log has no per-wave result. **Not tested** The full GPU workspace suite and game smoke runs were omitted. This report covers one fixture on one adapter. **AI use** Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr736-focused.log and published.
Author
Owner

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

Merge

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