Skip to content

xshader: trim paired Wave64 arithmetic register and mask shadows - #245

Draft
Valdi320 wants to merge 1 commit into
brcly:mainfrom
Valdi320:work/paired-wave64-general-shadow-reduction-20261126
Draft

Valdi320 wants to merge 1 commit into
brcly:mainfrom
Valdi320:work/paired-wave64-general-shadow-reduction-20261126

Conversation

@Valdi320

Copy link
Copy Markdown
Contributor

Changes

Three reductions to the generic paired Wave64 arithmetic path: rename VGPR references directly to disjoint lane storage for VOP encodings (memory encodings keep the old copy path); omit unused mask locals; omit snapshots of write-only masks. EXEC reconstruction remains unchanged. DPP sources are captured before either lane writes. The existing instruction-body validation and rejection of unsupported wave intrinsics remain in place. Native host records unchanged.

Measurements

Synthetic chains on base 4d3dd26, five alternating DXC runs per version:

Case HLSL bytes DXC median Peak RSS KiB
192 carry-in instructions 295312 -> 253646 0.383 -> 0.321 s 45720 -> 42060
128 multiply-add64 instructions 210704 -> 174306 0.455 -> 0.418 s 43516 -> 41484
All ten DXIL binaries per case byte-identical to their respective baseline. Synthetic numbers, not retail performance.

Validation

23 paired Wave64 GPU programs / 1,507,328 words, zero mismatches; new CPU-oracle tests for aliased carry destinations and 64-bit multiply-add chains in single and multiwave groups. All six no-GPU groups and eight Lanes GPU gates pass on RTX 4080 / GE-Proton11-14 using unchanged runtime and fixtures (source equality checked). Current translator built from this branch.

This general approach overlaps the goal of the more targeted #242 but is independent of it and retains the generic mask logic. Can be reviewed as an alternative/follow-up; combined gains are not additive. #234 and #243 address separate optimizations. Draft pending full GPU suite, AMD, and actual title profiling. No retail data included.

@Valdi320

Copy link
Copy Markdown
Contributor Author

Combined-validation follow-up (not a new upstream PR): https://github.com/Valdi320/TuxBox/tree/1afe7dd059e2b0b404297b6d51251b41374987fe

Integrated #234, #242, #243 and #245 on base 4d3dd26, keeping all individual tests and adding a mixed dependency chain. Source overlaps reconciled explicitly, native-host records unchanged. All 35 GPU programs / 2,293,760 words pass, including combined single- and multiwave cases. All six no-GPU groups and eight Lanes GPU gates pass. Same runtime/provider source as the previously rebuilt fixture.

Five alternating DXC runs per version of a long mixed synthetic program (same base): HLSL 804044 -> 474878 bytes (-40.9%); median DXC 1.491 -> 0.953 s (-36.1%); peak RSS median 114692 -> 70412 KiB (-38.6%); DXIL 62780 -> 54448 bytes (-13.3%). DXIL hashes differ, so ran the exact long program on both versions, each matching 65536 oracle words. No retail data or FPS claims.

This is a test branch in the fork, not a request to merge every optimization indiscriminately. Full GPU suite and AMD/title validation remain outstanding.

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.

1 participant