shader: make exact wave reductions and DPP8 exchanges portable across workgroup shapes #204

Open
github-bot wants to merge 2 commits from github-bot/gh-204 into main AGit
Owner

@⁠Valdi320 on GitHub · 2026-11-25 23:07 UTC · original
Valdi320:work/scarlett-wave-budget-20261125 → main · +32624 −43 · 14 files · 2 commits · draft

Summary

Fixes part of #151: portable wave64 reductions and DPP8 exchanges now use the x-fast flattened local ID for multidimensional compute groups. This avoids aliasing shared slots when y or z is nonzero. The existing convergent single-wave proof is unchanged. The independently proven, straight-line DPP8 path additionally supports complete 32-thread blocks up to 1024 invocations using a correctly sized shared array. No branches, EXEC changes, LDS or unknown operands are admitted. Constant readlane remains restricted to a 32-thread group. General divergent/multi-wave reductions and the lone-lane complexity limit are unchanged.

Validation

RTX 4080 (10de:2704), driver 615.78.08, GE-Proton11-12 / vkd3d-proton. DXC/DXV validated the synthetic translated programs; no retail data or gameplay claim.

  • First commit: 70 cases each for guarded wave64 reductions at 64x1x1, 8x8x1 and 4x4x4; 192 DPP8 cases each in 2D and 3D. 594 cases / 228,096 compared words, all matched.
  • Second commit: 192 cases each for groups of 128, 256 and 1024 threads across linear, 2D and 3D layouts (576 total), plus 192 small-group regression cases. 768 cases / 614,400 compared words, all matched.
  • Total: 1,362 GPU cases / 842,496 words including guards, zero mismatches.
  • Final official code gate (tuxbox.py check --no-gpu): PASS. 318 shader compiler, 64 DXBC and 14 XG layout tests passed (396 Rust total); Python 351 collected, 343 passed, 8 skipped; D3D12 Windows typecheck passed. git diff --check clean.
  • Added the multidimensional and multi-wave controls to check_translator_gpu.py. These fixtures exercise the translator's actual RDNA2 opcodes and raw UAV stores rather than a separate Lanes scenario.

Full receipts are under evidence/. The initial isolated tests used the existing D3D12 provider; the multi-wave controls used the newly built provider from the upstream base. No provider changes are included.

Draft / not merge-ready: The general tuxbox.py check built the providers and passed the Rust/D3D12 code checks, but the guest phase failed even the CPU route controls and initial D3D12/ XG controls under this host's launcher configuration; the run was stopped. An isolated CPU route reproduction using Host.run with UMU_RUNTIME_UPDATE=0 also timed out after 45 seconds, before producing a receipt; the underlying cause is not yet identified. GE-Proton11-14 was not installed, so targeted controls used 11-12. Direct execution of the same CPU route using GE-Proton Wine in a disposable offline Bubblewrap prefix produced the expected receipt. All 14 Lanes self-test scenarios passed via that independent direct-Wine path on 10de:2704: descriptor-reclaim, dispatch-wait, direct-copy-wait, thread-dimensions, indirect-dispatch, gpu-indirect-dispatch, labels, cross-queue, compute-frame, skipped-command, copy-memory, shared-texture, texture-readback, and ray-tracing-builder. This localizes the observed CPU timeout to the UMU launch path or its environment, but does not substitute for a passing complete official Lanes/GPU gate. The patch does not establish a new retail shader count or successful game rendering.

AI-assisted contribution, with actual GPU readback evidence.

