shader-compiler: Lower wave32 masked DPP prefixes and totals in wave allocation #181

Open
github-bot wants to merge 3 commits from github-bot/gh-181 into main AGit
Owner

@⁠s3rius on GitHub · 2026-11-25 17:36 UTC · original
s3rius:shaderx/wave32-masked-dpp → main · +715 −67 · 8 files · 3 commits · open

Summary

Lower wave32 masked DPP prefixes and totals in wave allocation. prepare now handles prefixes (always) and pixel totals (always); compute totals are left for wave_sum. Added lower_problematic_totals/total_to_wave_active_sum in wave_alloc.rs and, in the lockstep-failure branch of pipeline.rs, lowers the totals that wave_sum rejects on divergent control flow to WaveActiveSum before re-validating. Extracted check_region from wave_sum.rs so wave_alloc reuses the exact per-region control-flow check. Full suite: 303 lib + 2 integration pass; 30/32 target shaders compile (the 2 remaining fail on a pre-existing, unrelated constant-lane gather limitation).

Verified on Lanes

A pull request is not merged until Lanes passes on a GPU. Run:

python tuxbox.py check
  • python tuxbox.py check passed on this branch
  • Changed or new behaviour is covered by a Lanes scenario, or the reason it cannot be is stated below

GPU, driver and backend:

Paste the summary printed at the end:

Summary
  passed   Build the shader compiler (8s)
  passed   Python tests (3s)
  passed   Shader compiler tests (4s)
  passed   DXBC tests (0s)
  passed   XG layout tests (1s)
  passed   D3D12 Windows typecheck (0s)
  passed   Build (27s)
  passed   Lanes and fixtures on the GPU (256s)
  passed   D3D12 regression controls (111s)
  passed   Shader translator on the GPU (255s)

All checks passed. Attach the GPU results to the pull request

Checks

CI runs the Python unit tests, the shader compiler, DXBC, and XG layout tests, and a Windows typecheck of tuxbox-d3d12.

If this pull request changes evidence JSON, regenerate the results table and the progress map and include both files:

