[NVIDIA RTX 3070] World TDR traced to wave64 mesh shaders (DRED per run); #578 removes the hang, world then renders black #778
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory#778
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@KenzoPortela on GitHub · 2026-11-24 10:32 UTC · original
Related: #314, #625, #392 (same symptom on other NVIDIA cards), #578, #189, #192, #734.
Setup: Windows 11 Pro 26200, Ryzen 5 3600X, 32 GB, NVIDIA RTX 3070 (driver 32.0.16.2124, 32-lane waves only). VIctory
8e79c80,cargo build --profile diag -p victory --features diagnostics. Own copy, title 1.0.2.1 (exe BLAKE3b99f876b74d4a77f03af5f878223b27bd647b5c35a79d5decd9f716504239e93).Works: boot, offline profile, intro, first-boot screens, legal/terms, saves, story load. Menus at a steady 30 fps. Network stays closed: the title's Breakpad crash reporter tried to upload a ~28 MB minidump to
submit.backtrace.io:443after a WARP crash andvictory_hle::modules::netblocked it (HTTP connection blocked).Problem: entering the world always ends in
DXGI_ERROR_DEVICE_HUNG(TDR), not an invalid command (debug layer message is the TDR one).What
VICTORY_D3D12_DRED=1showed, run by run:VICTORY_SHADER_LOOP_LIMIT=4096mesh d9abe24ad7bfe920, pixel 264ae8d58e78b62dVICTORY_SKIP_PIPELINES=d9abe24ad7bfe920mesh f0c7efd2aceb2aaa, pixel 7d85c9cab3c80721VICTORY_SHADER_LOOP_LIMIT=64+ same skipmesh 4adfa13bea1c556amain+ #578 merged locally (no loop limit, no skip)no host pipeline: a mesh program written for 64-lane waves, on a host without themSo a hang that survives a loop limit of 64 on a single mesh group points at wave64 mesh programs running as two 32-lane waves (lockstep/LDS assumptions), not at long loops alone. #578 turns it into dropped draws on this GPU; the world then renders black.
Other observations
main(wave64).no host texture … 0x80070057).0x1c8and0x218are logged as not implemented.host view heap capped at 1000000(count 1245184).VICTORY_D3D12_WARP=1the title's own watchdog ends the run (mov dword [0], 0after ~30 s without progress), so WARP can't reach the world at that speed.AI-assisted (Claude Code): the runs were made on my machine with my copy; nothing from the game is attached.
@KenzoPortela on GitHub · 2026-11-24 11:09 UTC · original
Follow-up on the same RTX 3070 (32-lane waves), local branch =
8e79c80+ #578 + the #747 change (MIN_DYNAMIC = 1 << 18):eeed82b877b44b5f(dispatch 12×1×1, DRED stop on op 6) also translated onmain; it was simply never reached before. Skipping it (VICTORY_SKIP_PIPELINES) plusVICTORY_SHADER_LOOP_LIMIT=4096gives the stable run above.wave64-emulationbranch from #734 on top, ~500 translation refusals remain in the world, of which only ~130 are wave64-related ("a step across lanes in lane-dependent code…" 105, "a compute group of several 64-lane waves…" 25); the rest are general (select on an untracked mask 83, descriptor read only as data 79, lane mask read as data 73, structured buffer of unknown stride 36, …).console_lanes: swizzle/permute/mbcnt/readlane/DPP/masks as data/constant lane sets, plus LDS within one console wave) for mesh programs too and only refusing the lane-dependent ones. Result in the world: only 6 of ~66 distinct wave64 mesh programs pass; ~1,640 mesh draws per frame stay refused. So on this title the world's mesh programs really read across lanes, and NVIDIA needs a real wave64-on-wave32 form for mesh (two 32-lane halves exchanging masks/lane values), not a looser refusal. Happy to share the small diff if useful.AI-assisted (Claude Code); nothing from the game attached.
@EduBertozzi on GitHub · 2026-11-24 11:40 UTC · original
A possible way to keep mesh geometry on 32-lane hosts, and one number I need from someone with the title first.
All of the title's mesh programs are wave64 (per @ChruutvoLuzi's count on #578), and mesh shaders cannot declare a wave size. On NVIDIA each console wave runs as two 32-lane host waves that branch per lane. A half with no active lane on a path can skip an
s_barrierthat its console wave reaches, and then the other half waits forever. That would fit the hang above even with one group and a low loop limit, though I haven't confirmed it on the title.I've been prototyping a compute fallback for mesh pipelines on GPUs without mesh shaders (#3). It runs the mesh program as a compute shader that writes vertices and triangles to buffers, then draws them with a generated vertex shader and the title's pixel shader. A compute shader can do what a mesh shader can't: run in #439's console flow, where both halves take every branch together and exchange lanes through group-shared memory. So the same fallback could serve as the mesh path on NVIDIA. The catch is that #439's console flow only takes groups of at most 64 threads, and I don't know the title's mesh group sizes.
So I added
victory mesh-censusonpr/mesh-compute-fallback(today'smainplus the fallback). It prints a table by group size: programs, wave64, LDS,s_barrier, lane reads,v_mbcnt, EXEC branches, and how many translate as mesh and as compute. Then it lists the refusal reasons. Counts only, nothing of the programs.It translates every mesh program twice, so expect a few minutes. If you can, please paste the output here.
AI-assisted (Claude Code). The tool's tests are synthetic, and I haven't run it on the title (I don't have a PC copy).
@KenzoPortela on GitHub · 2026-11-24 12:10 UTC · original
More measurements on the same RTX 3070 — the world now renders its geometry on a 32-lane GPU.
1. The wave64 mesh programs #578 refuses are (almost) lane-independent once translated. I translated the 131 distinct wave64 mesh programs refused in the world (
victory translate --list+VICTORY_EMIT_DUMP, thendxc -dumpbin). The only wave intrinsics in the emitted DXIL areWaveReadLaneFirst(881 calls) and one quad-localQuadReadLaneAt; no barriers, no ballots. Mesh code takes the console lane fromflattenedThreadIdInGroup & 63and computes masks/v_mbcntper lane from it, so the host's wave size doesn't matter there. 7 of the 131 contain loops.2. Letting them run as 32-lane halves (a local diagnostics switch that bypasses #578's mesh refusal) with
VICTORY_SHADER_LOOP_LIMIT=1024:eeed82b877b44b5fand mesh38ad582f523fd7cf, see 4);3. The world TDRs look like loop guards, not wave64 deadlocks. Same run without a loop limit: TDR at a draw of
mesh 04b9be3756e8f41c(no loops) +pixel 1af4a50c7fb40c97, a pixel program with 7 back edges including nested loops. A per-lane guard of 2^20 per loop on nested loops can mean ~2^40 iterations per pixel when the inputs that should end the loop were never written (their producers dropped). A much lower guard for pixel/mesh programs (or a guard on total iterations rather than per loop) would probably remove most world TDRs on AMD too.4. The one real wave64 hazard I found in mesh code is
WaveReadLaneFirstof values that are not uniform over the console wave, e.g. the group's vertex/primitive counts inMSNC_VS_Cable(38ad582f523fd7cf): on a 32-lane host each half reads its own first lane. That draw still hung once with loop limit 1024. A fix could routev_readfirstlanein wave64 mesh programs on narrow hosts through a groupshared slot written by the console wave's first active lane.Happy to share the local diff (lane-dependence analysis for mesh + the diagnostics switch). AI-assisted (Claude Code); nothing from the game attached.
@Ilokaxt on GitHub · 2026-11-24 12:16 UTC · original
Same on an RTX 3070 Ti Laptop (NVIDIA driver 610.88). On
mainffe310ethe device hangs in anExecuteIndirectabout 3 minutes into the world, and with #223 and #192 the hang also comes in anExecuteIndirect.With #578 merged in there was no device removal in 420 s. The cost: in the world it kept 90–205 draws per frame and dropped 1,000–5,700, about 85–98% of world draws, because the wave64 mesh programs are refused up front.
@MartinIndra02 on GitHub · 2026-11-24 12:31 UTC · original
RTX 3080 (
621.24, 32-32 wave lanes, Windows 11) confirmation for the mesh-hang family (following up from#732):mainffe310e+#439+#431+#724/#725(dpalacios69) +#783(perf/gpu-copy-mapped-region-fallback) +#776(schmiticle) +#584(fix/shader-heap-bounds-clamp) +#757.VICTORY_D3D12_DRED=1,VICTORY_GPU_TIMING=1,VICTORY_SHADER_LOOP_LIMIT=1000, retail 1.0.2.1.#579: hit0x887A0006(DEVICE_HUNG, no page fault) in the world on:command 80 of 140 (op 42): mesh 6 [mesh c962201cddbdd7dd, pixel 57a27c5e2e1d62a9]#579+VICTORY_SKIP_WAVE64=mesh: ran 10+ minutes continuously in the world at1.0 – 1.3 fps(750 – 966 ms/frame), 2,008 translated shaders,0host pipeline refused,0slow host submission,0DRED page faults,0device removed(30 wave64 mesh skip lines logged).No game data posted. AI-assisted; build and title run executed on my machine.
@lines9686-rgb on GitHub · 2026-11-24 12:59 UTC · original
RTX 3060 Ti (NVIDIA 621.24, 32-lane waves only), Windows 11 26200, own 1.0.2.1 copy,
--profile diag --features diagnostics, 5-minute runs:mainffe310emain+ #578 + 2^18 dynamic slots (#747)With #439 the only big gap left on NVIDIA is the mesh path: #578 refuses the wave64 mesh programs, so 20–50 mesh draws per frame (the world geometry) are dropped. Remaining translator refusals in that run are compute only (344 shaders; most common "a descriptor read only as data", i.e. #798).
I'm working on running wave64 mesh programs on 32-lane hosts on top of #439's console flow (two 32-lane host waves per console wave in one group), so they can render instead of being refused or hanging. Will post a fork branch with tests and NVIDIA numbers here. If someone is already on it, tell me and I'll test theirs instead.
AI-assisted (Claude Code).
@ChruutvoLuzi on GitHub · 2026-11-24 13:09 UTC · original
RTX 4090 (driver 621.01, Windows 11), diag build,
mainffe310e,VICTORY_D3D12_DRED=1, mesh programs not refused. On this card the world needs two things, and a loop limit is only one of them:main0x887A0006mesh 159 [mesh 4adfa13bea1c556a]main+ #493main+ #4930x887A0006mesh 4 [mesh 04b9be3756e8f41c, pixel 1af4a50c7fb40c97]The stop at 1024 without #493 isn't a loop.
4adfa13bea1c556a(MSR_VS_CascadeShadows_drawskinned) has 21 branches and no back edge, and its pipeline has no pixel shader. It reads its vertex data through root parameter 3, the root SRV that #493 bounds to the buffer's host copy, as do theMS_VS_TransformDpermutations I've seen stop. The stop at the default limit is the pixel loop in point 3 of KenzoPortela's comment above, also in the 5090 comment on #71.With both, the mesh draws run (718 mesh pipelines, about 2,000 draws per frame at about 1 fps), the HUD's movement prompt shows, and the final image is black. A dumped 2560x1440 target (format 62) holds coherent scene geometry: ceiling fans, chairs, tables, a door frame.
Two notes on KenzoPortela's points:
38ad582f523fd7cf, one of the two programs skipped in point 2, is the example in #493's description: on AMD it page-faults readingroot3just past the end of its host copy. With #493 it may not need skipping; theWaveReadLaneFirstconcern in point 4 would be separate.main+ #568 + #334 + a #725 patch, and the 3080 tree withc962201cddbdd7dd) don't list #493.AI-assisted (Claude Code).
@Ilokaxt on GitHub · 2026-11-24 13:10 UTC · original
Follow-up from the RTX 3070 Ti Laptop: the mesh hang here goes away with #587 (mesh output bounds, all primitives initialised, no sync on a divergent
s_barrier), with the wave64 mesh programs enabled, so noVICTORY_SKIP_WAVE64is needed. Tree:mainffe310e+ #439 + #431 + #579 + #587. No device removal in 420 s, about 1,750 world draws kept per frame instead of about 350 with the mesh programs skipped. This suggests the hang is #587's bounds/barrier issue rather than the wave size itself.@LAKSHYA-cmd-tech on GitHub · 2026-11-24 13:18 UTC · original
Integrated PR #578 wave lane bounds checking into our integration branch (PR https://github.com/LAKSHYA-cmd-tech/VIctory/pull/19). This cleanly catches wave64 mesh programs and unlowered wave64 compute on Wave32 GPUs (such as the RTX 3070/4070/5090) and WARP before dispatch, preventing the driver TDR / DXGI_ERROR_DEVICE_HUNG.
@MartinIndra02 on GitHub · 2026-11-24 13:22 UTC · original · edited 2026-11-24 13:24 UTC
Follow-up on RTX 3080 (
621.24, Windows 11) confirming @Ilokaxt's#587result with wave64 mesh shaders enabled (noVICTORY_SKIP_WAVE64):mainffe310e+#439+#431+#724/#725+#783+#776+#584+#757) +#587+#493+#798(VICTORY_D3D12_DRED=1,VICTORY_GPU_TIMING=1,VICTORY_SHADER_LOOP_LIMIT=1000).1.1 – 1.2 fps(800 – 933 ms/frame) with 618 host mesh pipelines active (2,140 translated shaders, 452 failed,0host pipeline refused,0slow host submission,0DRED page faults,0device removed).mesh 6 [mesh c962201cddbdd7dd, pixel 57a27c5e2e1d62a9]TDR is gone without skipping mesh draws.No game data posted. AI-assisted; build and title run executed on my machine.
@OrangeCrane1738 on GitHub · 2026-11-24 13:25 UTC · original
Same result on Blackwell (RTX 5060 Ti), in case another data point helps.
Setup: NVIDIA GeForce RTX 5060 Ti 16 GB (driver 621.24), Windows 11 Pro. VIctory
ffe310e,cargo build --profile diag -p victory --features diagnostics,VICTORY_D3D12_DEBUG=1,VICTORY_D3D12_DRED=1, default console mode. Title 1.0.2.1 (exe BLAKE3b99f876b74d4a77f03af5f878223b27bd647b5c35a79d5decd9f716504239e93).Works: boot, intro, menus, story load. The first cutscene's audio plays over a black picture.
Then: TDR about 4 minutes in. The debug layer's only message is the TDR one (
DXGI_ERROR_DEVICE_HUNG), nothing before it.DRED: the list stopped at command 204 of 788, op 42 (DispatchMesh), inside a run of op 42 (173..209) between two barriers, the same pattern as run 1 above. Also in flight: ExecuteIndirect kind 10
mesh 91976f0707015815, pixel 06299eb2cb91ad6f, and DispatchMesh withmesh b68376181e9c8b2fandmesh ba9865c71b8d1947.Counts in that run: 362 shaders do not translate, 114 host pipelines refused, 15 draws/dispatches dropped for no dynamic slots (as in #747). The release build at the same commit ends the same way (
0x887A0004, then0x887A0006).Happy to test #578 or another branch on this card.
AI-assisted (Claude): log analysis. Runs made on my own machine with my own copy; nothing from the game is attached.
@lines9686-rgb on GitHub · 2026-11-24 13:26 UTC · original
Correction to my comment above: @KenzoPortela had already shown at 12:10 that the wave64 mesh programs run as 32-lane halves, before I wrote that I'd work on it — I'm not doing a separate implementation, sorry for the noise.
What I can add is a third NVIDIA data point for that approach. RTX 3060 Ti (621.24, 32-lane), own 1.0.2.1 copy, #439 stack + #493 + #587 + 2^18 dynamic slots (#747) + #578 with the mesh refusal bypassed locally (as in Kenzo's point 2),
VICTORY_SHADER_LOOP_LIMIT=1024, nothing skipped: 5 minutes, no TDR, 1.4–1.6 fps in the world, 0 host pipeline refusals. A render-target dump of a world frame holds the scene geometry (one target is a clean silhouette mask of lamps, signs, bollards and a building); the presented image is black, as on the 3070/4090. Happy to test Kenzo's diff when it's shared.AI-assisted (Claude Code).
@Machad3x on GitHub · 2026-11-24 13:31 UTC · original
Confirmation on another GPU (RTX 3080 Ti, 32-lane waves, Windows 11): the same world TDR. The first stuck command in our runs is a tiny wave64 mesh dispatch (mesh 04b9be3756e8f41c with pixel 1af4a50c7fb40c97, 4 groups; the list took 1.4 s with VICTORY_GPU_TIMING=1 and the device was removed at ~2 s), then mesh 89036e16fa081505 / a26422c01dcf5612 once the first is skipped. The mesh DXIL itself has no loop and no barrier (128 threads, 56 blocks); the pixel shader is 22.8k lines with 7 loops. With #578 merged the TDR is gone and the world renders black, as described here; the builds with #233 on top also stay up (5 to 8 minutes per run). Fork with the integration: github.com/Machad3x/VIctory branch claude/gta6-shader-translation-crashes-705550.
@ByMateos on GitHub · 2026-11-24 13:33 UTC · original
@EduBertozzi the
victory mesh-censusoutput you asked for, from my own 1.0.2.1 copy (RTX 3070 Ti machine; the tool itself doesn't use the GPU), built frompr/mesh-compute-fallbackat5f0b602, run on the game folder:Every mesh program is a 128-thread group (two wave64 waves), so none fits #439's 64-thread console flow as it is. Only 5 use LDS and 115 have explicit lane reads, which fits KenzoPortela's finding above that most run as 32-lane halves once translated.
AI-assisted (Claude Code); counts only, nothing from the game attached.
@Ilokaxt on GitHub · 2026-11-24 13:40 UTC · original
Correction to my note above: two longer runs (900 s budget) with the same tree (
mainffe310e+ #439 + #431 + #579 + #587, mesh programs enabled) did hang, in a mesh dispatch each time:DispatchMesh(159), mesh4adfa13bea1c556a, the same program and dispatch that hangs without #587;DispatchMesh(1), mesh18bbb989c875c8fb.My 420 s run had simply not reached them. So #587 does not remove the mesh hangs on the RTX 3070 Ti. It only let the world run longer with the mesh programs enabled (about 1,400–2,000 draws kept per frame) before one of them hangs. Sorry for the noise.
@KenzoPortela on GitHub · 2026-11-24 13:40 UTC · original
Thanks all for the data. Sharing what I said I'd share, and what overlaps with your PRs.
Branch:
KenzoPortela/VIctory@loop-budget— one commit on today'smain(ffe310e):VICTORY_SHADER_LOOP_BUDGET=<n>(diagnostics builds) bounds all loops of an invocation together.LOOP_LIMITis per loop and restarts at 0 on every entry, so nested loops multiply it; the budget is one per-invocation counter (an internal, non-constant DXIL global, i.e. HLSLstatic) that every back edge increments, and a loop is left when its own limit or the budget is reached. Unset, nothing changes; the shader cache keys on it like on the limit. Clippy-D warnings(with and without--all-features),victory-shader/victory-gpulib tests andcargo xtask policypass;PS_Textured_Eight(1af4a50c7fb40c97, nested loops) and 131 wave64 mesh programs validate withdxil.dll.Result on the RTX 3070 (tree:
8e79c80+ #578 with the mesh refusal bypassed, #747's 2^18, #282, #302, #489, the #734wave64-emulationbranch, my mesh output bounds,VICTORY_SHADER_LOOP_LIMIT=1024+VICTORY_SHADER_LOOP_BUDGET=16384, only computeeeed82b877b44b5fskipped): 30 minutes in the world without a device removal, ~2,400 draws per frame at 0.2 fps, HUD prompt shown, presented image still black. With the loop limit alone the same kind of tree stopped after a few minutes at a different one-group mesh/pixel draw each run (59874b28fd64363d/ee78da6862364dddlast).Overlaps, so nobody duplicates work:
38ad582f523fd7cfhere; @ChruutvoLuzi's point that #493 covers itsroot3read fits too, and myWaveReadLaneFirstworry (point 4 above) turned out wrong: those counts come from loads at group-uniform addresses.Why the picture is still black (on this tree): the G-buffers are filled (colour/normal targets at 2560×1440 fully written) but every full-screen HDR target (R16G16B16A16F, R11G11B10F) reads exactly 0 in the target dumps. The lighting chain itself mostly translates (
tiled_lighting_*exceptPrescalarizeLightLoop,deferred_lighting_LightMixOutputCS_*,PS_ResolveDeferred_0..2, luminance histogram,PS_CalculateExposure, LUT/ACES, composite). Two gaps that could gate it:shader_binning_utils_CS_GenerateShaderBinOffsets(8dd8d739047fe557), refused with the #734 branch as "a step across lanes in lane-dependent code on a host without 64-lane waves" (a wave64 scan, then a whole-wave reduction +buffer_atomic_addinside a lane-63-only branch), andavgLuminanceCompute_ColorDownsample(Init)CS("an address not from a root parameter"). I haven't proven either is the cause.AI-assisted (Claude Code); runs on my machine with my copy, nothing from the game attached.
@Machad3x on GitHub · 2026-11-24 13:46 UTC · original
Result on an NVIDIA RTX 3080 Ti (32-lane waves, Windows 11), fork github.com/Machad3x/VIctory branch claude/gta6-shader-translation-crashes-705550 (main + #302 #489 #294 #578 #650 #233 #709 #585 #309 #587 #452): wave64 mesh programs are NOT what hangs the GPU. With #578's mesh refusal switched off (a diagnostics-only switch on the fork, VICTORY_ALLOW_WAVE64_MESH=1): without #452 a world frame costs 4.3 s of GPU and the device is removed (even with #587); with VICTORY_SHADER_LOOP_LIMIT=64 the same run stays up (3731 draws per frame, about 90 ms of GPU per frame, no removal, no slow list); with #452 and its defaults (spin limit 4096, no manual limit) the run stays up for 5 minutes, 3900 draws per frame, 441 ms of GPU per frame. So the TDR was loops running to the 2^20 limit, as #452 measured on an RX 7600, and #578's mesh refusal looks unnecessary once #452 is in; only the frame CPU time (about 600 MB of copies per frame) remains very high. Not yet checked: whether the picture is right (the world was still mostly dark on the RX 7600 per #452).
@EduBertozzi on GitHub · 2026-11-24 13:49 UTC · original
Thanks @ByMateos, that answers the question I asked here.
What it settles:
s_barrierin all 9,282, but LDS in only 5. A barrier with no shared memory around it orders nothing, which fits @KenzoPortela's finding that the translated programs carry no barriers. So the hazards on 32-lane hosts are the ones he named: the 115 programs with explicit lane reads (v_readfirstlaneof values that aren't uniform over the console wave) and those 5 LDS users. Those are where a wave64-on-32 fix has to be right; the other ~9,160 should be indifferent to the split.a scalar memory read as data(390), is #798, where fixes are already being tested.AI-assisted (Claude Code).
@hyperland956-lgtm on GitHub · 2026-11-24 13:52 UTC · original
The latest mesh-census and A/B comments materially narrow the problem.
The reported census found all 9,282 title mesh programs use 128-thread groups; all are Wave64, and all include
s_barrierplus EXEC branches.Therefore a compute fallback through #439's current console flow cannot simply be reused unchanged: it must preserve two console Wave64s per group, including synchronization across both logical waves.
The later RTX 3070 report is also important. After bypassing the mesh refusal and using a bounded loop guard, approximately 2,100 draws/frame ran and render-target captures contained scene geometry, while the final image remained black.
The reporter found that emitted code for 131 distinct refused Wave64 mesh programs used 881
WaveReadLaneFirstcalls and oneQuadReadLaneAt, with no other wave intrinsics in the inspected output.The remaining suspected semantic hazard is a non-uniform
WaveReadLaneFirstinput across the two physical halves—for example, vertex/primitive counts—because each 32-lane half can select a different first lane.Proposed synthetic test:
Use a 128-thread mesh-equivalent compute kernel with two logical 64-lane console waves, divergent EXEC branches, LDS stores/loads and barriers, where a value read by logical lane 0 differs between physical halves.
Compare the emulated result against a scalar reference for both halves, including inactive first lanes and partial/empty paths.
A candidate fix is to broadcast the console-wave first active value through group-shared memory with explicit ordering, but it must be proven safe with the title's actual barrier topology and must not assume one console wave per group.
This is not a request to simply disable the mesh refusal. #578's refusal avoids a TDR but removes world geometry.
The required deliverable is a correctness-preserving 128-thread/two-console-wave mesh path or a compute fallback supporting the same group shape and synchronization semantics.
(AI-assisted)
@alfycs on GitHub · 2026-11-24 14:01 UTC · original
Following @ByMateos's
victory mesh-censusfindings (9,282Wave64 128-thread mesh programs,103failing with"a lane mask read as data",115with lane reads/v_readfirstlane,2cross-lane ops, almost none withlds_bytes > 0) and @KenzoPortela's / @Kam471's reports, we pushed a clean follow-up branch stacked on #189 (c047885):Branch:
alfycs/VIctory@feat/wave64-mesh-emulation(b3671c8, built on #189 +mainffe310e)What it changes (
Shaders: emulate Wave64 mesh shader lane ops and masks in LDS)WaveSize(64), Wave64StageIo::Msprograms running underWave64Mode::Wave32 | Emulateselectively enable portable LDS emulation (Wave64Mode::Emulate+MaskData::Console) whenever they use:s_bcnt1,s_ff1,v_mbcntof tracked masks, scalar mask reads);v_readlane_b32/v_writelane_b32, non-quadds_swizzle/DPP/permute, or wave reductions/prefixes;v_readfirstlane_b32(group-uniformv_readfirstlanepasses directly with zero barriers/WAVE_OPS; uniform non-uniform uses exact 64-lane LDSatomicMin; divergent non-uniformv_readfirstlanefalls back per 32-lane half underWave64Mode::Wave32to preserve waterfall loops without hanging).v_mbcnt(-1)and quad-local swizzles keep zero extra LDS scratch and unchanged codegen.Verification (RTX 3070 Ti + WARP +
dxil.dll, no game files)cargo xtask policy:asset policy: 155 files okcargo clippy -p victory-shader --all-targets --all-features --locked -- -D warnings: 0 warnings, 0 errorscargo test --workspace --locked: 370 passed, 0 failed, 6 ignored (victory-shader: 148 passed, 0 failed, 1 ignored)VICTORY_WARP=1 cargo test -p victory-shader wave64_tests --locked: 27 passed, 0 failed, including two new 128-thread Wave64 Mesh + PixelDispatchMeshlive GPU pixel-readback tests covering virtual wave0(s_bcnt1,s_ff1, dynamic cross-halfv_readlane) and virtual wave1(v_readfirstlane,v_writelane_b32,s_bcnt1).Note:
gh pr createcurrently reportsCreatePullRequestis restricted on upstream, so sharing as a fork branch stacked on #189 for anyone testing Wave64 mesh rendering (e.g. with #587).@jebaczydow on GitHub · 2026-11-24 13:55 UTC · original · edited 2026-11-24 14:08 UTC
RTX 5070 Ti (32-lane waves), Windows 11: world runs with wave64 mesh refused vs allowed
Tree:
mainffe310e+ #439 (headc153b21, includes #223/#233/#320) + #334 (c99e429) + #578 + #452 (3ede934). One local change, unrelated: textures the host refuses with unordered access are retried without it. One local switch:VICTORY_ALLOW_WAVE64_MESHturns off #578's mesh refusal.All runs: diagnostics build,
VICTORY_D3D12_DRED=1, the same scripted entry into the world (VICTORY_KEYS=15:Enter,25:Enter,35:Enter,50:Enter).0x887A0006.DispatchMeshofmesh 38ad582f523fd7cf.VICTORY_SHADER_LOOP_LIMIT=64mesh ae9ee9074f2e971f.VICTORY_D3D12_DEBUG=1+VICTORY_D3D12_GBV=10xc0000005write to0x0atgame_scarlett_master.exe+0x23cf683.Neither DRED report names the command that hung.
The two mesh programs named above (
38ad582f523fd7cf,ae9ee9074f2e971f) each have:ds_*instructions,s_barrier,ResourceHeaproot parameter.Without #334, the debug layer reports 18
IASetVertexBufferson a title buffer inUNORDERED_ACCESS, and 44 barrier before-state mismatches (#548/#264). With #334 both counts are 0.AI-assisted (Claude Code, Claude Opus 5.5).
@ByMateos on GitHub · 2026-11-24 14:22 UTC · original
RTX 3070 Ti (621.35, 32-lane waves), Windows 11, own 1.0.2.1 copy. Wave64 mesh programs allowed (no #578), 10 minutes in the world without a device removal, and the HDR targets are no longer 0, but they look saturated.
Tree:
mainffe310e+ #439 + #431 + #587 + #493 + #539 + #704 + #452 +MIN_DYNAMIC = 1 << 18(#747). Merges were clean except a two-linemod/useconflict between #452 and #439 inemit/mod.rs. Two test initialisers also needed #439's newParts/emitfields.victory-shaderlib tests: 165 passed;victory-gpu: 53 passed. Diag build,VICTORY_D3D12_DRED=1, #452 defaults (no manual loop limit).dispatch 12x1x1 [compute eeed82b877b44b5f](the one KenzoPortela skipped above)VICTORY_SKIP_PIPELINES=eeed82b877b44b5fvictory translate --host-lanes 32-32on this tree: vertex/pixel 12,763 of 14,039, compute 1,460 of 2,582, mesh 8,215 of 8,713. Of those, #539 added +518 VS/PS, #704 +36 CS, and #168 changed nothing. #302, #329, #585 and #645 each conflict with #439.Lighting chain (frame 2100,
VICTORY_DUMP_TARGETS=1):shader_binning_utils_CS_GenerateShaderBinOffsets(8dd8d739047fe557) translates and runs on this tree. It is one of the two gaps KenzoPortela named.My guess, not verified: the PNG dump clamps floats, so "all 255" may be Inf/NaN rather than real light. An infinite or NaN average luminance would give the exposure/tonemap a zero or NaN scale, and that would explain a black frame with live HDR targets. Reading the actual float values of the 1×1 luminance target would settle it.
avgLuminanceCompute_ColorDownsample(Init)CS(the other gap, "an address not from a root parameter") is still refused here, since #302/#645 don't merge on top of #439.AI-assisted (Claude Code); runs on my machine with my own copy, nothing from the game attached.
@Ilokaxt on GitHub · 2026-11-24 14:27 UTC · original
Follow-up: with #650 added (
mainffe310e+ #439 + #431 + #579 + #587 + #650), the two hanging mesh programs (4adfa13bea1c556aMSR_VS_CascadeShadows_drawskinned,18bbb989c875c8fbMS_VS_TransformSkinD_NoDeform) no longer hang in two 900 s runs on the RTX 3070 Ti. The world ran 13.5 and 4 min, then hung on computeeeed82b877b44b5f(CS_ComputeHitDetectionSkinnedResults), which reads the same skinned-geometry buffers. So the NVIDIA mesh hang here looks like out-of-range root-view reads (#650) rather than the wave size.@KaV3R on GitHub · 2026-11-24 14:36 UTC · original
Same symptom on an RTX 4070 SUPER (32-lane waves, Windows 11 26300, own 1.0.2.1 copy), on
mainatffe310ewith a few local changes. Adding what we tried that is not in this thread yet, in case it saves someone a run.What happens: boot, intro, first-boot screens and the story load are fine; at the world's first frames the device is removed (
DXGI_ERROR_DEVICE_HUNG), DRED stops atop 42(DispatchMesh) with no page fault. WithVICTORY_SKIP_PIPELINESgrown one program per run, eight runs in a row each stopped at a different mesh program in the same first frames:04b9be3756e8f41c,b0c25c474da417b3,f2f6c9ab8aea0f06,c962201cddbdd7dd,a26422c01dcf5612,6b57e37fe499c6e7,9c6c7fb345f39611,38ad582f523fd7cf. So, as in #71, it looks like every world mesh draw, not a few programs.Ruled out here (one run each, on top of what #71 and #578 list):
WaveLaneCountMax < 64: console lane from the flat thread id (notWaveGetLaneIndex), a ballot placed in its half's word of the 64-bit mask (the other half's lanes read as inactive), lane reads kept in the half, noWaveSize(64)and no thread-id relabelling for compute. Tests pass (120/120 invictory-shader, GPU tests included), the pipelines are made, the device still hangs at the same draws.VICTORY_SHADER_LOOP_LIMIT=16: no change. All seven loops of the paired pixel program1af4a50c7fb40c97carry the limit check.04b9be3756e8f41c(128 threads, 128/128 outputs) everyEmitIndicesvertex index is below the count it is checked against (≤ 128), vertex outputs are written at the flat thread id; the DXIL validates and the pipeline is made byvictory translate --validate --pipelines.VICTORY_D3D12_WARP=1gets to the same point (frame ~8496, first world frame) and the device is removed there too (0x887A0005), with no access violation to point at an instruction.So on this card it is not the lane mapping, barriers, loops, dispatch size or output indices. #578's refusal is still the only thing that keeps the world up here (then black, as you describe).
Two side findings in case they are useful: Windows' "not responding" ghost window can replace the title's window during multi-second world frames, and its close button then ends the title mid-load (
DisableProcessWindowsGhosting()before the title's first window avoids that); and the title's own thread watchdog (two conditional jumps in its watchdog loop) ended slow indirect runs before35b054emade pipelines asynchronous. Happy to open PRs for either if wanted.@c4k3ss on GitHub · 2026-11-24 14:49 UTC · original
A way to run the wave64 programs on 32-lane hosts instead of refusing them: Leonida's emulation scheme (pointers, no game data)
The finding here, and #578's, is that the world hang on NVIDIA comes from wave64 mesh and compute programs running as two 32-lane waves. #578 turns that into dropped draws, and the world then renders black. Leonida's translator has a mode for exactly this hardware limit, and it is documented, so it may save a design round. Pinned at
d0da7dadof the continuation:s_cbranch_vccz/execzand friends), whole-mask words (s_bcnt1,s_ff1,v_mbcnt),v_readlane,v_readfirstlane,ds_bpermute,ds_swizzle,v_permlane16. The program runs in rounds: each wave runs one segment (a basic block, cut at each cross-lane op), then the whole group meets at one barrier in uniform control flow. A cross-lane op ends its segment after the lane has stored its value or ORed its bit; the code after it runs one round later, when all 64 lanes have written.s_barrierbecomes a scheduler state. A memory access that conflicts with an earlier one in the same segment starts a new round, so the two halves touch memory in instruction order, as one hardware wave does.tools/wave64_emulate_opt.py, and 21 hand-written*_w64x_*GPU fixtures underruntime/test/shaders/(ballots,ds_bpermute,s_barrierchains, LDS read-after-write, partial waves, a 128-thread group, one mesh program).maind0da7dad): that GPU suite passes 198 of 249 natively, with every wave64 compute and mesh fixture skipped for lack of 64-lane waves, and 230 of 249 with the emulation on. The 32 that flip are exactly those fixtures. The 2 failures are the same on both runs and unrelated.It costs performance (a barrier per round, state through memory), and Leonida targets SPIR-V, so this is a design to port, not code. But it would let NVIDIA and Intel hosts run these programs instead of dropping them. I don't have the title, so I can't say how many of the world's wave64 mesh programs contain a cross-lane op at all; ones that don't could run as plain 32-lane halves, and a count of that from someone with the files would size the work. AI-assisted (Claude Code).
@lines9686-rgb on GitHub · 2026-11-24 14:52 UTC · original
@ByMateos, on the question of whether the "all 255" luminance targets are Inf/NaN: on an RTX 3060 Ti (621.24, 32-lane) with nearly your tree, they aren't, and the saturated blue target isn't lighting.
Tree:
mainffe310e+ #439 + #578 (head's PSV0 rule, applied locally) + #493 + #587 + #431 + #539 + #704 (with #193) + #452 + #489 (with #302) + cybx's #645 port onto #439 + 2^18 dynamic slots (#747), wave64 mesh allowed with Peppacodes' host-lane numbering (#940) ported onto #439. Diag build,VICTORY_SHADER_LOOP_LIMIT=1024,eeed82b877b44b5fand269b802f878c24e1skipped. With the PSV0 rule the shader-binning, meshlet-culling and graph-ops compute programs stop being refused; a world frame went from ~2,600 to ~5,400 draws.I patched the target dump locally to also log, per target, the count of NaN, Inf and exact-zero channels, and to print targets of 16 pixels or fewer exactly. Frame 2000 (cutscene, title card on screen):
So on this tree the black frame isn't a NaN/Inf exposure: the full-res HDR scene targets are never written, and the saturated target is a depth-like buffer whose sky value is 10000. Earlier frames (1500–2100 over several runs) look the same. The R32_UINT 2560x1440 targets that presumably hold the packed G-buffer were also 0 in those frames.
The dump patch is a few lines in
capture.rs::to_rgba(diagnostics only). Happy to put it on a fork branch if it's useful to others.AI-assisted (Claude Code); runs on my machine with my own copy, nothing from the game attached.
@KenzoPortela on GitHub · 2026-11-24 15:39 UTC · original
avgLuminanceCompute_ColorDownsample(Init)CSnow translates: fix on a fork branch (one file, with a test)@ByMateos, this is the second gap you mentioned. It isn't #302/#645 territory. The address isn't a root argument: it points into a constant table appended to the program's own code. The compiler builds it as
s_getpc_b64+ literal, adds a per-lane index withv_add_co_u32/v_add_co_ci_u32, then moves it back to SGPRs withv_readfirstlane_b32before ans_load_dword. Resource tracking stopped at the readfirstlane, which gives "an address not from a root parameter".Branch: https://github.com/KenzoPortela/VIctory/tree/codetable-readfirstlane (one commit on
mainffe310e,resource.rsonly)sum()looks throughv_readfirstlane_b32only when what it reads iss_getpc_b64-based. A root parameter's address seen through a lane read keeps its old refusal.carried()does the same for the high half.code_dword()already lowers a computed index into the table, so nothing changed there.code_table_address_through_readfirstlane, which fails without the change.victory-shaderlib tests: 121 passed onmain. On my #439 stack: 161 passed.victory translate --validate).World run, RTX 3070 (32-lane): #439 stack + #587 #493 #282 #302 #489 #490/#464 #953 + loop budget + 2^18 slots + this fix. 15 min, no removal, 1.2 fps, ~2,450 draws/frame, 0 host refusals.
Largest remaining drops in that run (per frame, summed over the log), for anyone picking the next one:
ComputeImposterTransformPedTransformPreSkinDmesh variantsshaders.rpf(probably the RT/BVH builder, cf. #614)PrescalarizeLightLoop(tiled lighting)ShadowRenderTiled*(18 cascade-shadow programs)AI-assisted (Claude Code); runs on my machine with my own copy, nothing from the game attached.
@VibePorter on GitHub · 2026-11-24 16:07 UTC · original · edited 2026-11-24 16:31 UTC
RTX 5080: the world hang is translated loops that never end.
VICTORY_SHADER_LOOP_LIMIT=64on top ofexp/mesh-host-lanesremoves it and the title reaches gameplay (the cap alone onmaindoes not)Setup
--profile diag --features diagnostics,VICTORY_D3D12_DRED=1,VICTORY_KEYSpressing Enter every 3 s from 15 s to 360 s, noVICTORY_SKIP_*unless statedmain@ffe310e+ Peppacodesexp/mesh-host-lanes@ed9afc0(incl. #189) + #587 + #493(one conflict in
draw.rs: kept #493's bounded root-SRV tables and the branch's null-root-view fallback)Runs (same machine, one after another)
main@ffe310e, release build51ff151f75cd5759seen in the log)DispatchMesh351ff151f75cd5759/7fe75645c406cac6u8,u9VICTORY_SKIP_PIPELINES=51ff151f75cd5759DispatchMesh2f2f6c9ab8aea0f06/a5d8f39892a63276u8DispatchMesh404b9be3756e8f41c/1af4a50c7fb40c97u8,u9,u10DispatchMesh3b0c25c474da417b3/9a3acc60433be38au8,u9,u10VICTORY_SHADER_LOOP_LIMIT=64main@ffe310e(diag) +VICTORY_SHADER_LOOP_LIMIT=64, nothing elseDispatchMesh29 (barrier range 713..945, first listed command 714)f0c7efd2aceb2aaa/7d85c9cab3c80721u8,u9(The merges of #1014/#1084/#1073/#1074/#568 had conflicts only in test code or adjacent additions; the fixes themselves were kept, a few of their new tests were left out. #573 was not used because it clashes with #189's lane numbering.)
Run E in numbers
crashes.log.Takeaways
mainis not enough (F): there it still hangs on another wave64 mesh draw, andmainalso refuses 127 host pipelines that the patched tree builds. So the loop cap only works together with the wave64 lane handling fromexp/mesh-host-lanes(#189 +ed9afc0) and the PRs listed above. My guess is a loop whose exit depends on the null-descriptor reads or on lanes 32–63 of a wave64 mesh program run as two 32-lane halves, but I haven't confirmed that.With run E, a render-target dump (
VICTORY_CAPTURE_FRAMES+VICTORY_DUMP_TARGETS=1, frame ~2 minutes into the world) shows the 3D scene in the depth buffer and the G-buffer targets, while the lighting-sized target is flat grey and most other full-size targets stay empty: geometry renders, the lighting/composite stage does not, hence the black frame.Happy to rerun with other branches, a different loop limit,
VICTORY_D3D12_GBV=1, or a specific shader dump if that helps narrow down which loop it is.@Ilokaxt on GitHub · 2026-11-24 19:27 UTC · original
RTX 3070 Ti Laptop: two more dropped links on the way to the lit image (the deferred resolve shader, the tiled-lighting rectangle draws). The frame is still black with both fixed.
I agree with @lines9686-rgb and @KenzoPortela: the full-resolution HDR targets are never written. Below is what I found on the way from the G-buffer to those targets, and what did not help.
Setup
--profile diag --features diagnostics,VICTORY_SKIP_PIPELINES=eeed82b877b44b5f, 2^18 dynamic slots (#747).mainffe310e+ #439 #431 #587 #493 #539 #704 #452 #650, plus the device created on the high-performance adapter (#94/#208).1. Stability. With #650, the world runs 9 minutes with no device removal. I got that several times, from 9-minute runs up to one 20-minute run.
2. NaN in the scattering chain, real but not the cause of black.
scattering_transmittance_system:CS_DownsampleFarDistanceTargetDepth(4e65e4280be47b4b) writes a 960×540 R32F that is 100% NaN every world frame.CS_GenerateRayCoords(022eb4531da1421b) carries that NaN into 480×270.4e65e4280be47b4bremoves those NaN. The 80×45 R16F written byCS_IntegrateDiffusion/CS_GatherDiffusionstays NaN, and the scene still does not appear.3. The G-buffer has the scene, the HDR targets don't.
4.
PS_ResolveDeferred_3(4536a8bd77616602) does not translate: "a lane-mask join of an untracked mask" at0x8420.ffe310e, translating only this program and validating with dxil.dll:PS_ResolveDeferred_3mainstructure.rs:paired_masksis already there from another PR, so I kept that one.host pipeline shaders=[vertex 24abbd85477b8da6, pixel 4536a8bd77616602]).5. Tiled-lighting rectangle draws are dropped, and #1020 fixes that.
indirect kind 0: prepare failed (compute false, mesh false), up to 256 per frame.VS_TiledLighting_44ece319+PS_SSSResolve_44ece319.VS_TiledLighting+ about 90TL_PS_PBR_MATERIAL_*) gets host pipelines for every program.a rectangle geometry stage madetwice, and theprepare faileddrops are gone.6. Result: still black.
Still refused in the lighting path on this tree, for whoever picks the next link:
tiled_lighting:CS_PrescalarizeLightLoop("a descriptor's address or format read as data").deferred_tiled:CS_ComputeClosestDepth("an address not from a root parameter").shadowmask:CS_TraceShadowRays_Checkerboard(same reason).shadowmask:CS_DenoiseShadowMaskLDSPacked("an LDS write of bytes or halves").PS_FogComposite*(same lane-mask join asPS_ResolveDeferred_3).CS_RaytracingResolve(mostly "a descriptor read only as data").AI-assisted (Claude Code); runs on my machine with my own copy, nothing from the game attached.
@vladbondarenko97 on GitHub · 2026-11-24 19:43 UTC · original
RTX 3080 Ti data point for this recipe, on today's
main.Build:
mainffe310e+ #578 (b8b04ef) + #454 (d2c93fa) + #206 (05981dd) + #493 (c48b240), merged locally,diagprofile. Env:VICTORY_NO_WATCHDOG=1 VICTORY_SHADER_LOOP_LIMIT=4096 VICTORY_SKIP_PIPELINES=eeed82b877b44b5f VICTORY_D3D12_DRED=1. Host: RTX 3080 Ti 12 GB (32-lane waves), i7-12700KF, 32 GB RAM + 64 GB page file, Windows 11 26300, TDR delay 60 s. Retail 1.0.2.1 (exe BLAKE3b99f876b…), network blocked by firewall. 900 s run; first-run screens driven byVICTORY_KEYS.Result
shader does not translate; its pipelines' draws are droppedwarnings; per frame, about 50 draws are dropped for refused mesh / compute pipelines (the wave64 ones #578 refuses here).victory_gpu::host), e.g.0.8 fps, 1233 ms/frame (250 preparing: copies 133 ms 20.9 MB, textures 26.5 ms 106 MB; 128 on the GPU; 838 copying back 27.4 MB)and1.2 fps, 850 ms/frame (234 preparing: copies 160 ms; 108 on the GPU; 480 copying back 21.6 MB). The GPU part is about 50–130 ms; copying back is 85–840 ms and preparing 160–590 ms. On this card, readback, not GPU time, is most of the frame.dstorage: request failed: reading the sourcewarnings.So on an RTX 3080-class card this recipe reaches the same state as here (no TDR, black world, about 1 fps), and the next limit after the refused wave64 programs looks like the CPU-side copies back from the GPU. Logs can be shared on request (no game data in them beyond shader hashes).
AI use: Claude Code (Claude Opus 5.5) ran the box queue, read the logs and wrote this report; the numbers are copied from the log lines above.
@wildheathen on GitHub · 2026-11-24 20:56 UTC · original
RTX 5080, one data point on #650 alone: on main
ffe310e+ #65006657a8(merged locally; the only conflict was invalu_tests.rs, where I kept main's), the device is still removed, 23 s into the world. DRED stops atDispatchMesh, command 346 of 394, mesh51ff151f75cd5759/ pixel7fe75645c406cac6. That's the same program as @VibePorter's run A above. On plain main the same setup stops on4adfa13bea1c556aafter 84 s.So on this card #650 by itself moves the mesh hang rather than removing it. @Ilokaxt's 3070 Ti result had #439, #431, #579 and #587 in the tree too, so this doesn't contradict it. It only says #650 isn't enough on its own here.
Setup: Windows 11, RTX 5080, driver 32.0.16.2124, diag build,
VICTORY_D3D12_DRED=1, fresh copy of one save,VICTORY_KEYS, 480 s cap. One run.AI-assisted (Claude Code).
@Marvisak on GitHub · 2026-11-25 03:52 UTC · original
Automated triage for the maintainers. Complete run report (RTX 3070, driver 32.0.16.2124, Windows 11 26200,
8e79c80, DRED per run), with useful follow-ups from other 32-lane NVIDIA cards (3060 Ti, 3070 Ti, 3080, 3080 Ti, 4070 SUPER, 4090, 5060 Ti, 5080). The failure,DEVICE_HUNGin a mesh dispatch (op 42) once the world loads that moves to other mesh or compute work when one program is skipped, is the NVIDIA world hang tracked in #71, the oldest complete report; please follow it there. The data here (all mesh programs are 128-thread wave64 groups, the per-PR A/B runs, the loop-guard results, the compute stop ateeed82b877b44b5f) is a good reference for that work.Open PRs touching it: #1922 (refuse wave64 mesh/compute on 32-lane hosts, rebase of #578), #579 (
VICTORY_SKIP_WAVE64switch), #587 (mesh output bounds), #439 and #1929 (wave64 on 32-lane hosts), #961 (mesh compute fallback). The black image that remains once the hang is gone is discussed in #841. Several changes in this thread exist only as fork branches (loop budget, code-tablev_readfirstlane, wave64 mesh emulation,mesh-census); pull requests are open to everyone, so please open them as PRs if they are meant for upstream.Generated by Claude Code