xshader: fix wave reductions, FP32 rounding and bounded table indexing #166

Manually merged
github merged 15 commits from gh-pr/166/head into gh-pr/166/base 2026-11-26 06:35:39 +00:00
Owner

@⁠smith-3 on GitHub · 2026-11-25 12:00 UTC · original
smith-3:codex/shader-integration-20261125 → main · +636 −77 · 13 files · 15 commits · merged 2026-11-25 14:21 UTC

Summary

Refs #16. This PR handles three shader translation cases.

  • Translate verified single-wave reductions on wave32 hardware, including DPP exchanges and masked integer and floating-point reductions.
  • Honor FP32 rounding and denormal modes during byte packing, integer-to-float conversion and exponent scaling.
  • Translate bounded scalar table indices formed by OR, XOR, bit-field extraction or conditional selection. Check alignment and bounds for every possible index.

The final commit fixes a case found when testing these changes together. A 64-lane reduction followed by table-selected exponent scaling compiled to DXIL but requested a 64-lane hardware wave. On the RTX 4080 SUPER, pipeline creation failed. The translated shader now executes using the verified group-shared path.

Verified on Lanes

RTX 4080 SUPER (10de:2702), NVIDIA 570.211.01, Linux, Proton Experimental. Tested PR head 54db032 merged locally with upstream a79aedb (test tree aee8591).

python tuxbox.py check passed all code checks, builds, and 10 Lanes GPU checks. The initial run was interrupted by a Wine assertion in steam.exe while loading the native Steam client. For the passing run, umu-run used PROTON_VERB=runinprefix and app-local D3D12, D3D12Core, and DXGI DLLs from the same Proton installation.

Lanes replay: passed (16/16 courses, 16/16 wins)
Lanes GPU scenarios: 6/6 passed
Shader cache: prepared, compiled, and reused checks passed

Lanes covers runtime and cache behavior. The synthetic shader corpus above exercises the exact translator cases changed by this PR.

Download the Lanes GPU receipt

Checks

A clean build of 54db032 on Linux passed all five contribution checks locally. On an RTX 4080 SUPER, 140 synthetic shaders ran in 392 dispatches. All 24,416 result words matched the CPU reference, and the runner checked all 150,528 words in the readback buffers, including inputs and guards.

The archive includes the shader inputs, expected outputs and replay instructions. Download the replay package · GPU receipt

AI-assisted contribution from smith-3. All test inputs are synthetic.

**@⁠smith-3** on GitHub · 2026-11-25 12:00 UTC · [original](https://github.com/brcly/TuxBox/pull/166) `smith-3:codex/shader-integration-20261125` → `main` · +636 −77 · 13 files · 15 commits · merged 2026-11-25 14:21 UTC ## Summary Refs #16. This PR handles three shader translation cases. - Translate verified single-wave reductions on wave32 hardware, including DPP exchanges and masked integer and floating-point reductions. - Honor FP32 rounding and denormal modes during byte packing, integer-to-float conversion and exponent scaling. - Translate bounded scalar table indices formed by OR, XOR, bit-field extraction or conditional selection. Check alignment and bounds for every possible index. The final commit fixes a case found when testing these changes together. A 64-lane reduction followed by table-selected exponent scaling compiled to DXIL but requested a 64-lane hardware wave. On the RTX 4080 SUPER, pipeline creation failed. The translated shader now executes using the verified group-shared path. ## Verified on Lanes RTX 4080 SUPER (10de:2702), NVIDIA 570.211.01, Linux, Proton Experimental. Tested PR head `54db032` merged locally with upstream `a79aedb` (test tree `aee8591`). `python tuxbox.py check` passed all code checks, builds, and 10 Lanes GPU checks. The initial run was interrupted by a Wine assertion in `steam.exe` while loading the native Steam client. For the passing run, `umu-run` used `PROTON_VERB=runinprefix` and app-local D3D12, D3D12Core, and DXGI DLLs from the same Proton installation. ```text Lanes replay: passed (16/16 courses, 16/16 wins) Lanes GPU scenarios: 6/6 passed Shader cache: prepared, compiled, and reused checks passed ``` Lanes covers runtime and cache behavior. The synthetic shader corpus above exercises the exact translator cases changed by this PR. [Download the Lanes GPU receipt](https://github.com/smith-3/TuxBox/releases/download/shader-replay-54db032/lanes-rtx-4080-super-pr166-umu.json) ## Checks A clean build of `54db032` on Linux passed all five contribution checks locally. On an RTX 4080 SUPER, 140 synthetic shaders ran in 392 dispatches. All 24,416 result words matched the CPU reference, and the runner checked all 150,528 words in the readback buffers, including inputs and guards. The archive includes the shader inputs, expected outputs and replay instructions. [Download the replay package](https://github.com/smith-3/TuxBox/releases/download/shader-replay-54db032/tuxbox-shader-replay-54db032.tar.gz) · [GPU receipt](https://github.com/smith-3/TuxBox/releases/download/shader-replay-54db032/rtx-4080-super.json) AI-assisted contribution from smith-3. All test inputs are synthetic.
(cherry picked from commit 91a9f4d6b5043d234b50f2aa7c0bddbb39a6285c)
(cherry picked from commit fb5b3cd0527fafd7ad7899a68a86ee10d65b48dd)
(cherry picked from commit 0e778922fdc28d95d2996648054fda20729cd313)
(cherry picked from commit de34051769149c77fe5fb3074c757f8aa1a7fff1)
(cherry picked from commit 747bc8233a05ecaabb7aa15aaf7b1b06e9ed4c23)
(cherry picked from commit 8ea26a9803031193c0533425e209a1c912874767)
(cherry picked from commit b96b411812f17d98342d878a260919e8671c0be9)
(cherry picked from commit c18ecdc56f91499d7b7827e2b35d420104ae8be7)
(cherry picked from commit f08df7e272b149acabaa743298dd2791f6e4486b)
(cherry picked from commit 23cfc00ebd49d64eb82bdea61424674bc29961dc)
(cherry picked from commit dc09f8e4525487b84c7ae41bf3eb2b2cca8f8b01)
(cherry picked from commit 11bfb1cf0838bb8fa58bc255b48c767c35842f32)
(cherry picked from commit 1b8143a283473ecc3fdb08483de45bc8786ad218)
(cherry picked from commit ef4d589592612a473678580a932ec3215e6d35f0)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 06:35:37 +00:00
github manually merged commit 54db032ee8 into gh-pr/166/base 2026-11-26 06:35:39 +00:00
Author
Owner

@⁠copilot-pull-request-reviewer[bot] on GitHub · 2026-11-25 12:01 UTC · original · reviewed

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

**@⁠copilot-pull-request-reviewer[bot]** on GitHub · 2026-11-25 12:01 UTC · [original](https://github.com/brcly/TuxBox/pull/166#pullrequestreview-6057218696) · **reviewed** Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
This discussion has been locked. Commenting is limited to contributors.
No description provided.