Skip to content

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

Draft
Valdi320 wants to merge 2 commits into
brcly:mainfrom
Valdi320:work/scarlett-wave-budget-20261125
Draft

Valdi320 wants to merge 2 commits into
brcly:mainfrom
Valdi320:work/scarlett-wave-budget-20261125

Conversation

@Valdi320

@Valdi320 Valdi320 commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

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.

@lunavibeofficial

Copy link
Copy Markdown

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.

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