Shaders: experimental paired Wave64 compute lowering for NVIDIA #1397

Closed
github-bot wants to merge 1 commit from gh-pr/1397/head into gh-pr/1397/base
Owner

@⁠ByFxbian on GitHub · 2026-11-26 23:03 UTC · original
ByFxbian:perf/wave64-water → main · +2427 −713 · 9 files · 1 commits · closed without merging

Summary

Experimental paired Wave64 compute lowering for 32-lane host GPUs.
Each physical thread executes two logical console lanes.

Based on the paired execution approach from #854, with control-flow
improvements related to #993 and darkworldhm's work.

Disabled by default.

Targeted testing

The paired backend can be enabled for individual shader hashes:

VICTORY_WAVE_PAIRS=0
VICTORY_WAVE_PAIRS_ONLY=5dc3b25986622949,6f225b641c5b0708
VICTORY_WAVE_WHY=1
VICTORY_GROUP_SYNC=2

These are the two water transmission volumetrics compute shaders
described in the translation diagnostics from commit 9613092b.

Changes

  • Paired execution of logical Wave64 compute lanes.
  • Divergent control flow and masked wave operations.
  • Cross-half and cross-wave LDS exchange.
  • LDS read2/write2 and unsigned min/max atomics.
  • Resource tracking after control-flow restructuring.
  • Per-shader selection and cache-key separation.
  • Panic-safe restoration of paired translation state.
  • GDS rejection and shared-memory limit checks.
  • Conservative rejection of unsupported synchronization patterns.

Hardware validation

NVIDIA GeForce RTX 3070 (8 GB), Windows, driver 610.88.
AMD Ryzen 5 5600X, 32 GB RAM.

  • 11 paired hardware fixtures passed.
  • 7 exact fallback hardware fixtures passed.
  • Scoped selector hardware fixture passed.
  • All selector regression checks passed.
  • DXIL validation passed.
  • Zero D3D12 debug or GPU-based validation errors or warnings.
Test suite Passed Failed Ignored
victory-shader 238 0 16
victory-gpu 224 1 6

The GPU test failure is a Windows event-log permission failure,
also reproduced on clean upstream.

Workspace cargo check, staged asset policy and git diff --check pass.

Nsight Graphics profiling

Synthetic compute workload on the RTX 3070:

Metric Baseline Paired
Registers per thread 24 24
Shader warp occupancy 80.3% 37.4%
Threadgroup barrier samples 48.69% 0.27%
Execution dependency samples 15.21% 30.19%

Paired execution substantially reduces threadgroup barrier stalls
in this workload but introduces additional execution costs.

No unconditional performance improvement is claimed.

Limitations

The original water programs have not been executed with this backend.
Gameplay performance and visual correctness remain unverified.

Testing the two selected programs, including pipeline creation and
water rendering, would be particularly useful.

