Shaders: hardware test for v_not, v_bfrev and the vector bit-scan ops #1381

Closed
github-bot wants to merge 1 commit from gh-pr/1381/head into gh-pr/1381/base
Owner

@⁠LouisRiverstone on GitHub · 2026-11-24 17:40 UTC · original
LouisRiverstone:shaders/v-bit-scan-test → main · +46 −0 · 1 files · 1 commits · closed without merging

v_not_b32, v_bfrev_b32, v_ffbh_u32, v_ffbl_b32 and v_ffbh_i32 (VOP1 0x37..0x3b) are lowered in lower.rs, the searches through DXIL unaryBits.i32, but no hardware test ran them. The searches return -1 for no bit, and v_ffbh_i32 looks for the first bit that differs from the sign bit.

New test v_not_bfrev_and_bit_scan_ops_match_rdna2 runs ten values (0, single bits, 0x7FFFFFFF, 0x80000000, all-ones and nearly all-ones) through each op. Expected values come from !, reverse_bits, leading_zeros and trailing_zeros in Rust.

Test only, no production change.

Verify: cargo test -p victory-shader v_not_bfrev (Windows, hardware GPU or WARP). I type-checked it with clippy for x86_64-pc-windows-msvc, but could not run it locally: the shader test module is Windows-only.

🤖 Generated with Claude Code

