Add opt-in paired compute lowering for Wave64 shaders #882
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/883"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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=1and 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
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=1changes no pipeline here.Tested
main3973179, thenmainwith this PR's head683b077merged in. The merge was clean.VICTORY_HOST_MAX_WAVE=32 victory translate --list --pipelinesover the title's whole shader pack, compared program by program by hash.main3973179main+ this PRmain+ this PR,VICTORY_WAVE_PAIRS=1The 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.
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 toafter). I kept that loop and used this PR's twin dispatch in all three places:paired_instfor the instruction atiand atend;paired_section_instfor both ranges (i+1..endandend+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 withWaveSize(64). Your retry declines them: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.
Pull request closed