victory-shader: preserve helper-lane values on pixel waveReadLaneFirst #946

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

@⁠Sakura-Byte on GitHub · 2026-11-24 14:25 UTC · original
Sakura-Byte:pr/ps-helper-readfirstlane → main · +344 −1 · 2 files · 1 commits · open

Problem

In pixel shaders, DXIL waveReadLaneFirst reads the first active non-helper lane, whereas console RDNA2 WQM keeps pixel helper lanes active in EXEC. When a pixel waterfall loop guards or advances on a helper lane's descriptor or value, sharing the non-helper lane's waveReadLaneFirst result stalls the quad loop.

Fix

  • Emit SM 6.6 dx.op.isHelperLane.i1 (opcode 221) in pixel_own_if_helper and select each lane's own value when isHelperLane() holds, gated strictly on pixel shaders in wave_read_lane_first, wave_read_first_masked, and address_dynamic.
  • Non-pixel stages (compute, mesh, vertex) remain unchanged.
  • Verify with synthetic partial-quad execution and dxil.dll validation.

Verification

  • cargo xtask policy: 154 files ok
  • cargo clippy --workspace --all-targets --locked -- -D warnings: clean
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: clean
  • cargo test --workspace --locked -- --test-threads=1: 344 passed; 0 failed on Windows 11 + NVIDIA GeForce RTX 5090 D & WARP (dxil.dll validated)

AI-assisted; synthetic tests only, zero game assets.

**@⁠Sakura-Byte** on GitHub · 2026-11-24 14:25 UTC · [original](https://github.com/Marvisak/VIctory/pull/946) `Sakura-Byte:pr/ps-helper-readfirstlane` → `main` · +344 −1 · 2 files · 1 commits · open ### Problem In pixel shaders, DXIL `waveReadLaneFirst` reads the first active non-helper lane, whereas console RDNA2 WQM keeps pixel helper lanes active in `EXEC`. When a pixel waterfall loop guards or advances on a helper lane's descriptor or value, sharing the non-helper lane's `waveReadLaneFirst` result stalls the quad loop. ### Fix - Emit SM 6.6 `dx.op.isHelperLane.i1` (opcode 221) in `pixel_own_if_helper` and select each lane's own value when `isHelperLane()` holds, gated strictly on pixel shaders in `wave_read_lane_first`, `wave_read_first_masked`, and `address_dynamic`. - Non-pixel stages (compute, mesh, vertex) remain unchanged. - Verify with synthetic partial-quad execution and `dxil.dll` validation. ### Verification - `cargo xtask policy`: `154 files ok` - `cargo clippy --workspace --all-targets --locked -- -D warnings`: clean - `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings`: clean - `cargo test --workspace --locked -- --test-threads=1`: `344 passed; 0 failed` on Windows 11 + NVIDIA GeForce RTX 5090 D & WARP (`dxil.dll` validated) *AI-assisted; synthetic tests only, zero game assets.*
DXIL waveReadLaneFirst skips pixel helper lanes while console WQM keeps them active in EXEC, stalling pixel waterfall loops. In pixel shaders, select each lane's own value when dx.op.isHelperLane.i1() holds, and verify DXIL validation, non-pixel exclusion, and partial-quad execution.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:14:39 +00:00
Author
Owner

@⁠claude-GTA6 on GitHub · 2026-11-24 14:46 UTC · original

From a tester working with Claude (AI-assisted); measured on my own machine.

A data point for this change, from the same idea on my branch (@⁠Vaximous's finding on #307; my version is claude-GTA6/VIctory pr-helper-readfirstlane, since I can't open PRs right now). RTX 5090, GTA VI 1.0.2.1, default loop limit: pixel 1af4a50c7fb40c97 (a light loop that takes its counter with v_readfirstlane and exits on a match) had 4-6 draws over 100 ms per run before, one of them 1,163 ms for 4 mesh groups; with the fix it had one. Other slow programs stayed (compute 42683eebec081520, which has no helper lanes), so on my card this doesn't end the world hang alone. Runs with and without it under a loop cap of 256 both ran 15 minutes without a device removal. Not tested on AMD.

**@⁠claude-GTA6** on GitHub · 2026-11-24 14:46 UTC · [original](https://github.com/Marvisak/VIctory/pull/946#issuecomment-7134916107) *From a tester working with Claude (AI-assisted); measured on my own machine.* A data point for this change, from the same idea on my branch (@⁠Vaximous's finding on #307; my version is [claude-GTA6/VIctory `pr-helper-readfirstlane`](https://github.com/claude-GTA6/VIctory/tree/pr-helper-readfirstlane), since I can't open PRs right now). RTX 5090, GTA VI 1.0.2.1, default loop limit: pixel `1af4a50c7fb40c97` (a light loop that takes its counter with `v_readfirstlane` and exits on a match) had 4-6 draws over 100 ms per run before, one of them 1,163 ms for 4 mesh groups; with the fix it had one. Other slow programs stayed (compute `42683eebec081520`, which has no helper lanes), so on my card this doesn't end the world hang alone. Runs with and without it under a loop cap of 256 both ran 15 minutes without a device removal. Not tested on AMD.
Author
Owner

@⁠Zipettte on GitHub · 2026-11-24 15:40 UTC · original

Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at c159604: cargo test -p victory-shader passes, 122 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).

Tested with AI assistance (Claude).

**@⁠Zipettte** on GitHub · 2026-11-24 15:40 UTC · [original](https://github.com/Marvisak/VIctory/pull/946#issuecomment-7136428362) Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at c159604: `cargo test -p victory-shader` passes, 122 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed). _Tested with AI assistance (Claude)._
Author
Owner

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

Automated triage for the maintainers.

Needs rebase. This PR does not merge cleanly into current main (ac2525d). Conflicting files: crates/victory-shader/src/emit/lower.rs.

The content has not been reviewed yet; it will be once the branch is rebased onto main.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 00:28 UTC · [original](https://github.com/Marvisak/VIctory/pull/946#issuecomment-7148551686) <!-- victory-triage v1 head=c1596049299bf598c664f1fefff885b57155bcbe verdict=needs-rebase at=2026-11-25T00:13:20Z --> Automated triage for the maintainers. **Needs rebase.** This PR does not merge cleanly into current `main` (ac2525d). Conflicting files: `crates/victory-shader/src/emit/lower.rs`. The content has not been reviewed yet; it will be once the branch is rebased onto `main`. --- _Generated by [Claude Code](https://claude.ai/code)_
This pull request has changes conflicting with the target branch.
  • crates/victory-shader/src/emit/bitcode.rs
  • crates/victory-shader/src/emit/lower.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/946/head:github-bot/gh-946'
git switch 'github-bot/gh-946'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-946'
git switch 'github-bot/gh-946'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-946'
git switch 'github-bot/gh-946'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-946'
git switch 'main'
git merge --squash 'github-bot/gh-946'
git switch 'main'
git merge --ff-only 'github-bot/gh-946'
git switch 'main'
git merge 'github-bot/gh-946'
git push origin 'main'
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!946
No description provided.