Skip to content

shader-compiler: accept uniform branches around wave reductions - #144

Merged
brcly merged 1 commit into
brcly:mainfrom
s3rius:xshader/wave_divergent
Nov 25, 2026
Merged

brcly merged 1 commit into
brcly:mainfrom
s3rius:xshader/wave_divergent

Conversation

@s3rius

@s3rius s3rius commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The wave_divergent guard rejected any branch crossing a wave-reduction region, but only VCC branches (op 6/7) are actually divergent — SCC, EXEC, and unconditional branches have scalar conditions identical in every lane, so they can never run the reduction on a partial lane set. This change classifies branches by uniformity in tools/shader-compiler/src/hlsl/wave_sum.rs: reject divergent branches, accept uniform branches that merge at or skip past the region, and accept loop back-edges whose body up to the region is free of divergent branches and in-region landings.

Verified over all 31,629 ProjectScarlett requests: wave_divergent refusals drop 1508 → 618, 242 shaders newly compile, 0 regressions, full test suite green (184 lib + 2 integration).

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

@brcly

brcly commented Nov 25, 2026

Copy link
Copy Markdown
Owner

Hey there, could you please fix any conflicts, would like to clear through the PRs 😃

Signed-off-by: Pavel Kirilin <s3riussan@gmail.com>
@s3rius
s3rius force-pushed the xshader/wave_divergent branch from b4ee7b8 to 8000866 Compare November 25, 2026 10:02
@s3rius

s3rius commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

Rebased on top of main.

@brcly
brcly merged commit 5678a2f into brcly:main Nov 25, 2026
2 checks passed
@s3rius
s3rius deleted the xshader/wave_divergent branch November 25, 2026 10:08
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