python tuxbox.py status > docs/RESULTS.md
python tuxbox.py status --svg docs/progress.svg
**@⁠s3rius** on GitHub · 2026-11-25 17:36 UTC · [original](https://github.com/brcly/TuxBox/pull/181) `s3rius:shaderx/wave32-masked-dpp` → `main` · +715 −67 · 8 files · 3 commits · open ## Summary Lower wave32 masked DPP prefixes and totals in wave allocation. prepare now handles prefixes (always) and pixel totals (always); compute totals are left for wave_sum. Added lower_problematic_totals/total_to_wave_active_sum in wave_alloc.rs and, in the lockstep-failure branch of pipeline.rs, lowers the totals that wave_sum rejects on divergent control flow to WaveActiveSum before re-validating. Extracted check_region from wave_sum.rs so wave_alloc reuses the exact per-region control-flow check. Full suite: 303 lib + 2 integration pass; 30/32 target shaders compile (the 2 remaining fail on a pre-existing, unrelated constant-lane gather limitation). ## Verified on Lanes A pull request is not merged until Lanes passes on a GPU. Run: ```sh python tuxbox.py check ``` - [x] `python tuxbox.py check` passed on this branch - [x] Changed or new behaviour is covered by a Lanes scenario, or the reason it cannot be is stated below GPU, driver and backend: Paste the summary printed at the end: ```text Summary passed Build the shader compiler (8s) passed Python tests (3s) passed Shader compiler tests (4s) passed DXBC tests (0s) passed XG layout tests (1s) passed D3D12 Windows typecheck (0s) passed Build (27s) passed Lanes and fixtures on the GPU (256s) passed D3D12 regression controls (111s) passed Shader translator on the GPU (255s) All checks passed. Attach the GPU results to the pull request ``` ## Checks CI runs the Python unit tests, the shader compiler, DXBC, and XG layout tests, and a Windows typecheck of `tuxbox-d3d12`. If this pull request changes evidence JSON, regenerate the results table and the progress map and include both files: ```sh python tuxbox.py status > docs/RESULTS.md python tuxbox.py status --svg docs/progress.svg ```
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 06:36:47 +00:00
Author
Owner

@⁠brcly on GitHub · 2026-11-25 18:53 UTC · original

im gonna hold on this for now, as locally, this caused compilation failures for myself. i will look into it

**@⁠brcly** on GitHub · 2026-11-25 18:53 UTC · [original](https://github.com/brcly/TuxBox/pull/181#issuecomment-7171538040) im gonna hold on this for now, as locally, this caused compilation failures for myself. i will look into it
Author
Owner

@⁠s3rius on GitHub · 2026-11-25 20:03 UTC · original · edited 2026-11-25 20:38 UTC

@⁠brcly , okay, did some updates tho. Can you try it once again? It also was failing on my machine before. Now it passes.

**@⁠s3rius** on GitHub · 2026-11-25 20:03 UTC · [original](https://github.com/brcly/TuxBox/pull/181#issuecomment-7173132424) · edited 2026-11-25 20:38 UTC @⁠brcly , okay, did some updates tho. Can you try it once again? It also was failing on my machine before. Now it passes.
Author
Owner

@⁠tsunderejay on GitHub · 2026-11-25 21:04 UTC · original

Automated review against current main found a blocking correctness issue: the new wave32/fallback paths no-op DPP bodies without retaining the previous liveness proof for scratch registers. A later read of a nopped temporary can therefore receive stale/undefined data, and this also regresses the older wave64 pixel lowering. Please restore/adapt the dead-register proof and add a negative test. The current smoke test also does not write/verify the prefix result, so it cannot detect a numerical miscompile.

**@⁠tsunderejay** on GitHub · 2026-11-25 21:04 UTC · [original](https://github.com/brcly/TuxBox/pull/181#issuecomment-7174568555) Automated review against current main found a blocking correctness issue: the new wave32/fallback paths no-op DPP bodies without retaining the previous liveness proof for scratch registers. A later read of a nopped temporary can therefore receive stale/undefined data, and this also regresses the older wave64 pixel lowering. Please restore/adapt the dead-register proof and add a negative test. The current smoke test also does not write/verify the prefix result, so it cannot detect a numerical miscompile.
Author
Owner

@⁠s3rius on GitHub · 2026-11-26 00:23 UTC · original

@⁠tsunderejay, can you re-verify this PR with the latest changes?

**@⁠s3rius** on GitHub · 2026-11-26 00:23 UTC · [original](https://github.com/brcly/TuxBox/pull/181#issuecomment-7178702065) @⁠tsunderejay, can you re-verify this PR with the latest changes?
Author
Owner

@⁠s3rius on GitHub · 2026-11-26 00:26 UTC · original

Okay, nevermind. I rebased on main and it has more errors now.

**@⁠s3rius** on GitHub · 2026-11-26 00:26 UTC · [original](https://github.com/brcly/TuxBox/pull/181#issuecomment-7178752615) Okay, nevermind. I rebased on main and it has more errors now.
Author
Owner

@⁠brcly on GitHub · 2026-11-26 00:33 UTC · original

Gonna hold off on this just now as I'm working on a fix for differentiating AMD and Nvidia GPU's

Main will be updated when it's implemented.

I will eventually move to branches and such; it's just in this part of development. I'm trying to get something that's as close to "working" as possible before going after certain individual improvements.

I didn't expect this repo to blow up as quickly as it did and for so many people to help drive it to a usable state.

I thank you for your efforts so far, we'll get there!

**@⁠brcly** on GitHub · 2026-11-26 00:33 UTC · [original](https://github.com/brcly/TuxBox/pull/181#issuecomment-7178871802) Gonna hold off on this just now as I'm working on a fix for differentiating AMD and Nvidia GPU's Main will be updated when it's implemented. I will eventually move to branches and such; it's just in this part of development. I'm trying to get something that's as close to "working" as possible before going after certain individual improvements. I didn't expect this repo to blow up as quickly as it did and for so many people to help drive it to a usable state. I thank you for your efforts so far, we'll get there!
Author
Owner

@⁠s3rius on GitHub · 2026-11-26 00:39 UTC · original

Okay. NP. Do you have any direction which I can look that that will not interfere with your upcoming changes?

**@⁠s3rius** on GitHub · 2026-11-26 00:39 UTC · [original](https://github.com/brcly/TuxBox/pull/181#issuecomment-7178978273) Okay. NP. Do you have any direction which I can look that that will not interfere with your upcoming changes?
Author
Owner

@⁠s3rius on GitHub · 2026-11-26 01:45 UTC · original

Rebased on top of main with applying changes.

**@⁠s3rius** on GitHub · 2026-11-26 01:45 UTC · [original](https://github.com/brcly/TuxBox/pull/181#issuecomment-7180104389) Rebased on top of main with applying changes.
Author
Owner

@⁠s3rius on GitHub · 2026-11-26 03:07 UTC · original

Rebased once again + ran GPU tests.

**@⁠s3rius** on GitHub · 2026-11-26 03:07 UTC · [original](https://github.com/brcly/TuxBox/pull/181#issuecomment-7181418927) Rebased once again + ran GPU tests.
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/181/head:github-bot/gh-181'
git switch 'github-bot/gh-181'

Merge

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