**@⁠ByFxbian** on GitHub · 2026-11-26 23:03 UTC · [original](https://github.com/fxceless/victory-fork/pull/1397) `ByFxbian:perf/wave64-water` → `main` · +2427 −713 · 9 files · 1 commits · closed without merging ## Summary Experimental paired Wave64 compute lowering for 32-lane host GPUs. Each physical thread executes two logical console lanes. Based on the paired execution approach from #854, with control-flow improvements related to #993 and darkworldhm's work. Disabled by default. ## Targeted testing The paired backend can be enabled for individual shader hashes: ```ini VICTORY_WAVE_PAIRS=0 VICTORY_WAVE_PAIRS_ONLY=5dc3b25986622949,6f225b641c5b0708 VICTORY_WAVE_WHY=1 VICTORY_GROUP_SYNC=2 ``` These are the two water transmission volumetrics compute shaders described in the translation diagnostics from commit 9613092b. ## Changes - Paired execution of logical Wave64 compute lanes. - Divergent control flow and masked wave operations. - Cross-half and cross-wave LDS exchange. - LDS read2/write2 and unsigned min/max atomics. - Resource tracking after control-flow restructuring. - Per-shader selection and cache-key separation. - Panic-safe restoration of paired translation state. - GDS rejection and shared-memory limit checks. - Conservative rejection of unsupported synchronization patterns. ## Hardware validation NVIDIA GeForce RTX 3070 (8 GB), Windows, driver 610.88. AMD Ryzen 5 5600X, 32 GB RAM. - 11 paired hardware fixtures passed. - 7 exact fallback hardware fixtures passed. - Scoped selector hardware fixture passed. - All selector regression checks passed. - DXIL validation passed. - Zero D3D12 debug or GPU-based validation errors or warnings. | Test suite | Passed | Failed | Ignored | | --- | ---: | ---: | ---: | | victory-shader | 238 | 0 | 16 | | victory-gpu | 224 | 1 | 6 | The GPU test failure is a Windows event-log permission failure, also reproduced on clean upstream. Workspace cargo check, staged asset policy and git diff --check pass. ## Nsight Graphics profiling Synthetic compute workload on the RTX 3070: | Metric | Baseline | Paired | | --- | ---: | ---: | | Registers per thread | 24 | 24 | | Shader warp occupancy | 80.3% | 37.4% | | Threadgroup barrier samples | 48.69% | 0.27% | | Execution dependency samples | 15.21% | 30.19% | Paired execution substantially reduces threadgroup barrier stalls in this workload but introduces additional execution costs. No unconditional performance improvement is claimed. ## Limitations The original water programs have not been executed with this backend. Gameplay performance and visual correctness remain unverified. Testing the two selected programs, including pipeline creation and water rendering, would be particularly useful.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 01:03:20 +00:00
github-bot closed this pull request 2026-11-27 01:03:20 +00:00
Author
Owner

@⁠Filip722 on GitHub · 2026-11-26 23:17 UTC · original · edited 2026-11-26 23:19 UTC

I tested the two scoped hashes with this PR on current main a42b627 and the DXIL latch fix from #257. The hash scope and unwind regressions passed. The actual NVIDIA Wave32 selector fixture and both water-related LDS fixtures passed on an RTX 5060 Laptop under GE-Proton11-14 and vkd3d-proton 3.2.0.

The Series S replay selected both 5dc3b25986622949 and 6f225b641c5b0708. Each hit the paired backend's unsupported floating-point reduction because an exact paired tree is unavailable. The fallback translated each to its original Wave64 requirement, and both D3D12 compute pipeline creations then returned 0x80070057. That isolates a real blocker beyond the LDS synthetic tests for these two programs.

With the same application, initial caches and hardware, the existing scoped Wave32 workaround created both original compute pipelines on this laptop. Native creation took about 0.70 and 1.19 seconds. The comparison used only these two hashes. Water image verification remains open.

Assisted by Codex (GPT-6.2-Sol High).

**@⁠Filip722** on GitHub · 2026-11-26 23:17 UTC · [original](https://github.com/fxceless/victory-fork/pull/1397#issuecomment-7205415933) · edited 2026-11-26 23:19 UTC I tested the two scoped hashes with this PR on current main a42b627 and the DXIL latch fix from #257. The hash scope and unwind regressions passed. The actual NVIDIA Wave32 selector fixture and both water-related LDS fixtures passed on an RTX 5060 Laptop under GE-Proton11-14 and vkd3d-proton 3.2.0. The Series S replay selected both 5dc3b25986622949 and 6f225b641c5b0708. Each hit the paired backend's unsupported floating-point reduction because an exact paired tree is unavailable. The fallback translated each to its original Wave64 requirement, and both D3D12 compute pipeline creations then returned 0x80070057. That isolates a real blocker beyond the LDS synthetic tests for these two programs. With the same application, initial caches and hardware, the existing scoped Wave32 workaround created both original compute pipelines on this laptop. Native creation took about 0.70 and 1.19 seconds. The comparison used only these two hashes. Water image verification remains open. Assisted by Codex (GPT-6.2-Sol High).
Author
Owner

@⁠fxceless on GitHub · 2026-11-27 00:06 UTC · original

Merged by hand in b1d777a8 (conflicts with other changes resolved there). Thank you.

**@⁠fxceless** on GitHub · 2026-11-27 00:06 UTC · [original](https://github.com/fxceless/victory-fork/pull/1397#issuecomment-7206178101) Merged by hand in b1d777a8 (conflicts with other changes resolved there). Thank you.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.