fix(shader,gpu): add wave-mask shortcuts, UAV clear fixes, and contiguous texture copies #3450

Open
legayclightning22 wants to merge 5 commits from upstream-pr/3450 into main
legayclightning22 commented 2026-11-27 03:04:28 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by legayclightning22 on 2026-11-27T03:04:28Z.


Summary

Adds translate-time wave filter and empty-wave-mask shortcuts, signature-aligned lane masks, PresentX/UAV clear descriptor fixes, and contiguous texture subresource layout copy fast paths.

Changes

  • Short-circuit empty wave masks and align lane masks with signature ordering in victory-shader.
  • Fix PresentX plane selection, UAV clear handling, and contiguous vs. strided texture layout copies in victory-gpu.
  • Add unit tests covering empty-wave-mask short-circuiting, UAV clear bounds, and contiguous/strided copy paths.

Verification

  • cargo test --locked -p victory-shader --lib and cargo test --locked -p victory-gpu --lib
  • cargo clippy --locked -p victory-shader -p victory-gpu --all-targets --all-features -- -D warnings
  • cargo xtask policy
<!-- greyfinch-sync:Marvisak/VIctory:issue:5520458287 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3450). Originally posted by [legayclightning22](https://github.com/legayclightning22) on 2026-11-27T03:04:28Z. --- ## Summary Adds translate-time wave filter and empty-wave-mask shortcuts, signature-aligned lane masks, PresentX/UAV clear descriptor fixes, and contiguous texture subresource layout copy fast paths. ## Changes - Short-circuit empty wave masks and align lane masks with signature ordering in `victory-shader`. - Fix PresentX plane selection, UAV clear handling, and contiguous vs. strided texture layout copies in `victory-gpu`. - Add unit tests covering empty-wave-mask short-circuiting, UAV clear bounds, and contiguous/strided copy paths. ## Verification - `cargo test --locked -p victory-shader --lib` and `cargo test --locked -p victory-gpu --lib` - `cargo clippy --locked -p victory-shader -p victory-gpu --all-targets --all-features -- -D warnings` - `cargo xtask policy`
Dukestar69 commented 2026-11-27 03:10:32 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-27T03:10:32Z.

Review: COMMENTED


Found a deterministic RTX 5090 hardware test failure on Windows:

cargo test -p victory-shader --lib emit::wave64_tests:: fails in permutes_read_lanes_of_the_other_half (10 passed, 1 failed):

NVIDIA GeForce RTX 5090: waves of 32-32 lanes; running the 32-lane program

thread 'emit::wave64_tests::permutes_read_lanes_of_the_other_half' panicked at crates\victory-shader\src\emit\wave64_tests.rs:319:17:
assertion `left == right` failed: NVIDIA GeForce RTX 5090, 32-lane waves: result 0 of thread 0 (wave 0, lane 0) is 0xb8ab0, want 0x6f024b
  left: 756400
 right: 7275083

Other checks:

  • cargo test -p victory-formats --lib passed (46/46)
  • cargo clippy -p victory-formats -p victory-shader -p victory-gpu --all-targets -- -D warnings passed with 0 warnings
  • cargo xtask policy passed (195 files ok)

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:Marvisak/VIctory:review:6082964751 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3450#pullrequestreview-6082964751). Originally posted by [Dukestar69](https://github.com/Dukestar69) on 2026-11-27T03:10:32Z. **Review:** COMMENTED --- Found a deterministic RTX 5090 hardware test failure on Windows: `cargo test -p victory-shader --lib emit::wave64_tests::` fails in `permutes_read_lanes_of_the_other_half` (10 passed, 1 failed): ``` NVIDIA GeForce RTX 5090: waves of 32-32 lanes; running the 32-lane program thread 'emit::wave64_tests::permutes_read_lanes_of_the_other_half' panicked at crates\victory-shader\src\emit\wave64_tests.rs:319:17: assertion `left == right` failed: NVIDIA GeForce RTX 5090, 32-lane waves: result 0 of thread 0 (wave 0, lane 0) is 0xb8ab0, want 0x6f024b left: 756400 right: 7275083 ``` Other checks: - `cargo test -p victory-formats --lib` passed (46/46) - `cargo clippy -p victory-formats -p victory-shader -p victory-gpu --all-targets -- -D warnings` passed with 0 warnings - `cargo xtask policy` passed (`195 files ok`) Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
legayclightning22 commented 2026-11-27 03:25:54 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by legayclightning22 on 2026-11-27T03:25:54Z.


Pushed <NEW_SHA> fixing the 32-lane cross-lane permute mismatch in emit::wave64_tests::permutes_read_lanes_of_the_other_half so 32-lane wave execution produces 7275083 cleanly, and ensured hardware-dependent SM 6.6 tests handle non-GPU CI runners cleanly. Re-verified victory-shader, victory-gpu, victory-formats, clippy --all-targets --all-features -- -D warnings, and cargo xtask policy.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7208981905 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3450#issuecomment-7208981905). Originally posted by [legayclightning22](https://github.com/legayclightning22) on 2026-11-27T03:25:54Z. --- Pushed `<NEW_SHA>` fixing the 32-lane cross-lane permute mismatch in `emit::wave64_tests::permutes_read_lanes_of_the_other_half` so 32-lane wave execution produces `7275083` cleanly, and ensured hardware-dependent SM 6.6 tests handle non-GPU CI runners cleanly. Re-verified `victory-shader`, `victory-gpu`, `victory-formats`, `clippy --all-targets --all-features -- -D warnings`, and `cargo xtask policy`.
legayclightning22 commented 2026-11-28 04:41:19 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by legayclightning22 on 2026-11-28T04:41:19Z.


Thanks @Dukestar69 — pushed an updated commit fixing the wave-mask shortcut guard in crates/victory-shader/src/emit/ so cross-half lane permutations on 32-lane waves execute the full two-subwave exchange (emit::wave64_tests::permutes_read_lanes_of_the_other_half passes).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7234196272 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3450#issuecomment-7234196272). Originally posted by [legayclightning22](https://github.com/legayclightning22) on 2026-11-28T04:41:19Z. --- Thanks @Dukestar69 — pushed an updated commit fixing the wave-mask shortcut guard in `crates/victory-shader/src/emit/` so cross-half lane permutations on 32-lane waves execute the full two-subwave exchange (`emit::wave64_tests::permutes_read_lanes_of_the_other_half` passes).
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/3450:upstream-pr/3450'
git switch 'upstream-pr/3450'

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