Shaders: a pixel program's killed lanes go on with their live quad (s_wqm), as on the console: sparkling glass #354

Open
Serph91P wants to merge 2 commits from upstream-pr/354 into main
Serph91P commented 2026-11-26 18:16:41 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by Serph91P on 2026-11-26T18:16:41Z.


A glass material (PS_Textured_Eight, b37565055f2f7d3b) wrote NaN and values near 65504 into the scene colour at 560 to 1,590 texels of one small globe; depth of field turned each into a coloured bokeh dot that changed every frame. Two commits on 2de9980.

Cause: the program kills pixels in a 2x2 dither, then sums its probe lighting across the quad (quad_perm moves) and divides by the summed weight. On the console a killed lane of a live quad runs on as a helper until the export (s_wqm). structure.rs decided the "no lane live" branch on each lane's own bit, so killed lanes left at the kill and the quad reads took values from lanes that had returned. The module comment assumed helper values are read only through derivatives.

What this does

  • structure.rs: the condition of a mask operation whose result an s_wqm reads is "own bit or quad"; killed lanes of a live quad go on and are discarded at the export. Unit test added.
  • emit/lower.rs: a colour export before the last one is accepted under the same guard as the final export.
  • 13 of the title's programs then meet "a constant lane mask is not supported"; those are translated as before (a retry without the rule), so nothing that translated is lost.
  • TRANSLATOR_VERSION 1 → 2: about 19% of the archive's programs come out different. #353 also goes 1 → 2 on its own; whichever lands second needs 3.

Tested (RX 7900 XTX, RADV Mesa 26.3.1, vkd3d-proton 71cae091, Proton Experimental)

  • Recorded frame, three replays: 0 non-finite texels at the globe (before: 561, 1,357, 1,587), results equal across runs; outside the globe one more small glass object loses its blue dot, nothing else changes.
  • In the title: the globe and other small glass objects no longer sparkle (observer); steady frame time unchanged (median 66.8 ms against 63–67 ms).
  • This branch alone: builds for x86_64-pc-windows-msvc (cargo-xwin); the whole archive gives 25,694 that translate and 195 that do not, all for the reason they had before; cargo test -p victory-shader --lib (210 passed), cargo xtask policy and cargo test -p xtask pass.

Not tested: Windows, NVIDIA. The 13 programs that fall back (ten mirror materials, two red-dot sights, one glass) may still have the fault.

No game data in the commits.