**@⁠LouisRiverstone** on GitHub · 2026-11-24 17:40 UTC · [original](https://github.com/Marvisak/VIctory/pull/1381) `LouisRiverstone:shaders/v-bit-scan-test` → `main` · +46 −0 · 1 files · 1 commits · closed without merging `v_not_b32`, `v_bfrev_b32`, `v_ffbh_u32`, `v_ffbl_b32` and `v_ffbh_i32` (VOP1 0x37..0x3b) are lowered in `lower.rs`, the searches through DXIL `unaryBits.i32`, but no hardware test ran them. The searches return -1 for no bit, and `v_ffbh_i32` looks for the first bit that differs from the sign bit. New test `v_not_bfrev_and_bit_scan_ops_match_rdna2` runs ten values (0, single bits, `0x7FFFFFFF`, `0x80000000`, all-ones and nearly all-ones) through each op. Expected values come from `!`, `reverse_bits`, `leading_zeros` and `trailing_zeros` in Rust. Test only, no production change. **Verify:** `cargo test -p victory-shader v_not_bfrev` (Windows, hardware GPU or WARP). I type-checked it with clippy for `x86_64-pc-windows-msvc`, but could not run it locally: the shader test module is Windows-only. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:29:37 +00:00
github-bot closed this pull request 2026-11-26 04:29:37 +00:00
Author
Owner

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

Ran on RDNA2 hardware through vkd3d-proton on a Steam Deck (not native Windows): AMD Van Gogh, RADV 26.1.99, SteamOS 3.8.28, Proton 11.0-3 (wine-11.0) with its vkd3d-proton 212991fc. Windows MSVC test binary (rustc 1.100.0) built from head f025d5d on main ffe310e.

  • v_not_bfrev_and_bit_scan_ops_match_rdna2 passes: v_not_b32, v_bfrev_b32, v_ffbh_u32, v_ffbl_b32 and v_ffbh_i32 on all 10 values, including 0 and 0xFFFFFFFF (-1 for no bit).
  • victory-shader lib tests: 120 passed, 1 failed, 1 ignored (main on the same host: 119/1/1). The one failure, stub_pipeline_is_created, fails on main too (likely vkd3d-proton accepting the zero DXIL digest the test expects refused; environment, not this PR).
  • No hangs. A pass means the translated DXIL gives these values on RDNA2 through vkd3d-proton/RADV; it isn't a console measurement.

Not tested: native Windows AMD drivers; WARP (this setup has none, so the WARP leg ran on RADV too).

AI-assisted (Claude Code, Claude Opus 5.5); no game data.

**@⁠ghost** on GitHub · 2026-11-24 18:00 UTC · [original](https://github.com/Marvisak/VIctory/pull/1381#issuecomment-7140020757) Ran on RDNA2 hardware through vkd3d-proton on a Steam Deck (not native Windows): AMD Van Gogh, RADV 26.1.99, SteamOS 3.8.28, Proton 11.0-3 (wine-11.0) with its vkd3d-proton 212991fc. Windows MSVC test binary (rustc 1.100.0) built from head `f025d5d` on main `ffe310e`. - `v_not_bfrev_and_bit_scan_ops_match_rdna2` passes: v_not_b32, v_bfrev_b32, v_ffbh_u32, v_ffbl_b32 and v_ffbh_i32 on all 10 values, including 0 and 0xFFFFFFFF (-1 for no bit). - victory-shader lib tests: 120 passed, 1 failed, 1 ignored (main on the same host: 119/1/1). The one failure, `stub_pipeline_is_created`, fails on main too (likely vkd3d-proton accepting the zero DXIL digest the test expects refused; environment, not this PR). - No hangs. A pass means the translated DXIL gives these values on RDNA2 through vkd3d-proton/RADV; it isn't a console measurement. Not tested: native Windows AMD drivers; WARP (this setup has none, so the WARP leg ran on RADV too). AI-assisted (Claude Code, Claude Opus 5.5); no game data.
Author
Owner

@⁠marquezinii on GitHub · 2026-11-24 19:13 UTC · original

Native Windows NVIDIA data point: RTX 5070 (desktop, driver 621.40, the only adapter), Windows 11 26300, Rust 1.98.1, head f025d5d. cargo test -p victory-shader --lib -- --test-threads=1 --nocapture gives 121 passed, 0 failed, 1 ignored. v_not_bfrev_and_bit_scan_ops_match_rdna2 passes on the hardware adapter and WARP, with nothing skipped on the hardware adapter.

**@⁠marquezinii** on GitHub · 2026-11-24 19:13 UTC · [original](https://github.com/Marvisak/VIctory/pull/1381#issuecomment-7141770354) Native Windows NVIDIA data point: RTX 5070 (desktop, driver 621.40, the only adapter), Windows 11 26300, Rust 1.98.1, head `f025d5d`. `cargo test -p victory-shader --lib -- --test-threads=1 --nocapture` gives 121 passed, 0 failed, 1 ignored. `v_not_bfrev_and_bit_scan_ops_match_rdna2` passes on the hardware adapter and WARP, with nothing skipped on the hardware adapter.
Author
Owner

@⁠wwwwwwww3333333 on GitHub · 2026-11-24 19:14 UTC · original

Native Windows run on AMD RDNA2: RX 6750 XT (RDNA2, gfx1031), AMD driver 32.0.21045.29003, i5-13400F, Windows 11, Rust 1.98.1 MSVC. Head f025d5d on main ffe310e (clean merge).

cargo test -p victory-shader --lib -- --test-threads=1: 121 passed, 0 failed, 1 ignored (main alone: 120 passed). v_not_bfrev_and_bit_scan_ops_match_rdna2 ran on the hardware adapter and then on WARP, and passed on both. The earlier RDNA2 runs on this PR went through vkd3d-proton on Linux; this one is AMD's own D3D12 driver.

Synthetic tests only, no game files. AI-assisted (Claude picked the PRs and wrote the batch script; I ran it on my machine).

**@⁠wwwwwwww3333333** on GitHub · 2026-11-24 19:14 UTC · [original](https://github.com/Marvisak/VIctory/pull/1381#issuecomment-7141796808) Native Windows run on AMD RDNA2: RX 6750 XT (RDNA2, gfx1031), AMD driver 32.0.21045.29003, i5-13400F, Windows 11, Rust 1.98.1 MSVC. Head f025d5d on main ffe310e (clean merge). `cargo test -p victory-shader --lib -- --test-threads=1`: **121 passed, 0 failed**, 1 ignored (main alone: 120 passed). `v_not_bfrev_and_bit_scan_ops_match_rdna2` ran on the hardware adapter and then on WARP, and passed on both. The earlier RDNA2 runs on this PR went through vkd3d-proton on Linux; this one is AMD's own D3D12 driver. Synthetic tests only, no game files. AI-assisted (Claude picked the PRs and wrote the batch script; I ran it on my machine).
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:39 UTC · original

Automated triage for the maintainers. Closing because this change is already in main, or main has since replaced the code it patches.

v_bfrev, v_ffbh_u32, v_ffbl_b32 and v_ffbh_i32 are already probed in main's integer_probes over 34 edge values; the only op not there is v_not_b32, a single xor.

If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

**@⁠Marvisak** on GitHub · 2026-11-25 00:39 UTC · [original](https://github.com/Marvisak/VIctory/pull/1381#issuecomment-7148739936) Automated triage for the maintainers. Closing because this change is already in `main`, or `main` has since replaced the code it patches. v_bfrev, v_ffbh_u32, v_ffbl_b32 and v_ffbh_i32 are already probed in main's `integer_probes` over 34 edge values; the only op not there is v_not_b32, a single xor. If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!1381
No description provided.