Add opt-in paired compute lowering for Wave64 shaders #882

Closed
Kamiloj9 wants to merge 2 commits from upstream-pr/883 into main
Kamiloj9 commented 2026-11-25 11:43:28 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Kamiloj9 on 2026-11-25T11:43:28Z.


Summary

Extract the compute paired-lane idea from #854 for a single full console Wave64 on a Wave32 host. Run two logical lanes per host lane, combine their masks and preserve prefix order across the two halves. The retry requires VICTORY_WAVE_PAIRS=1 and an emitted WaveSize of 32.

The second commit supports selected LDS instructions. It adds a group synchronization after both logical halves complete each guest LDS instruction and checks convergence in the optimized DXIL control flow. It also checks distinct ordinary stores and bounds for shared-memory accesses. The LDS form requires group synchronization, so it is skipped with VICTORY_GROUP_SYNC=0. Guest barriers, direct transfers into LDS and scalar memory writes remain outside this form.

Verification

  • Windows workspace check with all features, shader wave and convergence unit tests, and staged asset policy.
  • CPU replay on the current main base: the paired outputs of three previously tested captures match the forced #854 results. The additional LDS capture validates as a 32-thread group with 16 group synchronizations. Its DXIL matches the local integration build byte for byte.
  • All nine default results match the base. With the new opt-in LDS support, only the LDS capture changes relative to the preceding commit in the same nine-input replay.
  • Execution and rendered output still need hardware verification. No D3D12 PSOs were created in these checks.
