Shaders: follow paired dword mask copies #702

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

@⁠Flyander on GitHub · 2026-11-25 05:03 UTC · original
Flyander:fix/paired-dword-mask-provenance → main · +95 −13 · 1 files · 1 commits · open

Summary

Track lane-mask provenance when two adjacent s_mov_b32 instructions copy the low and high dwords into an adjacent SGPR pair in the same block. The source pair is reused only when its symbolic mask contains no opaque atoms, so unknown values remain conservative.

Adds a positive regression test and a negative test for unknown source values.

Retail shader pack results

Windows 11, RTX 5070 Ti, VICTORY_HOST_WAVE=32, victory translate --validate --pipelines --list --jobs 8:

  • “lane mask holding lanes elsewhere read as data”: 2 failures → 0
  • “opaque lane mask”: 1 failure → 0
  • validated programs: 25,383 → 25,386
  • pipelines created: 25,571 → 25,572

The previously failing PS_VoxelizeVisiblity variant now emits, validates, and creates a host pipeline. Two volumetric water shaders now emit and validate too. Their default D3D12 pipeline creation is still refused on this 32-lane host.

Targeted integration with #695

I stacked this commit locally on #695's e5b43c4 head. With global VICTORY_WAVE_WIDE unset and VICTORY_WAVE_WIDE_ONLY=6871d6e4b3ac9a10,926c46bab3b86bd6, both newly unblocked water shaders create pipelines and validate.

Negative control: the unlisted CS_TransmissionVolumetrics_Tiled shader (5dc3b25986622949) validates but its pipeline remains refused. This confirms the per-hash setting does not enable the wide form for unlisted programs. These are targeted offline checks; no in-game visual comparison was made.

Checks

  • cargo test -p victory-shader --lib --locked: 216 passed, 3 ignored
  • cargo clippy -p victory-shader --all-targets --locked -- -D warnings: clean
  • Release build of the local #695 + this-PR stack succeeded (one victory-gpu dead-code warning)
  • git diff --check: clean
