Repository navigation
shader: accept the mesh group exchange without the EXEC save - #3444
Merged
Merged
Conversation
The native mesh frontend matched the group-id exchange only when it starts with s_mov_b64 exec, 1 followed by s_mov_b64 s[saved], exec. The same sequence also appears without that save (60 bytes instead of 64, every other word identical), and was refused as an unsupported s_mov_b64. The matcher now accepts both forms: without the save it writes no saved pair, takes the temporary from the first word after the opener and keeps every other guard. A later EXEC restore from a pair that was never saved is still refused. Tests: the no-save form is accepted with the same group-id result; the no-save form followed by s_mov_b64 exec, s[22:23] is refused with the restore error.
Flip one bit of the AND mask or of the first fixed tail word inside the no-save exchange window; the matcher must not accept either, and the opener is then refused as an unsupported EXEC state.
This was referenced Nov 29, 2026
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.
Part of #3416
Branch
shader-mesh-exchange-nosave, head 08cf44c, based on main 1a0120b. Two commits:Files:
src/gfx1013_direct_mesh.inl,tests/native_direct_mesh_check.py.What changes
The native mesh frontend matched the group-id exchange only in its 64-byte form. That form is
s_mov_b64 exec, 1, thens_mov_b64 s[saved], exec, then the AND mask and 13 fixed tail words. The same sequence also appears without the save: 60 bytes, every other word identical. On main 1a0120b that form is refused withmesh group-index exchange shape or entry state is not covered(the refusal #3420 added).Matcher changes in
src/gfx1013_direct_mesh.inl:381-411(line numbers at the branch head):has_savefrom the second word (:383) and reads the mask at +8 or +4 (:384, :388). It checks the same tail after the mask (:389-391) and advances byexchange_size, 64 or 60 bytes (:387, :411).!branch,!exec_skip,full_exec, wave64,group_stride.s_mov_b64 exec, s[x:y]from a pair that was never saved is still refused.Evidence
On this head (base 1a0120b): configure, build
compile_dxil, thenResult:
native_direct_meshPassed.Tests:
group-no-saveis accepted and containsdx.op.groupId.i32.group-no-save-restoreis refused withmesh EXEC restore lacks a still-valid reaching mask.group-no-save-near-maskandgroup-no-save-near-taileach flip one bit in the 60-byte window, in the AND mask or in the first tail word. Both expectmesh group-index exchange shape or entry state is not covered. That text has one source,src/gfx1013_direct_mesh.inl:1133, reached when thes_mov_b64 exec, 1opener is not matched.Mutation on this head, reverted afterwards:
bool exchange = has_save && ...(:389)group-no-savefails:native compute +0x0: mesh group-index exchange shape or entry state is not coveredMutations on the previous revision (640d4b6 on main 212d4b5, same matcher change), not repeated on this head:
truegroup-no-save-near-mask: compiledk=1group-no-save-near-tail: compiledNot covered
dx.op.groupId.i32substring does not prove the exchange produced the value that is read. What the test does show: an unmatched opener is refused, so a successful compile means the window was consumed.s_mov_b64 exec, -1right after the window. No case has other instructions between the window and that restore.CI
On main 1a0120b the
prtest preset filter inCMakePresets.jsondoes not matchnative_direct_mesh, and theprbuild preset does not listcompile_dxil.Build and test on Windowsdoes not exercise this change.Interactions with our other open mesh branches
This branch touches the same two files as #3439 (f74eacc) and the same test file as #3438 (0feac9c). By
git merge-tree --write-treeat these heads:shader-mesh-exec-widen(958d341): cleanshader-mesh-udiv-ops(0f84c3a): cleanThe combinations were not built.