<!-- greyfinch-sync:fxceless/victory-fork:issue:6603705064 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/883). Originally posted by [Kamiloj9](https://github.com/Kamiloj9) on 2026-11-25T11:43:28Z. --- ## Summary Extract the compute paired-lane idea from #854 for a single full console Wave64 on a Wave32 host. Run two logical lanes per host lane, combine their masks and preserve prefix order across the two halves. The retry requires `VICTORY_WAVE_PAIRS=1` and an emitted WaveSize of 32. The second commit supports selected LDS instructions. It adds a group synchronization after both logical halves complete each guest LDS instruction and checks convergence in the optimized DXIL control flow. It also checks distinct ordinary stores and bounds for shared-memory accesses. The LDS form requires group synchronization, so it is skipped with `VICTORY_GROUP_SYNC=0`. Guest barriers, direct transfers into LDS and scalar memory writes remain outside this form. ## Verification - Windows workspace check with all features, shader wave and convergence unit tests, and staged asset policy. - CPU replay on the current main base: the paired outputs of three previously tested captures match the forced #854 results. The additional LDS capture validates as a 32-thread group with 16 group synchronizations. Its DXIL matches the local integration build byte for byte. - All nine default results match the base. With the new opt-in LDS support, only the LDS capture changes relative to the preceding commit in the same nine-input replay. - Execution and rendered output still need hardware verification. No D3D12 PSOs were created in these checks.
m335671 commented 2026-11-25 18:05:14 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by m335671 on 2026-11-25T17:53:12Z.


A first hardware check, since the description asks for one: an offline pipeline census on a 32-lane card. On the title's shader pack, VICTORY_WAVE_PAIRS=1 changes no pipeline here.

Tested

  • RTX 4070 12 GB (32-lane waves), driver 32.0.16.2124, Windows 11 Pro 26300, release build.
  • main 3973179, then main with this PR's head 683b077 merged in. The merge was clean.
  • VICTORY_HOST_MAX_WAVE=32 victory translate --list --pipelines over the title's whole shader pack, compared program by program by hash.
pipelines created refused
main 3973179 25,608 27
main + this PR 25,608 27
main + this PR, VICTORY_WAVE_PAIRS=1 25,608 27

The same programs are created and refused in all three, and every pipeline the driver creates without the switch, it still creates with it.

So on this pack the paired form either isn't chosen for any of the 27 refused compute programs, or isn't chosen at all. I didn't add logging to tell which. Most of the 27 use LDS with guest barriers, and the description says that case stays out of this form, so that may be all there is to it.

Not tested: in the title, since offline nothing changes; your captures; other GPUs.

AI use: Claude Code (Claude Opus 5.5) built and ran the check on my machine, compared the listings and wrote this comment.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7170136891 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/883#issuecomment-7170136891). Originally posted by [m335671](https://github.com/m335671) on 2026-11-25T17:53:12Z. --- A first hardware check, since the description asks for one: an offline pipeline census on a 32-lane card. On the title's shader pack, `VICTORY_WAVE_PAIRS=1` changes no pipeline here. **Tested** - RTX 4070 12 GB (32-lane waves), driver 32.0.16.2124, Windows 11 Pro 26300, release build. - `main` `3973179`, then `main` with this PR's head `683b077` merged in. The merge was clean. - `VICTORY_HOST_MAX_WAVE=32 victory translate --list --pipelines` over the title's whole shader pack, compared program by program by hash. | | pipelines created | refused | |---|---|---| | `main` `3973179` | 25,608 | 27 | | `main` + this PR | 25,608 | 27 | | `main` + this PR, `VICTORY_WAVE_PAIRS=1` | 25,608 | 27 | The same programs are created and refused in all three, and every pipeline the driver creates without the switch, it still creates with it. So on this pack the paired form either isn't chosen for any of the 27 refused compute programs, or isn't chosen at all. I didn't add logging to tell which. Most of the 27 use LDS with guest barriers, and the description says that case stays out of this form, so that may be all there is to it. **Not tested:** in the title, since offline nothing changes; your captures; other GPUs. AI use: Claude Code (Claude Opus 5.5) built and ran the check on my machine, compared the listings and wrote this comment.
MKmajster commented 2026-11-25 19:09:47 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by MKmajster on 2026-11-25T18:47:17Z.


Two notes from merging this with #258 and running on a 32-lane host (RTX 3070).

The conflict. #258 adds a second range to the section loop in Lower (instructions after the section's end, up to after). I kept that loop and used this PR's twin dispatch in all three places:

  • paired_inst for the instruction at i and at end;
  • paired_section_inst for both ranges (i+1..end and end+1..after).

The shader tests pass (222).

What stays refused. With VICTORY_HOST_MAX_WAVE=32 VICTORY_WAVE_PAIRS=1, 10 compute programs that the driver refuses at pipeline creation (E_INVALIDARG; the validator accepts them) are still emitted with WaveSize(64). Your retry declines them:

  • 8 with "an uncertified paired LDS convergence or address proof";
  • 2 with "a floating-point wave operation in paired lanes".

All 10 have groups of 64 with LDS shared inside the console wave, plus v_mbcnt / v_readlane / a mask read as data. The two floating-point ones might be the cheaper next step, at least where the operation is min/max, which is exact in pairs.

AI-assisted (Claude Code). No game data attached.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7171399618 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/883#issuecomment-7171399618). Originally posted by [MKmajster](https://github.com/MKmajster) on 2026-11-25T18:47:17Z. --- Two notes from merging this with #258 and running on a 32-lane host (RTX 3070). **The conflict.** #258 adds a second range to the section loop in `Lower` (instructions after the section's end, up to `after`). I kept that loop and used this PR's twin dispatch in all three places: - `paired_inst` for the instruction at `i` and at `end`; - `paired_section_inst` for both ranges (`i+1..end` and `end+1..after`). The shader tests pass (222). **What stays refused.** With `VICTORY_HOST_MAX_WAVE=32 VICTORY_WAVE_PAIRS=1`, 10 compute programs that the driver refuses at pipeline creation (E_INVALIDARG; the validator accepts them) are still emitted with `WaveSize(64)`. Your retry declines them: - 8 with "an uncertified paired LDS convergence or address proof"; - 2 with "a floating-point wave operation in paired lanes". All 10 have groups of 64 with LDS shared inside the console wave, plus `v_mbcnt` / `v_readlane` / a mask read as data. The two floating-point ones might be the cheaper next step, at least where the operation is min/max, which is exact in pairs. AI-assisted (Claude Code). No game data attached.
upstream-sync closed this pull request 2026-11-26 01:05:59 +00:00

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!882
No description provided.