Tests: cover V_BFE_U32 width and offset bounds on the GPU #1616

Open
pane33 wants to merge 1 commit from upstream-pr/1626 into main
pane33 commented 2026-11-24 18:23:50 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by pane33 on 2026-11-24T18:23:50Z.


Add GPU coverage for the width and offset bounds of V_BFE_U32. The test checks zero width, the maximum effective width, masking of both operands, and extraction across the end of the source word.

What is in it

  • Add gpu_unsigned_bfe_width_and_offset_bounds to crates/xcl/src/gpu/recomp/tests.rs.

Tested

  • Windows 11 Pro build 26300, AMD Ryzen 5 7600X, NVIDIA GeForce RTX 4060, driver 32.0.16.2124, Rust and Cargo 1.100.0 (x86_64-pc-windows-msvc), DXC 1.9.2602.17, debug profile. Tested base 9e3831e1f570d3646e53ab753b19ec07eb8f1485 with the proposed diff applied.
  • cargo test -p xcl --lib gpu_unsigned_bfe_width_and_offset_bounds -- --nocapture — 1 passed, 0 failed, 0 ignored, 0 GPU skips, 748 filtered out. All 32 wave32 lanes matched their expected results, covering all five cases.
  • powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\scripts\test.ps1 with RUST_TEST_NOCAPTURE=1 — 777 passed as reported by Cargo, 0 failed, 41 ignored, 0 filtered out. The pass count includes the three GPU skips below.
  • GPU skips — gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware (no wave64), and heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • git diff --check — passed.

Regression run

  • The diff is confined to tests.rs. The runtime smoke requirement does not apply.

Not tested

  • AMD adapters, native wave64, and retail-title smoke. Sample-dependent paths had no coverage because the XCL_SAMPLE_* variables were unset.

AI use

  • Codex (GPT-6.2-Sol) checked upstream for overlap, implemented the test, ran the local checks, and drafted this description.
