xshader: avoid redundant reads in paired Wave64 local exchanges #234

Closed
Valdi320 wants to merge 1 commit from upstream-pr/234 into main
Valdi320 commented 2026-11-26 14:46:17 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by Valdi320 on 2026-11-26T14:46:17Z.


Change

DPP8, DPP16 row/quad controls, permlane16 and DS swizzle never select across a 32-lane half in paired Wave64. Read that half's VGPR directly and test the corresponding EXEC word. Out-of-row shift reads are wrapped within the row and discarded by the existing validity/write masks. Cross-half lane reads are unchanged.

Measurements

Identical synthetic dependent exchange programs, 3 runs with production DXC flags, median:

Exchanges HLSL bytes DXIL bytes DXC seconds
128 168306 → 135314 20932 → 14500 0.156 → 0.120
512 638802 → 506834 73540 → 47812 0.876 → 0.666

Half as many emitted WaveReadLaneAt calls for these exchange operations. These are synthetic compiler results, not a retail gameplay or driver-speed claim.

Validation

RTX 4080, NVIDIA 620.73.04, Linux, GE-Proton11-14:

  • 25 paired-Wave64 GPU programs, 1,638,400 words, zero mismatches; rebuilt provider. Includes added dependent chains and four-wave cases.
  • 335 shader-compiler tests; new structural test fails before the patch (8 vs 4 reads) and passes after.
  • All six code-check groups passed.
  • 8 Lanes gates: replay, benchmark, shader prepared/compiled/reused, narrow/host Wave64, raster tables.
  • Updated host profile record: only paired path changes, including wave32-host when it selects paired lowering. Any-host output unchanged.

Draft pending full check on this exact branch and AMD hardware validation. No title bytes or logs included.

<!-- greyfinch-sync:brcly/TuxBox:issue:5512124995 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/234). Originally posted by [Valdi320](https://github.com/Valdi320) on 2026-11-26T14:46:17Z. --- ## Change DPP8, DPP16 row/quad controls, permlane16 and DS swizzle never select across a 32-lane half in paired Wave64. Read that half's VGPR directly and test the corresponding EXEC word. Out-of-row shift reads are wrapped within the row and discarded by the existing validity/write masks. Cross-half lane reads are unchanged. ## Measurements Identical synthetic dependent exchange programs, 3 runs with production DXC flags, median: | Exchanges | HLSL bytes | DXIL bytes | DXC seconds | | --- | --- | --- | --- | | 128 | 168306 → 135314 | 20932 → 14500 | 0.156 → 0.120 | | 512 | 638802 → 506834 | 73540 → 47812 | 0.876 → 0.666 | Half as many emitted WaveReadLaneAt calls for these exchange operations. These are synthetic compiler results, not a retail gameplay or driver-speed claim. ## Validation RTX 4080, NVIDIA 620.73.04, Linux, GE-Proton11-14: - 25 paired-Wave64 GPU programs, 1,638,400 words, zero mismatches; rebuilt provider. Includes added dependent chains and four-wave cases. - 335 shader-compiler tests; new structural test fails before the patch (8 vs 4 reads) and passes after. - All six code-check groups passed. - 8 Lanes gates: replay, benchmark, shader prepared/compiled/reused, narrow/host Wave64, raster tables. - Updated host profile record: only paired path changes, including wave32-host when it selects paired lowering. Any-host output unchanged. Draft pending full check on this exact branch and AMD hardware validation. No title bytes or logs included.
gtb-sbe commented 2026-11-26 16:09:45 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by gtb-sbe on 2026-11-26T16:09:45Z.


AMD run of the translator GPU stage on 5942f6b (this PR's head, tested as is on its base f3149ab).

Host: RX 9060 XT (1002:7590, RDNA4, runs wave64 natively), Mesa 26.2.6 RADV, GE-Proton11-14, Windows DXC 2026-09-29.

  • python tuxbox.py check --no-gpu: all code checks pass.
  • tools/check_translator_gpu.py --adapter 1002:7590 --only paired-wave64: PASS: 25 programs, 1638400 words, adapter 1002:7590 (includes the new exchange_chain and the five new _x4 variants).
  • Full translator stage: 30/30 cases pass. That is every case this branch's harness has. The 8 cases that main added after f3149ab (dpp8-exchange-*, dpp8-multiwave-*, lds-bounds, wave-guard-64-*) were not run.
  • For comparison, main 4d3dd26 on the same host: full stage 38/38, paired-wave64 PASS: 19 programs, 1245184 words.

One note on the setup: this branch predates #222, and with its name filter DXVK skipped both Vulkan devices here. The host names the card AMD Radeon RX 9060 XT (RADV GFX1200), while the guest sees AMD Radeon RX 9060 XT (radv 26.2.6). As a result, every program failed with "no readback". For the runs above I applied only #222's harness change (ca399e4, tools/check_translator_gpu.py) locally. The translator code is unchanged. All guest logs show Skipping: UUID filter for llvmpipe only, so they ran on the RADV card.

Not run: Lanes and the rest of the GPU gate, NVIDIA.

<!-- greyfinch-sync:brcly/TuxBox:comment:7197265342 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/234#issuecomment-7197265342). Originally posted by [gtb-sbe](https://github.com/gtb-sbe) on 2026-11-26T16:09:45Z. --- AMD run of the translator GPU stage on `5942f6b` (this PR's head, tested as is on its base `f3149ab`). Host: RX 9060 XT (`1002:7590`, RDNA4, runs wave64 natively), Mesa 26.2.6 RADV, GE-Proton11-14, Windows DXC 2026-09-29. - `python tuxbox.py check --no-gpu`: all code checks pass. - `tools/check_translator_gpu.py --adapter 1002:7590 --only paired-wave64`: `PASS: 25 programs, 1638400 words, adapter 1002:7590` (includes the new `exchange_chain` and the five new `_x4` variants). - Full translator stage: 30/30 cases pass. That is every case this branch's harness has. The 8 cases that `main` added after `f3149ab` (`dpp8-exchange-*`, `dpp8-multiwave-*`, `lds-bounds`, `wave-guard-64-*`) were not run. - For comparison, `main` `4d3dd26` on the same host: full stage 38/38, `paired-wave64` `PASS: 19 programs, 1245184 words`. One note on the setup: this branch predates #222, and with its name filter DXVK skipped both Vulkan devices here. The host names the card `AMD Radeon RX 9060 XT (RADV GFX1200)`, while the guest sees `AMD Radeon RX 9060 XT (radv 26.2.6)`. As a result, every program failed with "no readback". For the runs above I applied only #222's harness change (`ca399e4`, `tools/check_translator_gpu.py`) locally. The translator code is unchanged. All guest logs show `Skipping: UUID filter` for llvmpipe only, so they ran on the RADV card. Not run: Lanes and the rest of the GPU gate, NVIDIA.
Valdi320 commented 2026-11-26 23:21:14 +00:00 (Migrated from github.com)

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


Deferred: maintainer measured no meaningful DXC improvement on the recorded corpus. Preserve the experiment and AMD evidence. Closing this draft to make the review queue manageable, per the maintainer's request. The branch and history remain intact at 5942f6b; no branch deleted.

<!-- greyfinch-sync:brcly/TuxBox:comment:7205469781 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/234#issuecomment-7205469781). Originally posted by [Valdi320](https://github.com/Valdi320) on 2026-11-26T23:21:14Z. --- Deferred: maintainer measured no meaningful DXC improvement on the recorded corpus. Preserve the experiment and AMD evidence. Closing this draft to make the review queue manageable, per the maintainer's request. The branch and history remain intact at `5942f6b`; 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!234
No description provided.