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

Closed
Valdi320 wants to merge 1 commit from upstream-pr/245 into main
Valdi320 commented 2026-11-26 15:58:48 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by Valdi320 on 2026-11-26T15:58:48Z.


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.

<!-- greyfinch-sync:brcly/TuxBox:issue:5513241800 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/245). Originally posted by [Valdi320](https://github.com/Valdi320) on 2026-11-26T15:58:48Z. --- ## 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 commented 2026-11-26 16:07:23 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by Valdi320 on 2026-11-26T16:07:23Z.


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

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.

<!-- greyfinch-sync:brcly/TuxBox:comment:7197211249 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/245#issuecomment-7197211249). Originally posted by [Valdi320](https://github.com/Valdi320) on 2026-11-26T16:07:23Z. --- 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.
Valdi320 commented 2026-11-26 23:21:05 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by Valdi320 on 2026-11-26T23:21:05Z.


Deferred alongside #234/#242/#243: overlapping Wave64 optimization experiment, no demonstrated retail speedup for this variant. Revisit only with a measured remaining compile bottleneck. Closing this draft to make the review queue manageable, per the maintainer's request. The branch and history remain intact at b3d97e3; no branch deleted.

<!-- greyfinch-sync:brcly/TuxBox:comment:7205467512 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/245#issuecomment-7205467512). Originally posted by [Valdi320](https://github.com/Valdi320) on 2026-11-26T23:21:05Z. --- Deferred alongside #234/#242/#243: overlapping Wave64 optimization experiment, no demonstrated retail speedup for this variant. Revisit only with a measured remaining compile bottleneck. Closing this draft to make the review queue manageable, per the maintainer's request. The branch and history remain intact at `b3d97e3`; no branch deleted.

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
brcly/TuxBox!245
No description provided.