Repository navigation
Description
The shader cases only ever run on WARP, so I ran them on an RTX 5070 (Blackwell, driver 621.40, wave32) against main. 21 of 284 fail there, and all of them pass on WARP. A small switch for this (FIVESTAR_TEST_ADAPTER=hardware) is in the PR I'm opening next to this issue, together with a fix for the first item below.
| Cases | What happens on the 5070 | State |
|---|---|---|
ms_ngg_strips, the narrower-waves mesh test (ms_ngg_windows) |
the group hangs: DXGI_ERROR_DEVICE_HUNG |
root cause below, fixed in the PR |
msfb_ngg_strips_rootdesc |
the fallback with root descriptors draws nothing. The DrawIndexed arguments and the vertex counter come out right; the table variant (msfb_ngg_strips) draws correctly on the same GPU |
open |
fma_mac, round_ldexp |
results 1 ulp off, e.g. 0xa8800000 where 0 is expected, and 0x3f800000 for 0x3f7fffff. This looks like the driver contracting a separate mul + add into an FMA |
open |
sin_large_arg |
about 4e-5 error against the 1e-5 tolerance | open |
whole_wave_reductions, dpp_row_shr, helper_exec_wqm, helper_exec_initial |
lane mismatches on 32-lane pixel waves | open: expectations that assume 4-lane waves, or real wave32 bugs |
readfirstlane_exec, mask_as_int_partial_exec |
the harness throws: "expected values assume WARP's 4-lane waves, this device runs 32" | harness only |
Each pixel case fails the same way with dxc and with the DXIL backend (9 cases, 18 tests).
The mesh hang. I bisected the translated HLSL of ms_ngg_strips on the 5070:
- dxc's default output hangs. The same HLSL compiled with
-Od, or with the DXIL backend, draws the reference image. - What makes it hang is the barrier at the end of the phase-2 loop. In these programs phase 2 never yields, so that barrier never runs, but with it present dxc's optimized DXIL hangs the group. Without it, the program draws the reference image.
- These changes did not help: a wave-uniform phase-1 exit (
WaveActiveAnyTrue,WaveReadLaneFirstong_ms_alloc), and dropping phase 2's dead entry region while keeping the barrier. - Swapping
WaveIsFirstLane()forWaveGetLaneIndex() == 0in the GS_ALLOC_REQ store also avoids the hang, while an unguarded store doesn't. So I read this as a driver issue that depends on the shape of dxc's output, not a logic error in the translation.
The PR emits phase 2's barrier only when a block phase 2 can run actually yields. With that, both mesh programs pass on the 5070, and WARP is unchanged.
I can't tell whether Ada (your 4090) behaves the same, or whether real two-phase mesh programs in the corpus have this exact shape. A run of the switch on the 4090 would answer the first. I'm happy to take the FMA/rounding cases or the root-descriptor fallback next, whichever is more useful to you.
Activity
ThatRecompDev commentedon Nov 24, 2026
Thanks for this, really useful. #10 is merged, so the mesh hang is gone. We'll run your hardware switch on our 4090 (Ada) and post the results here.
Splitting the rest so we don't both do the same thing: we're on the wave32 pixel cases (
whole_wave_reductions,dpp_row_shrand the helper/WQM ones), since those can affect the game directly. If you want one, the FMA/rounding pair would be great. On our side dxc's fast-math made some results differ from the reference until we compiled with-Gis, so that may be the whole story there, maybe pluspreciseon the translated mul/add. The root-descriptor fallback is welcome too, it's just lower priority for us since it only matters on GPUs without mesh shaders.Shader tests: pixel lane expectations follow the probed wave, not a 4…
marquezinii commentedon Nov 24, 2026
I'll take the FMA/rounding pair (
fma_mac,round_ldexp), starting from your-Gis/preciselead, and check each on the 5070.marquezinii commentedon Nov 25, 2026
A new NVIDIA finding from real boots on the RTX 5070 (12 GB), driver cache warm, main at
9e8772aplus #14. The story load hits a GPU hang (TDR:nvlddmkmevent 153, removal reason 0x887a0006) in 4 of 7 boots, between 60 s and 280 s, with either priority setting. One boot ran 400 s to the prologue.With
--d3d12-debug --d3d12-breadcrumbs, two of the hangs point at compute queues:Dispatch(1, 1, 1)sgd1_0be48fb7_t41_billboard_nobump~CS_ComputeImposterTransformDispatch(92, 52, 1)Bloom~CS_BloomDownsampleKaris(stalled 0.2 s later than compute #2)Dispatch(671, 1, 1)sgd1_0c37c883_t32_InstanceCulling~CS_Prop_BatchCullDRED reports no page fault (VA 0), so these are hangs, not faults.
Things I checked:
CS_ComputeImposterTransformcannot loop: the disassembly has only forward branches, and the translated HLSL has no loop at all. That dispatch must be stuck on memory, or behind other work on the GPU, not running away.CS_Prop_BatchCullhas 75 backward branches andbuffer_atomic_adds. With the compute cap of 65,536 iterations per invocation, a runaway in all 671×64 lanes could still do about 2.8·10^9 atomics, some of them on one address. That is long enough to pass the 2 s TDR on a 5070 while a 4090 may finish under it. This is a hypothesis; I haven't confirmed it.TRACE_GUARD) for BatchCull would confirm it either way.I can run either of those on this card; the full logs and DRED dumps are kept.
ThatRecompDev commentedon Nov 25, 2026
following up on the TDRs: we tracked one hang to a mesh shader (MSNC_VS_LinearDepthSkin), where 4 groups of an indirect dispatch never finish. it doesn't look like a missing loop cap. our current suspect is the loop guard itself, where threads in one group break out of a loop at different iterations and then never meet at a later barrier. we're testing that now; if it holds it would also explain your CS_Prop_BatchCull hangs
ThatRecompDev commentedon Nov 25, 2026
quick update on the hangs. it's not just LinearDepthSkin: every hang we've caught with breadcrumbs is a mesh shader on a DispatchMesh ExecuteIndirect. that's LinearDepthSkin, PropFoliageSkinDeferred, TransformSkinTransmission and, since we started mirroring the game's full descriptor tables, a terrain one (TransformTerrainNormalTint).
the loop-guard idea from my last comment didn't hold up. we went through 30 of those programs and every backward edge runs through the dispatch loop, so the caps do bound them. most of the skinned ones have no loop at all. the ones that do loop have a material-layer loop whose count comes from a constant buffer, and each pass costs two group rounds, so with real data it can plausibly run up to the TDR within the caps. we're timing that on our 4090 right now with single-dispatch repros.
on main, the full table mirror is opt-in for now (
--mirror-table-records full), so default boots behave like before.@marquezinii how's the FMA/rounding pair going? and if your 5070 hangs again,
--d3d12-breadcrumbson current main names the stopped list even when it's buried behind other submissions, so that would tell us whether yours are the same family.upipibi commentedon Nov 26, 2026
Ampere data point: the switch on an RTX 3070 (8 GB, driver 616.56, Windows 11) at main ff1c25c, synthetic cases only (no dumps).
WARP: 564 tests, 550 pass, 14 skip (real-program tests), 0 fail.
RTX 3070: 517 pass, 33 fail, 14 skip. I ran it once only: three cases hung the device (DXGI_ERROR_DEVICE_HUNG, nvlddmkm 153 each), so I stopped there.
Against the 5070 table:
A filtered rerun of these 30 in a fresh process, without the hang cases, failed all 30 the same way with no driver reset, so they do not depend on the hangs.
AI-assisted (Claude Code, Claude Opus 5.5): ran the cases and wrote this.
ThatRecompDev commentedon Nov 26, 2026
thanks, the 3070 run is really useful. the three hangs (ms_ngg_first_lane, its split variant, MeshRoundBound without supersteps) look like the same mesh-shader family we keep hitting, so those go on the list. the E_OUTOFMEMORY on pipeline creation for the buffer-bounds/root-descriptor cases is new to us, we'll try those on our side. the typed gather being off by one texel is worth a look too, those cases are new from #60 so we haven't seen them on other cards yet
upipibi commentedon Nov 26, 2026
Follow-up on the 3070 cases at
ff1c25c(the files involved are unchanged at8781848), from code and WARP only; the hanging cases were not rerun on the GPU.Integer gather off by a texel (cs_typed_uint/sint_gather): a test-harness issue. The gather samples the literal S#'s static sampler at heap slot 1403 (STATIC_SAMPLER_BASE + 379), but ComputeCase binds no sampler, so the test heap has 16 slots. WARP reads that as clamp, the 3070 as wrap: every mismatch is an edge lane whose x+1 or y+1 wrapped to 0. Binding PixelMemoryCases.LiteralSampler at that slot (a Samplers list on ComputeCase) fixes it.
ms_ngg_first_lane(_split): corrected 17:00Z - I then ran both on the 3070 with that patch applied at
ff1c25c, and both still hang (DXGI_ERROR_DEVICE_HUNG within seconds, nvlddmkm 153). So the PhaseTwoYields counting below is not the cause, or not the whole cause; I withdraw it and the patch offer. What I wrote before, for the record: ~~ms_ngg_first_lane(_split): the #10 hang again. PhaseTwoYields (BodyWriter.cs ~248) counts the exchange's yield, which comes before GS_ALLOC_REQ, as a phase-2 start. Phase 2 therefore gets the barrier loop even though it never yields, which is the shape the comment at BodyWriter.cs:40 says NVIDIA hangs on. With the exchange yields skipped unless reachable after the allocation, first_lane gets PhaseTwoEndWithoutYield like strips, and WARP is unchanged (550/0/14). I have a small patch if you want it.~~Narrowed 17:13Z (code + WARP only, no further 3070 runs): the hanging programs are the only two-phase mesh programs here whose round loop goes around a second time after its group barrier. first_lane's exchange yield before GS_ALLOC_REQ makes phase 1 two rounds (
WaveIsFirstLane()runs in round 2), and MeshRoundBound supersteps:False at count 3 runs phase 2 for four rounds (WaveActiveAnyTruein round 4). Every one-round two-phase program passes: strips, windows, payload, uniform_first_lane, the user-data mesh. Both first_lane tests also translate to byte-identical HLSL, so the split path is not it. Two hypotheses remain: (a) dxc merges the innerwhile (pc < PC_YIELD)into the round loop, and NVIDIA hangs when that merged loop goes around after the barrier; (b) a wave intrinsic after the barrier loops back. Your 5070 bisection fits (b) better (theWaveIsFirstLaneswap), but (a) is still open. On a card where a hang is acceptable, these would separate them: first_lane through the repo's DXIL backend (direct: true, which keeps the loops separate: (a) predicts a pass, (b) a hang), and first_lane via dxc with the alloc store underlane == 0in place ofWaveIsFirstLane()((a) predicts a hang, (b) a pass). Both variants draw the reference on WARP. I have the variant HLSL if useful.MeshRoundBound supersteps:False: not the round bound. The count-3 run hangs (MeshRoundBoundTests.cs:34), not the 2^31 one. Its phase 2 really yields, so it keeps the phase-2 barrier loop: the open, general form of #10. The superstep form of the same program passes on the 3070. One visible difference is that the two-phase inner while(pc < PC_YIELD) has no step guard and the superstep one does.
AI-assisted (Claude Code, Claude Opus 5.5): read the code, ran WARP and the non-hanging cases, wrote this.
Shaders: readfirstlane takes each program wave's lane on hardware wav…
Tests: compute cases bind their literal sampler; the integer gathers …
guialmm commentedon Nov 26, 2026
On the root-descriptor fallback (
msfb_ngg_strips_rootdesc, and the twoUserDataBindingTests"mesh fallback, root descriptors" cases), from an RTX 3060 (driver 32.0.16.1714) onmainb1b6655:The draw arguments come out right (the test's
DrawIndexed arguments + vertex countercheck passes), but every pixel stays at the clear value. The cause is the capacity check inMeshComputeFallback's allocation:g_msfb_vtx.GetDimensions(cap_v); g_msfb_idx.GetDimensions(cap_i);, and the group is dropped when it does not fit. Root descriptors carry no size, soGetDimensionson them is undefined. WARP happens to return a usable size; NVIDIA evidently does not, so every group is dropped: the counters still advance, nothing is stored, and the zeroed index buffer draws only degenerate triangles. With thatifdisabled locally, bothmsfb_ngg_stripsvariants pass on the 3060.The loader binds the fallback through the table (
FallbackTableParameter, as the contract indocs/shader-translation.mdsays), whereGetDimensionsis defined, so this only concerns the root-descriptor form the tests exercise.Two ways I can see, and I'm happy to send either:
u2when it clears it, and the compute shader reads them there instead of callingGetDimensions. Small change to the contract table.Which would you prefer?
AI-assisted (Claude Code, Claude Opus 5.5): traced the cause and ran the checks above on my machine.
Shaders: readfirstlane takes each program wave's lane on hardware wav…
Tests: compute cases bind their literal sampler; the integer gathers …
guialmm commentedon Nov 26, 2026
On the E_OUTOFMEMORY group (the
cs_buffer_*,cs_root_descriptor,buffer_load_dword,s_buffer_loadand StageProbe cases, 21 on an RTX 3060, driver 32.0.16.1714,mainb1b6655), in case it saves you time:The cause is the overflow test in
buf_limitandsbuf_limitinrdna_prelude.hlsli:index > 0xffffffffu / max(stride, 1u)(andd2 > 0xffffffffu / stride). I narrowed it down by creating the compute pipeline for cut-down copies ofcs_buffer_bounds:BufStore(a strided view throughbuf_limit(s9, s10, s11, v41)) is enough to get E_OUTOFMEMORY;limcopied but the division replaced by a constant, or done in float, the pipeline is created;0xffffffffu / xand stores it is accepted, so it is the division feeding the store's guard, not the division alone.Since the stride has 14 bits, the same test needs no division: with
index = hi * 2^18 + lo,index * stridereaches 2^32 exactly when(index >> 18) * stride + ((index & 0x3ffff) * stride >> 18) >= 0x4000, and no step passes 32 bits. I checked it against the division for every stride 0..0x3fff on the edge indices around each threshold plus random ones: no difference.With that in both functions, all 21 pass on the 3060, and WARP is unchanged (shader project 544 passed, 0 failed, without the three known hang cases). The change is in
rdna_prelude.hlslionly. If you haven't fixed it on your side yet, I can open a PR.AI-assisted (Claude Code, Claude Opus 5.5): bisected the pipeline creation and ran the checks above on my machine.
ThatRecompDev commentedon Nov 26, 2026
thanks both, this is great narrowing.
@guialmm on the E_OUTOFMEMORY group: yes please open a PR with the division-free check, nice find that it's the division feeding the store guard. it changes translation output so we'll land it with the next translator batch (where #61 and #62 are going too).
on the root-descriptor fallback: option 2 please. nothing binds the fallback that way, the loader always goes through the table, so dropping or marking the root-descriptor variants unsupported keeps the contract simpler than carrying the capacities in u2.
@upipibi the one-round vs two-round split is a really useful cut. we can run both of your variants on our 4090 where a hang is fine, so if you can drop the variant HLSL here (or a branch) we'll run first_lane through our DXIL backend with direct: true and the lane == 0 version via dxc and report which one hangs
upipibi commentedon Nov 26, 2026
Here are both variants, for the
ms_ngg_first_laneprogram (MeshStageRunner.FirstLane). I dumped them atff1c25c; the lines involved should be the same at45071d5.1.
direct: true(DXIL backend, nested loops; (a) predicts a pass, (b) a hang): this needs no edited HLSL. Translate the program as the test does and compile it withDxilBackend.Compile(header + hlsl, "ms")instead of dxc.2. dxc, the alloc store under
lane == 0((a) predicts a hang, (b) a pass): take the translated first_lane HLSL and change both GS_ALLOC_REQ stores (two identical lines, one per phase-1 copy):Nothing else differs. That leaves no wave op running after the barrier back-edge in phase 1. dxc still fuses the inner
while (pc < PC_YIELD)into the round loop, so the two hypotheses still predict different results.Both variants draw the MeshStageRunner reference on WARP with s11 = 0 and 1. I have not run them on NVIDIA: our 3070 hangs on the base case, so I'm leaving the hang runs to you. This is the local WARP test I used. It reads variant 2 from
$FL2_OUT/v2_fl_nofirstlane.hlsl, which is the header plus the edited HLSL:ZzFl2VariantTests.cs (local only, uses MeshStageRunner's private Reference)
AI-assisted (Claude Code, Claude Opus 5.5): made the variants, ran them on WARP, wrote this.
Shaders: readfirstlane takes each program wave's lane on hardware wav…
ThatRecompDev commentedon Nov 27, 2026
ran both variants on the 4090 (driver 32.0.16.2124, main at 9ec6f20), each case in its own process with
FIVESTAR_TEST_ADAPTER=hardware.direct: true (our DXIL backend) passes, s11 = 0 and 1, draws the reference. the dxc one with the alloc store under
g_vw_lane == 0uhangs, both s11 values, DXGI_ERROR_DEVICE_HUNG after ~5 s with an nvlddmkm 153 each time. the unmodified base case hangs the same way here too, so the 4090 isn't immune like we assumed. reran everything after a minute with direct and dxc interleaved and got the same result, direct passes right before and after each hang.so that's your (a): it hangs without any WaveIsFirstLane after the barrier, and the same program with the loops kept separate is fine. (b) is out as the cause for this one at least. what it doesn't prove yet is that the fused loop specifically is the trigger, since our backend differs from dxc in more than the loop shape, and I didn't check the compiled DXIL of variant 2 for other wave ops. next step on our side is probably a dxc build where the inner while can't be merged into the round loop, and the same pair on MeshRoundBound supersteps: False to see if it's the same thing.
all four still pass on WARP, same as you saw. thanks for the variants, this was a clean cut.