Repository navigation
shader-compiler: accept uniform branches around wave reductions - #144
Merged
Merged
Conversation
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
force-pushed
the
xshader/wave_divergent
branch
from
November 25, 2026 10:02
b4ee7b8 to
8000866
Compare
Contributor
Author
|
Rebased on top of main. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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