**@⁠Flyander** on GitHub · 2026-11-25 05:03 UTC · [original](https://github.com/fxceless/victory-fork/pull/702) `Flyander:fix/paired-dword-mask-provenance` → `main` · +95 −13 · 1 files · 1 commits · open ## Summary Track lane-mask provenance when two adjacent `s_mov_b32` instructions copy the low and high dwords into an adjacent SGPR pair in the same block. The source pair is reused only when its symbolic mask contains no opaque atoms, so unknown values remain conservative. Adds a positive regression test and a negative test for unknown source values. ## Retail shader pack results Windows 11, RTX 5070 Ti, `VICTORY_HOST_WAVE=32`, `victory translate --validate --pipelines --list --jobs 8`: - “lane mask holding lanes elsewhere read as data”: 2 failures → 0 - “opaque lane mask”: 1 failure → 0 - validated programs: 25,383 → 25,386 - pipelines created: 25,571 → 25,572 The previously failing `PS_VoxelizeVisiblity` variant now emits, validates, and creates a host pipeline. Two volumetric water shaders now emit and validate too. Their default D3D12 pipeline creation is still refused on this 32-lane host. ## Targeted integration with #695 I stacked this commit locally on #695's `e5b43c4` head. With global `VICTORY_WAVE_WIDE` unset and `VICTORY_WAVE_WIDE_ONLY=6871d6e4b3ac9a10,926c46bab3b86bd6`, both newly unblocked water shaders create pipelines and validate. Negative control: the unlisted `CS_TransmissionVolumetrics_Tiled` shader (`5dc3b25986622949`) validates but its pipeline remains refused. This confirms the per-hash setting does not enable the wide form for unlisted programs. These are targeted offline checks; no in-game visual comparison was made. ## Checks - `cargo test -p victory-shader --lib --locked`: 216 passed, 3 ignored - `cargo clippy -p victory-shader --all-targets --locked -- -D warnings`: clean - Release build of the local #695 + this-PR stack succeeded (one `victory-gpu` dead-code warning) - `git diff --check`: clean
(cherry picked from commit d1c54f25c6ef75285450bffb4a7f8215754697c7)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:49:16 +00:00
Author
Owner

@⁠JRamos1993 on GitHub · 2026-11-25 05:54 UTC · original

Offline check on the retail shader pack: your result reproduces.

victory translate --validate --list over the title's full shader pack on an RTX 5090, main 310c6eb against this head merged onto it, default settings:

  • 25,382 → 25,385 validated (the 2 "lane mask holding lanes elsewhere read as data" programs and the 1 "opaque lane mask"). None lost.
  • With a local DXIL hash on each validated line, 2 other programs' DXIL changes; both still validate.

AI use: Claude Code with Claude Opus 5.5 ran the pack and wrote this. Nothing from the title is in it.

**@⁠JRamos1993** on GitHub · 2026-11-25 05:54 UTC · [original](https://github.com/fxceless/victory-fork/pull/702#issuecomment-7154259274) **Offline check on the retail shader pack: your result reproduces.** `victory translate --validate --list` over the title's full shader pack on an RTX 5090, `main` `310c6eb` against this head merged onto it, default settings: - 25,382 → **25,385 validated** (the 2 "lane mask holding lanes elsewhere read as data" programs and the 1 "opaque lane mask"). None lost. - With a local DXIL hash on each validated line, **2 other programs' DXIL changes**; both still validate. AI use: Claude Code with Claude Opus 5.5 ran the pack and wrote this. Nothing from the title is in it.
Author
Owner

@⁠Dathinel on GitHub · 2026-11-25 22:57 UTC · original

Synthetic numerical A/B on RTX 3050 Laptop, native wave32. On the local Series S base with the allocator from #561 and the backward permute path from #1166 held fixed, adding only this PR's structure.rs change fixes 18 wrong output words in a wave64 group of 64 threads. Both variants emitted DXIL.

Reproducer: initialize v1 to 42, save EXEC, narrow EXEC to thread IDs below 47, save that mask in s[20:21], restore full EXEC, copy s20 and s21 into s22 and s23 with separate s_mov_b32 instructions, then restore EXEC from s[22:23]. Run ds_bpermute_b32 with address 4*(tid+33) and source tid, restore full EXEC, and store v1 by thread ID. Before: lane 46 reads 47 from an inactive source instead of 0, and lanes 47–63 overwrite the sentinel. After: all 160 words across 16/33/47/64-thread groups match the expected values. The smaller groups also pass before the change.

Run 278 in the public diagnostics records hash 926c46bab3b86bd6 failing mask translation; this test exercises the paired-copy behavior independently. No visual or performance measurement. AI-assisted.

**@⁠Dathinel** on GitHub · 2026-11-25 22:57 UTC · [original](https://github.com/fxceless/victory-fork/pull/702#issuecomment-7176977588) Synthetic numerical A/B on RTX 3050 Laptop, native wave32. On the local Series S base with the allocator from #561 and the backward permute path from #1166 held fixed, adding only this PR's structure.rs change fixes 18 wrong output words in a wave64 group of 64 threads. Both variants emitted DXIL. Reproducer: initialize v1 to 42, save EXEC, narrow EXEC to thread IDs below 47, save that mask in s[20:21], restore full EXEC, copy s20 and s21 into s22 and s23 with separate s_mov_b32 instructions, then restore EXEC from s[22:23]. Run ds_bpermute_b32 with address 4*(tid+33) and source tid, restore full EXEC, and store v1 by thread ID. Before: lane 46 reads 47 from an inactive source instead of 0, and lanes 47–63 overwrite the sentinel. After: all 160 words across 16/33/47/64-thread groups match the expected values. The smaller groups also pass before the change. Run 278 in the public diagnostics records hash 926c46bab3b86bd6 failing mask translation; this test exercises the paired-copy behavior independently. No visual or performance measurement. AI-assisted.
Author
Owner

@⁠Luigilt20 on GitHub · 2026-11-26 04:40 UTC · original · edited 2026-11-26 04:53 UTC

I also tested this change in the Neptune tree at LooperSalty/AnyXboxX@c4c93bd. The structure.rs change applies cleanly. I built the original and patched translation tools and ran the same compute programs through both on Windows 11 using the Windows SDK DXIL validator (dxil.dll 1.9.2602.17).

Selected programs Original, emitted and validated Patched, emitted and validated
Two transmission-volumetrics compute variants 0/2 2/2
Vertex control 1/1 1/1
Five shadow compute variants with a separate descriptor diagnostic 0/5 0/5

Both focused Rust tests for paired DWORD mask provenance also passed on the isolated Neptune test build. This is an offline compiler result. GPU pipeline creation, water appearance and frame rate were outside this measurement. AI-assisted testing and reporting with Codex.

Full-pack follow-up on the same Neptune build and validator, six CPU threads. Of 26,084 programs, 25,687 → 25,689 emitted and 25,616 → 25,618 validated. The two water compute variants were the only gains. Across the 25,889 individually listed programs, none lost either emission or validation. Another 195 export-stage programs had no individual result in either run. No GPU pipelines were created.

**@⁠Luigilt20** on GitHub · 2026-11-26 04:40 UTC · [original](https://github.com/fxceless/victory-fork/pull/702#issuecomment-7182803294) · edited 2026-11-26 04:53 UTC I also tested this change in the Neptune tree at LooperSalty/AnyXboxX@c4c93bd. The `structure.rs` change applies cleanly. I built the original and patched translation tools and ran the same compute programs through both on Windows 11 using the Windows SDK DXIL validator (dxil.dll 1.9.2602.17). | Selected programs | Original, emitted and validated | Patched, emitted and validated | | --- | ---: | ---: | | Two transmission-volumetrics compute variants | 0/2 | 2/2 | | Vertex control | 1/1 | 1/1 | | Five shadow compute variants with a separate descriptor diagnostic | 0/5 | 0/5 | Both focused Rust tests for paired DWORD mask provenance also passed on the isolated Neptune test build. This is an offline compiler result. GPU pipeline creation, water appearance and frame rate were outside this measurement. AI-assisted testing and reporting with Codex. Full-pack follow-up on the same Neptune build and validator, six CPU threads. Of 26,084 programs, 25,687 → 25,689 emitted and 25,616 → 25,618 validated. The two water compute variants were the only gains. Across the 25,889 individually listed programs, none lost either emission or validation. Another 195 export-stage programs had no individual result in either run. No GPU pipelines were created.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

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

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-702'
git switch 'github-bot/gh-702'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-702'
git switch 'github-bot/gh-702'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-702'
git switch 'main'
git merge --squash 'github-bot/gh-702'
git switch 'main'
git merge --ff-only 'github-bot/gh-702'
git switch 'main'
git merge 'github-bot/gh-702'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.