Repository navigation
Preserve lane-dependent code-table indices across EXEC reconvergence - #5
Open
MichaelSmithAI wants to merge 3 commits into
Conversation
… address v5 = 0 in every lane, then 3 in lanes 10 and up (by s_cbranch_execz or by EXEC alone), EXEC restored, read back with v_readfirstlane as a code-table address: both values are uniform, the joined index is not. Traced today as every lane's address (offset 0xde0 with the lane's own index), which code_smem then reads per lane: lanes 10 and up read entry 3 where the console reads the first lane's entry 0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A guarded VALU write of a uniform value over a uniform one leaves the lanes it skips the old value; a phi at the join of a block skipped by EXEC (s_cbranch_execz) likewise, since lanes outside EXEC reach the join by the wave's edge. Both passed uniform(). A VALU value is uniform only when its block's entry condition and its guard hold in every lane or none; a phi only when its block and every predecessor are entered so. A SOP result that reads SCC (s_cselect, carries) also needs a uniform SCC. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
For Marvisak#1231. A shader sets a vector register to 0, writes 3 only in lanes 10 and above, restores EXEC, then broadcasts the first lane’s code-table address for an
s_load_dword. Lane 0 still selects entry 0. On8996aebthe resource tracker accepts the joined index as a per-lane dynamic term. We observed this both with a straight-line masked write and with ans_cbranch_execzaround the write.This change checks whether the write and the incoming paths to a phi execute for all lanes together before accepting the value as uniform. Scalar operations that read SCC implicitly also check that input. The regression covers both forms of the masked write. Each now gets the existing per-lane-address diagnostic, and the author's uniform-address and uniform-loop-counter controls still translate.
On Linux the shader suite passed 101 tests with one ignored, and library Clippy passed with warnings denied. All-target Linux Clippy reports the same two unused test imports on the base and this branch. The Windows/Wine shader run before final cleanup passed 124 tests with the existing
stub_pipeline_is_createdfailure and one ignored. The new test measures resource tracking. A numerical GPU readback of the code-table load and title behavior remain unmeasured.AI-assisted implementation, testing and review.