🤖 Generated with Claude Code

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:issue:5515135416 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/354). Originally posted by [Serph91P](https://github.com/Serph91P) on 2026-11-26T18:16:41Z. --- A glass material (`PS_Textured_Eight`, b37565055f2f7d3b) wrote NaN and values near 65504 into the scene colour at 560 to 1,590 texels of one small globe; depth of field turned each into a coloured bokeh dot that changed every frame. Two commits on 2de9980. **Cause:** the program kills pixels in a 2x2 dither, then sums its probe lighting across the quad (`quad_perm` moves) and divides by the summed weight. On the console a killed lane of a live quad runs on as a helper until the export (`s_wqm`). `structure.rs` decided the "no lane live" branch on each lane's own bit, so killed lanes left at the kill and the quad reads took values from lanes that had returned. The module comment assumed helper values are read only through derivatives. **What this does** - `structure.rs`: the condition of a mask operation whose result an `s_wqm` reads is "own bit or quad"; killed lanes of a live quad go on and are discarded at the export. Unit test added. - `emit/lower.rs`: a colour export before the last one is accepted under the same guard as the final export. - 13 of the title's programs then meet "a constant lane mask is not supported"; those are translated as before (a retry without the rule), so nothing that translated is lost. - `TRANSLATOR_VERSION` 1 → 2: about 19% of the archive's programs come out different. #353 also goes 1 → 2 on its own; whichever lands second needs 3. **Tested** (RX 7900 XTX, RADV Mesa 26.3.1, vkd3d-proton 71cae091, Proton Experimental) - Recorded frame, three replays: 0 non-finite texels at the globe (before: 561, 1,357, 1,587), results equal across runs; outside the globe one more small glass object loses its blue dot, nothing else changes. - In the title: the globe and other small glass objects no longer sparkle (observer); steady frame time unchanged (median 66.8 ms against 63–67 ms). - This branch alone: builds for `x86_64-pc-windows-msvc` (cargo-xwin); the whole archive gives 25,694 that translate and 195 that do not, all for the reason they had before; `cargo test -p victory-shader --lib` (210 passed), `cargo xtask policy` and `cargo test -p xtask` pass. **Not tested:** Windows, NVIDIA. The 13 programs that fall back (ten mirror materials, two red-dot sights, one glass) may still have the fault. No game data in the commits. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
UwUCammie commented 2026-11-26 21:40:50 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by UwUCammie on 2026-11-26T21:40:50Z.


I have a possible second scene to test on the Radeon branch. In the transition to a blurred face in the opening cutscene, large bright squares appear over the face, followed by dark squares, then the same area clears. In three consecutive 4 Hz captures, a 10×10 patch at one bright square averaged RGB (210,222,234), (45,36,28), (45,36,28). A separate patch went (39,30,23), (11,9,5), (39,30,22). This was on the RX 7900 XT, RADV 26.3.1, Wine 11.22, with the ambient reflection pass enabled. My executable predates this shader change. The capture establishes the transient squares. I haven’t identified the material or checked whether your fix changes this scene.

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:comment:7203958082 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/354#issuecomment-7203958082). Originally posted by [UwUCammie](https://github.com/UwUCammie) on 2026-11-26T21:40:50Z. --- I have a possible second scene to test on the Radeon branch. In the transition to a blurred face in the opening cutscene, large bright squares appear over the face, followed by dark squares, then the same area clears. In three consecutive 4 Hz captures, a 10×10 patch at one bright square averaged RGB (210,222,234), (45,36,28), (45,36,28). A separate patch went (39,30,23), (11,9,5), (39,30,22). This was on the RX 7900 XT, RADV 26.3.1, Wine 11.22, with the ambient reflection pass enabled. My executable predates this shader change. The capture establishes the transient squares. I haven’t identified the material or checked whether your fix changes this scene.
UwUCammie commented 2026-11-26 21:57:26 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by UwUCammie on 2026-11-26T21:57:26Z.


The affected pixel shader was bound before the diner artifact in both 720p captures. The log does not identify which material drew the flashing squares.

I also found that if the constant-mask retry unwinds and its caller catches the panic, the next shader on that worker can inherit disabled live-quad handling. The regression test fails on 301867af and passes with the scoped restore. I sent the fix directly against this branch. The native shader suite passed 211 tests, with two ignored. Scoped restore and regression test

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:comment:7204221252 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/354#issuecomment-7204221252). Originally posted by [UwUCammie](https://github.com/UwUCammie) on 2026-11-26T21:57:26Z. --- The affected pixel shader was bound before the diner artifact in both 720p captures. The log does not identify which material drew the flashing squares. I also found that if the constant-mask retry unwinds and its caller catches the panic, the next shader on that worker can inherit disabled live-quad handling. The regression test fails on 301867af and passes with the scoped restore. I sent the fix directly against this branch. The native shader suite passed 211 tests, with two ignored. [Scoped restore and regression test](https://github.com/Serph91P/VIctory-7900XTX/pull/1)
UwUCammie commented 2026-11-27 05:00:40 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by UwUCammie on 2026-11-27T05:00:40Z.


The 720p cold pair finished on RX 7900 XT with RADV and GE vkd3d-proton cae8353ed7959c4. Both launches had the reflection clamp enabled. The live-quad translator plus unwind fix accepted 2,525 presents in 300 seconds, against 2,409 on the control. The P99 gap went from 921 ms to 2,209 ms. Several late living-room shots matched, with similar lighting in the sampled frames. The available matches and 4 Hz capture don't establish whether the diner flicker changed. Run details

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:comment:7210273811 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/354#issuecomment-7210273811). Originally posted by [UwUCammie](https://github.com/UwUCammie) on 2026-11-27T05:00:40Z. --- The 720p cold pair finished on RX 7900 XT with RADV and GE vkd3d-proton `cae8353ed7959c4`. Both launches had the reflection clamp enabled. The live-quad translator plus unwind fix accepted 2,525 presents in 300 seconds, against 2,409 on the control. The P99 gap went from 921 ms to 2,209 ms. Several late living-room shots matched, with similar lighting in the sampled frames. The available matches and 4 Hz capture don't establish whether the diner flicker changed. [Run details](https://github.com/UwUCammie/victory-amd/commit/694fcb34)
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/354:upstream-pr/354'
git switch 'upstream-pr/354'

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