Skip to content

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

Open
s3rius wants to merge 3 commits into
brcly:mainfrom
s3rius:shaderx/wave32-masked-dpp
Open

s3rius wants to merge 3 commits into
brcly:mainfrom
s3rius:shaderx/wave32-masked-dpp

Conversation

@s3rius

@s3rius s3rius commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

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
s3rius marked this pull request as draft November 25, 2026 17:40
@brcly

brcly commented Nov 25, 2026

Copy link
Copy Markdown
Owner

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

@s3rius
s3rius marked this pull request as ready for review November 25, 2026 19:32
@s3rius
s3rius force-pushed the shaderx/wave32-masked-dpp branch from 663e87d to b6a1d4c Compare November 25, 2026 19:58
@s3rius

s3rius commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor Author

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

@tsunderejay

Copy link
Copy Markdown

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.

@s3rius s3rius changed the title Lower wave32 masked DPP prefixes and totals in wave allocation shader-compiler: Lower wave32 masked DPP prefixes and totals in wave allocation Nov 25, 2026
@s3rius
s3rius marked this pull request as draft November 25, 2026 23:27
@s3rius
s3rius marked this pull request as ready for review November 26, 2026 00:00
@s3rius
s3rius marked this pull request as draft November 26, 2026 00:00
@s3rius
s3rius marked this pull request as ready for review November 26, 2026 00:22
@s3rius
s3rius force-pushed the shaderx/wave32-masked-dpp branch from 5c0f31d to b488e50 Compare November 26, 2026 00:23
@s3rius

s3rius commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

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

@s3rius
s3rius force-pushed the shaderx/wave32-masked-dpp branch from b488e50 to eeb5ee0 Compare November 26, 2026 00:25
@s3rius

s3rius commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

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

@brcly

brcly commented Nov 26, 2026

Copy link
Copy Markdown
Owner

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!

@s3rius

s3rius commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

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

@s3rius
s3rius force-pushed the shaderx/wave32-masked-dpp branch from eeb5ee0 to 38842d2 Compare November 26, 2026 01:45
@s3rius

s3rius commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Rebased on top of main with applying changes.

Signed-off-by: Pavel Kirilin <s3riussan@gmail.com>
Signed-off-by: Pavel Kirilin <s3riussan@gmail.com>
@s3rius
s3rius force-pushed the shaderx/wave32-masked-dpp branch from 38842d2 to 679e2fe Compare November 26, 2026 03:07
@s3rius

s3rius commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor Author

Rebased once again + ran GPU tests.

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.

3 participants