Shaders: no unreachable phase-2 barrier in mesh programs (NVIDIA hang); hardware switch for the shader cases #10

Manually merged
github merged 2 commits from gh-pr/10/head into gh-pr/10/base 2026-11-27 03:13:33 +00:00
Owner

@⁠marquezinii on GitHub · 2026-11-24 19:32 UTC · original
marquezinii:shaders/nvidia-mesh-hang → main · +88 −8 · 3 files · 2 commits · merged 2026-11-24 19:49 UTC

Two commits, from running the shader cases on an RTX 5070 (#9):

Tests: FIVESTAR_TEST_ADAPTER=hardware. WarpDevice creates the device on the first hardware adapter instead of WARP when this is set. WARP stays the default, so CI is unchanged. This is what found the cases listed in #9.

Shaders: phase 2 of a mesh program has a barrier only when it can yield. BodyWriter.Phases emitted the barrier at the end of phase 2's loop for every two-phase mesh program. When no block phase 2 can run yields (it is entered only at resume points after a barrier), that barrier is unreachable. On the 5070, dxc's optimized form of such a program hangs the group with DEVICE_HUNG; dxc -Od, the DXIL backend, and the same HLSL without that barrier all draw the reference image. The bisection is in #9. PhaseTwoYields walks the flow graph from the yields' resume targets, and phase 2 gets the barrier only when it reaches a yield, so a program that does yield in phase 2 keeps it.

Checked:

  • WARP: dotnet build with no warnings, and dotnet test with 509 passed, 0 failed (the skipped tests need a dump or a full-wave GPU).
  • RTX 5070 with FIVESTAR_TEST_ADAPTER=hardware: ms_ngg_strips and the narrower-waves mesh test go from DEVICE_HUNG to passing. The shader project goes from 21 failures to 19; the other 19 are the open items in #9.
**@⁠marquezinii** on GitHub · 2026-11-24 19:32 UTC · [original](https://github.com/ThatRecompDev/five-star-recomp/pull/10) `marquezinii:shaders/nvidia-mesh-hang` → `main` · +88 −8 · 3 files · 2 commits · merged 2026-11-24 19:49 UTC Two commits, from running the shader cases on an RTX 5070 (#9): **Tests: `FIVESTAR_TEST_ADAPTER=hardware`.** `WarpDevice` creates the device on the first hardware adapter instead of WARP when this is set. WARP stays the default, so CI is unchanged. This is what found the cases listed in #9. **Shaders: phase 2 of a mesh program has a barrier only when it can yield.** `BodyWriter.Phases` emitted the barrier at the end of phase 2's loop for every two-phase mesh program. When no block phase 2 can run yields (it is entered only at resume points after a barrier), that barrier is unreachable. On the 5070, dxc's optimized form of such a program hangs the group with DEVICE_HUNG; dxc `-Od`, the DXIL backend, and the same HLSL without that barrier all draw the reference image. The bisection is in #9. `PhaseTwoYields` walks the flow graph from the yields' resume targets, and phase 2 gets the barrier only when it reaches a yield, so a program that does yield in phase 2 keeps it. Checked: - WARP: `dotnet build` with no warnings, and `dotnet test` with 509 passed, 0 failed (the skipped tests need a dump or a full-wave GPU). - RTX 5070 with `FIVESTAR_TEST_ADAPTER=hardware`: `ms_ngg_strips` and the narrower-waves mesh test go from DEVICE_HUNG to passing. The shader project goes from 21 failures to 19; the other 19 are the open items in #9.
The translator's cases always ran on WARP, whose 4-lane waves, unfused
arithmetic and forgiving compiler hide what a real driver does with the
same DXIL. Set to hardware, the cases run on the first hardware adapter;
WARP stays the default.
A two-phase mesh program ran phase 2 in a loop ending with a barrier, also
when no block phase 2 can run yields again, so that barrier never ran. On
an RTX 5070 (driver 621.40) dxc's optimized form of such a program hangs the
group (DXGI_ERROR_DEVICE_HUNG): ms_ngg_strips and ms_ngg_windows remove the
device there, while dxc -Od, the DXIL backend, and the same HLSL without the
unreachable barrier draw the reference image. Phase 2 now gets its barrier
only when a block reachable from the resume points yields.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 03:13:32 +00:00
github manually merged commit 5e91006fc7 into gh-pr/10/base 2026-11-27 03:13:33 +00:00
Author
Owner

@⁠ThatRecompDev on GitHub · 2026-11-24 19:49 UTC · original

Merged, thanks! Nice find on the unreachable barrier, and the hardware switch for the shader cases is really handy. We'll go through the rest of #9 on our 4090 too.

**@⁠ThatRecompDev** on GitHub · 2026-11-24 19:49 UTC · [original](https://github.com/ThatRecompDev/five-star-recomp/pull/10#issuecomment-7142649552) Merged, thanks! Nice find on the unreachable barrier, and the hardware switch for the shader cases is really handy. We'll go through the rest of #9 on our 4090 too.
This discussion has been locked. Commenting is limited to contributors.
No description provided.