<!-- greyfinch-sync:ivall/xcl:issue:5477935826 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1626). Originally posted by [pane33](https://github.com/pane33) on 2026-11-24T18:23:50Z. --- Add GPU coverage for the width and offset bounds of `V_BFE_U32`. The test checks zero width, the maximum effective width, masking of both operands, and extraction across the end of the source word. **What is in it** - Add `gpu_unsigned_bfe_width_and_offset_bounds` to `crates/xcl/src/gpu/recomp/tests.rs`. **Tested** - Windows 11 Pro build 26300, AMD Ryzen 5 7600X, NVIDIA GeForce RTX 4060, driver `32.0.16.2124`, Rust and Cargo `1.100.0` (`x86_64-pc-windows-msvc`), DXC `1.9.2602.17`, debug profile. Tested base `9e3831e1f570d3646e53ab753b19ec07eb8f1485` with the proposed diff applied. - `cargo test -p xcl --lib gpu_unsigned_bfe_width_and_offset_bounds -- --nocapture` — 1 passed, 0 failed, 0 ignored, 0 GPU skips, 748 filtered out. All 32 wave32 lanes matched their expected results, covering all five cases. - `powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\scripts\test.ps1` with `RUST_TEST_NOCAPTURE=1` — 777 passed as reported by Cargo, 0 failed, 41 ignored, 0 filtered out. The pass count includes the three GPU skips below. - GPU skips — `gpu_geometry_wave32_prefix_count_over_a_mask` and `gpu_wave32_program_in_wave64_hardware` (`no wave64`), and `heap_window_out_of_memory_falls_back_to_the_switch_form` (`no heap windows`). - `git diff --check` — passed. **Regression run** - The diff is confined to `tests.rs`. The runtime smoke requirement does not apply. **Not tested** - AMD adapters, native wave64, and retail-title smoke. Sample-dependent paths had no coverage because the `XCL_SAMPLE_*` variables were unset. **AI use** - Codex (GPT-6.2-Sol) checked upstream for overlap, implemented the test, ran the local checks, and drafted this description.
Belox17 commented 2026-11-24 21:09:13 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Belox17 on 2026-11-24T20:02:49Z.


Test report for d6f33d6f on NVIDIA (RTX 3060 Ti): the new GPU test passes and nothing else changes

Tested

  • NVIDIA GeForce RTX 3060 Ti 8 GB (32-lane waves), driver 32.0.16.2124; Ryzen 5 5600X; Windows 11 build 26300; rustc 1.98.1 MSVC; DXC 1.8.2502.11 (Windows SDK 10.0.26100); debug build. Head d6f33d6f as is (base 9e3831e), clean tree.
  • The new test (gpu_unsigned_bfe_width_and_offset_bounds) with cargo test -p xcl --lib <name>: 1 passed (the GPU part ran on this adapter, no SKIPPED).
  • cargo test --workspace -- --test-threads=4 on the head: 777 passed, 0 failed, 41 ignored; its base 9e3831e on the same machine: 776 passed, 0 failed, 41 ignored. SKIPPED on both: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware (no wave64), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • Merged into current main c160d86e (clean merge): 859 passed, 0 failed, 42 ignored; main alone: 858 passed, 0 failed, 42 ignored, the same three SKIPPED as above.

Not tested

  • AMD / native wave64 hardware; any retail title (no smoke run).

AI use: Claude Code (Claude Opus 5.5) ran the commands on this machine and wrote this report from those runs.

<!-- greyfinch-sync:ivall/xcl:comment:7142964972 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1626#issuecomment-7142964972). Originally posted by [Belox17](https://github.com/Belox17) on 2026-11-24T20:02:49Z. --- **Test report for `d6f33d6f` on NVIDIA (RTX 3060 Ti): the new GPU test passes and nothing else changes** **Tested** - NVIDIA GeForce RTX 3060 Ti 8 GB (32-lane waves), driver 32.0.16.2124; Ryzen 5 5600X; Windows 11 build 26300; rustc 1.98.1 MSVC; DXC 1.8.2502.11 (Windows SDK 10.0.26100); debug build. Head `d6f33d6f` as is (base `9e3831e`), clean tree. - The new test (`gpu_unsigned_bfe_width_and_offset_bounds`) with `cargo test -p xcl --lib <name>`: 1 passed (the GPU part ran on this adapter, no `SKIPPED`). - `cargo test --workspace -- --test-threads=4` on the head: **777 passed, 0 failed, 41 ignored**; its base `9e3831e` on the same machine: 776 passed, 0 failed, 41 ignored. SKIPPED on both: `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware` (no wave64), `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). - Merged into current `main` `c160d86e` (clean merge): **859 passed, 0 failed, 42 ignored**; `main` alone: 858 passed, 0 failed, 42 ignored, the same three SKIPPED as above. **Not tested** - AMD / native wave64 hardware; any retail title (no smoke run). **AI use:** Claude Code (Claude Opus 5.5) ran the commands on this machine and wrote this report from those runs.
DavidM1911 commented 2026-11-24 21:09:40 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T20:46:40Z.


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!

<!-- greyfinch-sync:ivall/xcl:comment:7144041896 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1626#issuecomment-7144041896). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T20:46:40Z. --- 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!
github-actions[bot] commented 2026-11-28 08:00:48 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-28T08:00:48Z.


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:7236304444 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1626#issuecomment-7236304444). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-28T08:00:48Z. --- 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 06:19:42 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T06:19:42Z.


Triage (#1607) – head d6f33d6

No merged test covers these v_bfe_u32 cases: main has only gpu_signed_bfe_arithmetic_shift and BFEs with constant fields. #2171 (opened later, a DXIL lowering change) adds gpu_v_bfe_edge_cases, a superset of these cases for u32 and i32. Keep only one of the two if #2171 lands.
The expected values match (S0 >> (S1 & 31)) & ((1 << (S2 & 31)) - 1). No problems found in the diff.
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:7302746216 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1626#issuecomment-7302746216). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T06:19:42Z. --- **Triage (#1607)** – head d6f33d6 No merged test covers these `v_bfe_u32` cases: main has only `gpu_signed_bfe_arithmetic_shift` and BFEs with constant fields. #2171 (opened later, a DXIL lowering change) adds `gpu_v_bfe_edge_cases`, a superset of these cases for u32 and i32. Keep only one of the two if #2171 lands. The expected values match `(S0 >> (S1 & 31)) & ((1 << (S2 & 31)) - 1)`. No problems found in the diff. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
grathepic commented 2026-12-03 00:02:25 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by grathepic on 2026-12-03T00:02:25Z.


merge-check

  • base: 078358a058
  • head: d6f33d6f33
  • merge: clean (git diff --check exit 0)
  • build: cargo +1.98.1-x86_64-pc-windows-msvc build --offline --locked --workspace — exit 0 (36 pre-existing warnings in xcl lib)
  • tests: cargo +1.98.1-x86_64-pc-windows-msvc test --offline --locked --workspace --no-fail-fast -- --test-threads=4 (with XCL_DXC_DIR=C:\VulkanSDK\1.4.363.0\Bin) — 3006 passed, 1 failed, 52 ignored across 44 harnesses; 27 SKIPPED (22 no wave64, 2 no heap windows, 1 no GPU_UPLOAD heaps, 1 no dxil.dll, 1 cannot disable the driver cache (Windows Developer Mode required)). New GPU test gpu::recomp::tests::gpu_unsigned_bfe_width_and_offset_bounds ran and passed with 0 skips. The single failure was an unrelated pre-existing 5 s late-release timeout flake in tests\gpu_two_pass_cache_e2e.rs:584 (two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs); immediate rerun cargo +1.98.1-x86_64-pc-windows-msvc test --offline --locked -p xcl --test gpu_two_pass_cache_e2e -- --nocapture passed (1 passed, 0 failed in 5.87s).
  • title run: not required (Tier 0 test-only PR; adds one unit test in crates/xcl/src/gpu/recomp/tests.rs with zero production code or dependency changes)
  • review: Read full 33-line diff. Strictly test-only (+33/-0), placed alongside gpu_signed_bfe_arithmetic_shift and using gpu_waves() (wave32 on NVIDIA, wave64+wave32 on AMD, skips cleanly without GPU/DXC). Pre-fills destination v4 with u32::MAX and verifies all 5 RDNA2 V_BFE_U32 boundary cases (width = 0, width = 31, 5-bit width masking 32 -> 0, straddling bit 31 offset = 30, width = 6, and combined offset+width masking 40 -> 8, 36 -> 4). Note: open PR #2171 (currently dirty/unmerged) includes a superset BFE test, per #1607 triage.
  • performance: not applicable (test-only)
  • verdict: safe to merge
  • hardware / tool and model: NVIDIA GeForce RTX 3080 (driver 32.0.16.2140), AMD Ryzen 7 5800X3D, Windows 11 (10.0.26300.0), Rust 1.98.1-x86_64-pc-windows-msvc, DXC 1.9.0.5512 (VulkanSDK, no dxil.dll) / Antigravity, Gemini 4 Neon
<!-- greyfinch-sync:ivall/xcl:comment:7362724822 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1626#issuecomment-7362724822). Originally posted by [grathepic](https://github.com/grathepic) on 2026-12-03T00:02:25Z. --- merge-check - base: 078358a058f7ba5d16690dba8dc4e55d2c88ae0a - head: d6f33d6f33cea784f7ea92d9cb468cffe239bbee - merge: clean (`git diff --check` exit 0) - build: `cargo +1.98.1-x86_64-pc-windows-msvc build --offline --locked --workspace` — exit 0 (36 pre-existing warnings in `xcl` lib) - tests: `cargo +1.98.1-x86_64-pc-windows-msvc test --offline --locked --workspace --no-fail-fast -- --test-threads=4` (with `XCL_DXC_DIR=C:\VulkanSDK\1.4.363.0\Bin`) — 3006 passed, 1 failed, 52 ignored across 44 harnesses; 27 SKIPPED (22 no wave64, 2 no heap windows, 1 no GPU_UPLOAD heaps, 1 no dxil.dll, 1 cannot disable the driver cache (Windows Developer Mode required)). New GPU test `gpu::recomp::tests::gpu_unsigned_bfe_width_and_offset_bounds` ran and passed with 0 skips. The single failure was an unrelated pre-existing 5 s late-release timeout flake in `tests\gpu_two_pass_cache_e2e.rs:584` (`two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs`); immediate rerun `cargo +1.98.1-x86_64-pc-windows-msvc test --offline --locked -p xcl --test gpu_two_pass_cache_e2e -- --nocapture` passed (1 passed, 0 failed in 5.87s). - title run: not required (Tier 0 test-only PR; adds one unit test in `crates/xcl/src/gpu/recomp/tests.rs` with zero production code or dependency changes) - review: Read full 33-line diff. Strictly test-only (`+33/-0`), placed alongside `gpu_signed_bfe_arithmetic_shift` and using `gpu_waves()` (wave32 on NVIDIA, wave64+wave32 on AMD, skips cleanly without GPU/DXC). Pre-fills destination `v4` with `u32::MAX` and verifies all 5 RDNA2 `V_BFE_U32` boundary cases (`width = 0`, `width = 31`, 5-bit width masking `32 -> 0`, straddling bit 31 `offset = 30, width = 6`, and combined offset+width masking `40 -> 8, 36 -> 4`). Note: open PR #2171 (currently dirty/unmerged) includes a superset BFE test, per #1607 triage. - performance: not applicable (test-only) - verdict: safe to merge - hardware / tool and model: NVIDIA GeForce RTX 3080 (driver 32.0.16.2140), AMD Ryzen 7 5800X3D, Windows 11 (10.0.26300.0), Rust 1.98.1-x86_64-pc-windows-msvc, DXC 1.9.0.5512 (VulkanSDK, no dxil.dll) / Antigravity, Gemini 4 Neon
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/1626:upstream-pr/1626'
git switch 'upstream-pr/1626'

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/1626'
git switch 'upstream-pr/1626'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1626'
git switch 'upstream-pr/1626'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1626'
git switch 'main'
git merge --squash 'upstream-pr/1626'
git switch 'main'
git merge --ff-only 'upstream-pr/1626'
git switch 'main'
git merge 'upstream-pr/1626'
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!1616
No description provided.