Shaders: lower v_permlanex16_b32 without fetch-inactive #3560

Open
pablogonz12 wants to merge 1 commit from upstream-pr/3560 into main
pablogonz12 commented 2026-11-27 17:50:28 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by pablogonz12 on 2026-11-27T17:50:28Z.


Summary

I lower v_permlanex16_b32 with fetch-inactive clear by selecting the source from the opposite 16-lane row using the two selector words. I ballot source activity and avoid reading an inactive source; when it is inactive, I preserve the destination for BC=0 or write zero for BC=1. Compute shaders using this path request the console wave size. I based the lane selection on work by fxceless.

FI=1 behaviour is unchanged; its inactive-lane semantics are a separate question.

Evidence

  • In an offline translation and pipeline check on 2,912 programs, I measured 2,861 → 2,862 successful pipelines. Program 748 now builds; no successful pipeline was lost. Comparing translated output showed exactly one newly translated program and no changes to the other translated programs.
  • I ran the partial-EXEC regression against an ISA-derived reference for BC=0 and BC=1: 2 passed, 0 failed, 0 skipped. Windows-target shader clippy passed with warnings denied.
  • Tested on RX 9070 XT / RADV under Proton; not tested on NVIDIA hardware.

Merge Danger

Door: Two-way
Blast Radius: Shader translation

<!-- greyfinch-sync:Marvisak/VIctory:issue:5530924460 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3560). Originally posted by [pablogonz12](https://github.com/pablogonz12) on 2026-11-27T17:50:28Z. --- ## Summary I lower `v_permlanex16_b32` with fetch-inactive clear by selecting the source from the opposite 16-lane row using the two selector words. I ballot source activity and avoid reading an inactive source; when it is inactive, I preserve the destination for BC=0 or write zero for BC=1. Compute shaders using this path request the console wave size. I based the lane selection on work by fxceless. FI=1 behaviour is unchanged; its inactive-lane semantics are a separate question. ## Evidence - In an offline translation and pipeline check on 2,912 programs, I measured **2,861 → 2,862** successful pipelines. Program 748 now builds; no successful pipeline was lost. Comparing translated output showed exactly one newly translated program and no changes to the other translated programs. - I ran the partial-EXEC regression against an ISA-derived reference for BC=0 and BC=1: **2 passed, 0 failed, 0 skipped**. Windows-target shader clippy passed with warnings denied. - Tested on RX 9070 XT / RADV under Proton; not tested on NVIDIA hardware. ## Merge Danger **Door:** Two-way **Blast Radius:** Shader translation
kilolimaVI commented 2026-11-27 18:27:16 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by kilolimaVI on 2026-11-27T18:27:16Z.


Verified on AMD hardware, head b2d087e: Windows 11, Radeon 780M (RDNA3 iGPU, 32-lane waves available), toolchain 1.98.1.

  • permlanex_partial_exec_matches_reference: [SUMMARY] permlanex: 2 passed, 0 failed, 0 skipped, so it ran on the 780M with 32-lane waves as well as on WARP; 0/10 failures over 10 runs.
  • cargo test -p victory-shader on the 780M: 303 passed, 0 failed.

AI-assisted (Claude).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7225504050 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3560#issuecomment-7225504050). Originally posted by [kilolimaVI](https://github.com/kilolimaVI) on 2026-11-27T18:27:16Z. --- Verified on AMD hardware, head b2d087e: Windows 11, Radeon 780M (RDNA3 iGPU, 32-lane waves available), toolchain 1.98.1. - `permlanex_partial_exec_matches_reference`: `[SUMMARY] permlanex: 2 passed, 0 failed, 0 skipped`, so it ran on the 780M with 32-lane waves as well as on WARP; 0/10 failures over 10 runs. - `cargo test -p victory-shader` on the 780M: 303 passed, 0 failed. AI-assisted (Claude).
cloph-dsp commented 2026-11-27 18:32:38 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-27T18:32:38Z.


Independent CPU-only verification on Windows / Rust 1.100.0 / MSVC.

  • PR head: b2d087e53e637c7dcc1ab1c4a880963c10d59dbb, merge base 63bcca43c6a00a758510398fa43096ce7e4f7df0.
  • Command: cargo test --locked -p victory-shader --lib -- emit::crosslane_tests::permlanex_partial_exec_matches_reference --exact --test-threads=1 --quiet
  • Result: test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 305 filtered out, exit 0.
  • Negative control: git grep -F -c permlanex_partial_exec_matches_reference 63bcca43 -- . → exit 1 / 0 hits (test genuinely new); present on PR head.
  • git diff --check 63bcca43 HEAD → exit 0.
  • Caveat: only the synthetic wave32 CPU reference test was replayed; no DXIL validator, WARP or real hardware run, and the full crate suite was not run.
  • GPU/driver: N/A (CPU-only test). No game data, assets, extracted shaders or DRM involved.
  • AI-assisted: Hy4 flash.
<!-- greyfinch-sync:Marvisak/VIctory:comment:7225597293 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3560#issuecomment-7225597293). Originally posted by [cloph-dsp](https://github.com/cloph-dsp) on 2026-11-27T18:32:38Z. --- Independent CPU-only verification on Windows / Rust 1.100.0 / MSVC. - PR head: `b2d087e53e637c7dcc1ab1c4a880963c10d59dbb`, merge base `63bcca43c6a00a758510398fa43096ce7e4f7df0`. - Command: `cargo test --locked -p victory-shader --lib -- emit::crosslane_tests::permlanex_partial_exec_matches_reference --exact --test-threads=1 --quiet` - Result: `test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 305 filtered out`, exit 0. - Negative control: `git grep -F -c permlanex_partial_exec_matches_reference 63bcca43 -- .` → exit 1 / 0 hits (test genuinely new); present on PR head. - `git diff --check 63bcca43 HEAD` → exit 0. - Caveat: only the synthetic wave32 CPU reference test was replayed; no DXIL validator, WARP or real hardware run, and the full crate suite was not run. - GPU/driver: N/A (CPU-only test). No game data, assets, extracted shaders or DRM involved. - AI-assisted: Hy4 flash.
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/3560:upstream-pr/3560'
git switch 'upstream-pr/3560'

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