Skip to content

shader: name the mesh exchange shapes the frontend does not match - #3420

Open
Leyukaka wants to merge 2 commits into
R0Y00:mainfrom
Leyukaka:shader-mesh-exchange-names
Open

Leyukaka wants to merge 2 commits into
R0Y00:mainfrom
Leyukaka:shader-mesh-exchange-names

Conversation

@Leyukaka

@Leyukaka Leyukaka commented Nov 29, 2026 •

Copy link
Copy Markdown
Collaborator

Change

When an instruction reaches the mesh frontend's fallback in lower_mesh (no handler matched it), the refusal used to be unsupported mesh instruction or EXEC state: <op> in every case. It now names three cases before that generic refusal:

  • mesh group-index exchange shape or entry state is not covered: the instruction is s_mov_b64 exec, 1 (0xbefe0481), the first word of the group-index exchange, and the exchange matcher did not accept the sequence. That covers a different word sequence and also a failed precondition (branch, EXEC state, layout, register use).
  • mesh count exchange shape or entry state is not covered: the instruction is s_barrier (0xbf8a0000) and the next word compares an SGPR against 0 ((word & 0xffffff80) == 0xbf008000, the same test as the count matcher's second word). A barrier alone does not identify the count exchange.
  • mesh group memory outside a proven exchange: any other s_barrier, or any ds_* instruction other than ds_swizzle_b32, ds_permute_b32 and ds_bpermute_b32. The mesh frontend has no ds_* handler.

ds_swizzle_b32, ds_permute_b32 and ds_bpermute_b32 do not use group memory and keep the generic refusal. The new checks sit in the branch that already refused unconditionally, and refuse does not return, so the set of refused programs is unchanged and no accepted program changes. Only refused programs get a more precise reason.

Tests: wrong-count-slot and mismatched-barriers now expect the named reasons. New refused runs: standalone-barrier, standalone-ds-write (group memory), standalone-ds-swizzle (generic, ds_swizzle_b32, holds on main too), unsupported-sleep (generic, s_sleep, holds on main too) and missing-exec-save (group-index). No accepted run or its words changed.

Refs #2413, #3416.

Verification

The checks ran on the change applied to main 0614f68c, Windows 11, release build, before the rebase onto 51472392. git diff --stat 0614f68c 51472392 -- src/gfx1013_direct_mesh.inl tests/native_direct_mesh_check.py is empty (#3353 touches neither file).

  • cmake --build --preset release --target compile_dxil, then ctest --test-dir out\build\release --no-tests=error --output-on-failure -R "^(native_direct_mesh|native_compile_dxil_refusals)$": 2/2 pass.
  • Main's src/gfx1013_direct_mesh.inl with the earlier revision of the test (see below): native_direct_mesh fails at wrong-count-slot with native compute +0x18: unsupported mesh instruction or EXEC state: s_barrier. The three new strings do not occur in main's file, so every new or updated expectation except unsupported-sleep and standalone-ds-swizzle can only fail there.
  • Mutations, each rebuilt (one object recompiled) and run against native_direct_mesh:
Mutation Result
ds exclusion replaced by true fails, standalone-ds-swizzle: +0x0: mesh group memory outside a proven exchange
count reason reworded fails, wrong-count-slot
group-index reason reworded fails (+0x0: mesh group-index exchange shape is not covered)
barrier check without the next-word compare fails, standalone-barrier: +0x0: mesh count exchange shape is not covered
the two named reasons swapped fails, wrong-count-slot
s_barrier dropped from the group memory case fails, standalone-barrier: +0x0: unsupported mesh instruction or EXEC state: s_barrier
s_mov_b64 exec, 1 case disabled (false &&) fails, mismatched-barriers: +0x0: unsupported mesh instruction or EXEC state: s_mov_b64

The first three rows ran on the committed wording. The last four ran on an earlier revision of the same change, whose two named reasons ended in "shape is not covered" and whose group memory case included all ds_*.

  • After each sweep, the source file was restored byte-identical (sha256 matches the backup), the rebuild passed both tests again, and the diff hash was unchanged.

  • Follow-up commit 4fa38d63 adds standalone-ds-permute (0xdac80000) and standalone-ds-bpermute (0xdacc0000), both expecting the generic refusal. Checked on 75fe7c1d with these two cases in the working tree, before the commit was made (same content): both tests pass (2/2); removing ds_permute_b32 or ds_bpermute_b32 from the exclusion makes native_direct_mesh fail at the matching case with the group memory reason.

Evidence and follow-up

Not covered: The effect on the 543 captured slot 57 requests is not measured yet. That needs the entry layouts from the root-input PR (item b in #2413). Apart from the follow-up check above, nothing was re-run after the rebase onto 51472392.

Checklist

  • This pull request covers one reviewable behavior.
  • I included the exact command and result for every check I ran.
  • I considered a negative control or failure case for a new fixture.
  • I updated README/docs when a capability or build requirement changed. (no capability or build change)
  • No application files, dumps, distribution links or secrets included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant