Skip to content

xshader: emit simple paired Wave64 ALU assignments directly - #242

Draft
Valdi320 wants to merge 1 commit into
brcly:mainfrom
Valdi320:work/paired-wave64-direct-alu-20261126
Draft

Valdi320 wants to merge 1 commit into
brcly:mainfrom
Valdi320:work/paired-wave64-direct-alu-20261126

Conversation

@Valdi320

Copy link
Copy Markdown
Contributor

Change

Lower a restricted subset of integer vector ALU instructions directly into paired VGPR assignments instead of duplicating shadow registers and copying them back. Require a single predicated destination assignment, no mask writes, and a closed operand/expression whitelist. All other forms keep the generic path. Both DPP source reads still precede either lane write, and row/bank gating is preserved. Native/any-host records are unchanged.

Measurements

Synthetic 512-exchange compute program; same base 3b8a220, production DXC flags and five alternating runs per version:

  • HLSL: 638802 -> 486364 bytes (-23.9%).
  • DXC median: 1.197 -> 0.994 s (-17.0%).
  • Peak RSS median: 81228 -> 65508 KiB (-19.4%).
  • All ten DXIL binaries have identical SHA-256, 73540 bytes. These measurements do not establish retail FPS or startup savings.
  • This is independent of xshader: avoid redundant reads in paired Wave64 local exchanges #234; combined benefits not measured.

Validation

  • Structural regression before/after, negative expression cases, host-profile records (paired route only), all six no-GPU check groups passed.
  • Real GPU CPU-oracle comparison: 22 programs, 1441792 words, zero mismatches; dependent integer chain under sparse EXEC, DPP8/DPP16, single and multiwave groups.
  • 8/8 Lanes gates on RTX 4080 / GE-Proton11-14, using unchanged same-base provider and fixtures (source equality checked), current translator.
  • No retail data included.

Draft pending full GPU suite on exact branch and AMD validation; actual retail performance not measured.

@brcly

brcly commented Nov 26, 2026

Copy link
Copy Markdown
Owner

Thanks for these. I measured #234, #242 and #243 on real recorded ProjectScarlett .wave32 requests, to see how the synthetic gains carry over. This comment covers all three.

Setup: 83 requests translated with --wave32-host; main (4d3dd26) and every PR build compile the same 74 and refuse the same 9. DXC 1.9.2609, -O1 -disable-lifetime-markers, 4 jobs on a Ryzen 7 9800X3D, build order rotated, median of 3 runs, with a second copy of main as a noise control. For the builds with #234 I kept main's copy of the conflicting test files. #243 conflicts with #242 in paired_wave64.rs, so I didn't combine those.

DXC CPU time, excluding the largest shader (it took either about 19 s or about 26 s whichever build compiled it):

build DXC change HLSL size, all 74 DXIL size, all 74
main 80.0 s
main again 79.9 s -0.2%
#234 80.0 s 0.0% -0.2% -0.2%
#242 77.4 s -3.2% -10.6% +0.0%
#243 79.7 s -0.4% -0.6% -0.0%
#234 + #242 77.3 s -3.4% -10.8% -0.2%

So on these shaders the gains are much smaller than on the synthetic programs, and I wouldn't expect a noticeable startup change. #242 still looks like a reasonable cleanup. For startup time, it would help to base the next optimisations on stage timings from real shaders (#238 looks useful for that), with driver time included.

Not checked: output correctness of the changed shaders, AMD, or any game run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants