Shader: preserve scalar loop exits in native wave32 compute #647
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Belobug--VIctory-Belobug-AMD!647
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-647"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ANDREANIADS on GitHub · 2026-11-27 16:23 UTC · original
ANDREANIADS:fix-native-wave32-scalar-loops→a-publier· +407 −1 · 4 files · 1 commits · draftRelated to #352; complements the split-wave64 work in #366.
Native wave32 compute currently lets lanes leave a divergent loop before its scalar result has reached the final wave-wide value. On an RTX 3070 the synthetic 64-thread probe returned 1..64 instead of 32 for the first wave and 64 for the second.
This routes a conservative subset of native wave32 loops through the existing structured wide emitter: 1D compute, no LDS, spills or waterfalls, properly nested EXEC backedges, and scalar results used after the latch. Unsupported control flow, mask-as-data and cross-lane operations are rejected by the detector. The emitted wave width stays 32 even when the host allows 64. Translator cache version increases from 2 to 3.
Validation on Windows / NVIDIA RTX 3070 / driver 621.40 / Rust 1.98.1:
Credit: the conservative loop detector is adapted from fladit123's #366; the synthetic scalar-loop fixture builds on adrianmjim's 471e11b. This does not claim to fix all of #352. No gameplay or performance claims.
AI-assisted with Codex.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.