Shaders: experimental paired Wave64 compute lowering for NVIDIA #1397

Closed
ByFxbian wants to merge 1 commit from upstream-pr/1397 into main
ByFxbian commented 2026-11-26 23:03:30 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by ByFxbian on 2026-11-26T23:03:30Z.


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.

<!-- greyfinch-sync:fxceless/victory-fork:issue:5518323606 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1397). Originally posted by [ByFxbian](https://github.com/ByFxbian) on 2026-11-26T23:03:30Z. --- ## 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.
Filip722 commented 2026-11-26 23:17:22 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Filip722 on 2026-11-26T23:17:22Z.


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).

<!-- greyfinch-sync:fxceless/victory-fork:comment:7205415933 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1397#issuecomment-7205415933). Originally posted by [Filip722](https://github.com/Filip722) on 2026-11-26T23:17:22Z. --- 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).
fxceless commented 2026-11-27 00:06:36 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by fxceless on 2026-11-27T00:06:36Z.


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

<!-- greyfinch-sync:fxceless/victory-fork:comment:7206178101 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1397#issuecomment-7206178101). Originally posted by [fxceless](https://github.com/fxceless) on 2026-11-27T00:06:36Z. --- Merged by hand in b1d777a8 (conflicts with other changes resolved there). Thank you.

Pull request closed

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
fxceless/victory-fork!1397
No description provided.