**@⁠Valdi320** on GitHub · 2026-11-25 23:07 UTC · [original](https://github.com/brcly/TuxBox/pull/204) `Valdi320:work/scarlett-wave-budget-20261125` → `main` · +32624 −43 · 14 files · 2 commits · draft ## Summary Fixes part of #151: portable wave64 reductions and DPP8 exchanges now use the x-fast flattened local ID for multidimensional compute groups. This avoids aliasing shared slots when y or z is nonzero. The existing convergent single-wave proof is unchanged. The independently proven, straight-line DPP8 path additionally supports complete 32-thread blocks up to 1024 invocations using a correctly sized shared array. No branches, EXEC changes, LDS or unknown operands are admitted. Constant readlane remains restricted to a 32-thread group. General divergent/multi-wave reductions and the lone-lane complexity limit are unchanged. ## Validation RTX 4080 (10de:2704), driver 615.78.08, GE-Proton11-12 / vkd3d-proton. DXC/DXV validated the synthetic translated programs; no retail data or gameplay claim. - First commit: 70 cases each for guarded wave64 reductions at 64x1x1, 8x8x1 and 4x4x4; 192 DPP8 cases each in 2D and 3D. 594 cases / 228,096 compared words, all matched. - Second commit: 192 cases each for groups of 128, 256 and 1024 threads across linear, 2D and 3D layouts (576 total), plus 192 small-group regression cases. 768 cases / 614,400 compared words, all matched. - Total: 1,362 GPU cases / 842,496 words including guards, zero mismatches. - Final official code gate (tuxbox.py check --no-gpu): PASS. 318 shader compiler, 64 DXBC and 14 XG layout tests passed (396 Rust total); Python 351 collected, 343 passed, 8 skipped; D3D12 Windows typecheck passed. git diff --check clean. - Added the multidimensional and multi-wave controls to check_translator_gpu.py. These fixtures exercise the translator's actual RDNA2 opcodes and raw UAV stores rather than a separate Lanes scenario. Full receipts are under evidence/. The initial isolated tests used the existing D3D12 provider; the multi-wave controls used the newly built provider from the upstream base. No provider changes are included. **Draft / not merge-ready:** The general tuxbox.py check built the providers and passed the Rust/D3D12 code checks, but the guest phase failed even the CPU route controls and initial D3D12/ XG controls under this host's launcher configuration; the run was stopped. An isolated CPU route reproduction using Host.run with UMU_RUNTIME_UPDATE=0 also timed out after 45 seconds, before producing a receipt; the underlying cause is not yet identified. GE-Proton11-14 was not installed, so targeted controls used 11-12. Direct execution of the same CPU route using GE-Proton Wine in a disposable offline Bubblewrap prefix produced the expected receipt. All 14 Lanes self-test scenarios passed via that independent direct-Wine path on 10de:2704: descriptor-reclaim, dispatch-wait, direct-copy-wait, thread-dimensions, indirect-dispatch, gpu-indirect-dispatch, labels, cross-queue, compute-frame, skipped-command, copy-memory, shared-texture, texture-readback, and ray-tracing-builder. This localizes the observed CPU timeout to the UMU launch path or its environment, but does not substitute for a passing complete official Lanes/GPU gate. The patch does not establish a new retail shader count or successful game rendering. AI-assisted contribution, with actual GPU readback evidence.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 06:38:12 +00:00
Author
Owner

@⁠lunavibeofficial on GitHub · 2026-11-26 02:06 UTC · original

I ran an independent CPU verification on Ubuntu 26.04.1 x86-64 with Rust 1.95.0. The base bd847b5 passed 313 unit tests and 2 integration tests. PR head bd722d0 passed 316 unit tests and 2 integration tests, including all three new regression tests. Both runs used the same dependency lockfile in an offline sandbox.

I also passed the same synthetic guarded-reduction fixture through both translators and compiled the emitted HLSL with Microsoft's Linux DXC 1.9.2609.5. For 8×8×1 and 4×4×4, the base emitted [WaveSize(64)] and required cs_6_6. The PR's portable variants compiled as cs_6_0 and passed DXV, including the instrumented value and state outputs. 64×1×1 was portable in both revisions. 8×8×2 retained the Wave64 requirement in both.

The offline matrix matched expectations in all 20 invocations, with 16 DXV-verified outputs and 4 expected WaveSize rejections under cs_6_0. GPU readback and the Lanes replay are pending.

Is anyone already reproducing the UMU CPU-route timeout on Ubuntu with the pinned GE-Proton 11-14? If an independent run would help, I can compare the same fixture through UMU and direct Wine with identical settings and report the results.

**@⁠lunavibeofficial** on GitHub · 2026-11-26 02:06 UTC · [original](https://github.com/brcly/TuxBox/pull/204#issuecomment-7180468619) I ran an independent CPU verification on Ubuntu 26.04.1 x86-64 with Rust 1.95.0. The base `bd847b5` passed 313 unit tests and 2 integration tests. PR head `bd722d0` passed 316 unit tests and 2 integration tests, including all three new regression tests. Both runs used the same dependency lockfile in an offline sandbox. I also passed the same synthetic guarded-reduction fixture through both translators and compiled the emitted HLSL with Microsoft's Linux DXC 1.9.2609.5. For `8×8×1` and `4×4×4`, the base emitted `[WaveSize(64)]` and required `cs_6_6`. The PR's portable variants compiled as `cs_6_0` and passed DXV, including the instrumented value and state outputs. `64×1×1` was portable in both revisions. `8×8×2` retained the Wave64 requirement in both. The offline matrix matched expectations in all 20 invocations, with 16 DXV-verified outputs and 4 expected WaveSize rejections under `cs_6_0`. GPU readback and the Lanes replay are pending. Is anyone already reproducing the UMU CPU-route timeout on Ubuntu with the pinned GE-Proton 11-14? If an independent run would help, I can compare the same fixture through UMU and direct Wine with identical settings and report the results.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/204/head:github-bot/gh-204'
git switch 'github-bot/gh-204'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-204'
git switch 'github-bot/gh-204'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-204'
git switch 'github-bot/gh-204'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-204'
git switch 'main'
git merge --squash 'github-bot/gh-204'
git switch 'main'
git merge --ff-only 'github-bot/gh-204'
git switch 'main'
git merge 'github-bot/gh-204'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.