Repository navigation
shader: pin the per-lane heap index at its waterfall mark - #3315
Open
SimSalabimse wants to merge 1 commit into
Open
SimSalabimse wants to merge 1 commit into
SimSalabimse wants to merge 1 commit into
Conversation
The waterfall load read the index SGPR at the s_load, so a write between the mark and the load selected record 0. Copy the index into a temporary at the mark, and refuse an expression that still names that SGPR. Closes R0Y00#3304 Co-authored-by: SimSalabimse <SimSalabimse@users.noreply.github.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.
Closes #3304.
The per-lane heap-record lowering in
gfx2hlsl.py(from #2861) read the index SGPR at thes_load, not at the waterfall mark. If that SGPR was written between the mark and the load, the load silently picked record 0 (rh[0]).What changed
tools/startup/gfx2hlsl.py: copy the index SGPR into a temporary when the mark is made, and have the load read that copy. An expression that still names the original SGPR after a write is refused instead of lowered.tests/startup_compute_waterfall_heap_check.py: mark-time pin cases, including a clobber between the mark and the load,v_lshrrevbounds, an unboundedv_movcopy, and a stale-capture refusal. Both mutants from the issue now fail the check.docs/experiments.md: one sentence on the temporary and the refusal.Tests
startup_compute_waterfall_heap_check.pyand the issue's repro.74b4ded9,ctest -j 1 -R "waterfall_heap|startup_gfx2hlsl_"(audio device tests excluded): 391/391 passed, twice. That includesstartup_compute_waterfall_heap_{oracle,dispatch}_{warp,hardware}.AI-assisted (Cursor)