Shaders: a mesh phase loop sits inside if (pc < PC_YIELD) (fixes the NVIDIA hang in #9) #71
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ThatRecompDev--five-star-recomp!71
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-71"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@upipibi on GitHub · 2026-11-28 10:28 UTC · original
upipibi:fix/mesh-phase-if-guard→main· +8 −2 · 2 files · 1 commits · merged 2026-11-28 12:18 UTCFixes #9: the mesh hang on NVIDIA (
ms_ngg_first_lane, and the barrier loop withsupersteps: false).What changed
StructuredBodyWriter.Phaseemitsif (pc < PC_YIELD) {before the phase's[loop] while (pc < PC_YIELD), and one more}after it. The class comment anddocs/shader-translation.mdnow say why.Why
dxc gives each phase one loop whose header (
pc < PC_YIELD) is reached by two back-edges every round, one from every switch case and one from the barrier tail, through one latch. NVIDIA hangs on that shape (DXGI_ERROR_DEVICE_HUNG, nvlddmkm 153). With the guard, the cases go forward to the round tail and the only back-edge left is the barrier one. Every case already ends at a yield or the end, so nothing the program does changes. Thewhilestays, because WARP's compiler needs it.The bisect behind this (DXIL shapes, controls, and which variants hang) is in #9. You confirmed it on a 4090 (comment).
It changes the HLSL of every two-phase mesh program (you counted 8,765 in the corpus), so testers will retranslate them.
How it was checked
RTX 3070, driver 616.56 (32.0.16.1656), Windows 11 Pro 10.0.26100, Release, on
main139a62c9. Each hardware line ran as its owndotnet testprocess withFIVESTAR_TEST_ADAPTER=hardware.mainCounts_read_from_the_first_lane_are_exchanged_so_the_program_runs_on_narrower_waves(both rows)0x887A0006)A_barrier_loop_draws_with_few_iterations_and_ends_at_the_round_bound_with_manysupersteps: falseremoves the device)The whole solution's tests on the default (WARP) adapter give the same counts on
mainand on this PR:The one Loader failure is the same on
main:D3D12XStandInPipelineTests.A_first_use_is_held_while_the_shader_table_is_nearly_full.Not checked: the WARP compiler crash that the class comment mentions, because the
whileis kept. Also not checked: AMD, Intel, and any real title or game file.AI-assisted: Claude Code (Claude Opus 5.5) did the bisect, wrote the change and ran the tests above.
@ThatRecompDev on GitHub · 2026-11-28 12:18 UTC · original
merged, thanks! ran it here on top of today's main first: full shader suite green (606 passed) and the two hang tests pass on the 4090, same as on your 3070.
one small thing: we keep commit messages on main free of AI trailers, so the squash dropped the Co-Authored-By line. your note in the PR description stays as it is, so the disclosure is still there for anyone who looks.
heads-up for everyone retranslating: this changes the translation of every two-phase mesh program, so the next run rebuilds those.