fix(shader): folded light-atlas lane-mask joins (24/7 interior stall, #3835) #3871
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3871"
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?
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Still-Cam on 2026-11-30T09:52:57Z.
Summary
Fixes severe GPU stall inside 24/7 convenience store interiors on NVIDIA (#3835).
Open-world streets were playable (~20 fps), but walking into a 24/7 pinned the GPU (~143 ms/frame, 4–5 fps). Looking toward the store also dropped frame rate.
Cause
Folded wave64 compute for the particle light atlas (
ptfx_CS_lightAtlas_Sprite, hash2561af9577c47289) reads its EXEC lane-mask pair as a number to decide which half holds the first lane. Where that pair came through a join that only a loop header’s join reads, the join was not marked as read and its incoming masks became zero. From the second iteration on, the loop counter never advanced, so the loop ran to the 4096-iteration guard with the light’s whole body each round — tens of ms of GPU per dispatch, and lanes left without their store so the title kept asking for the same work every frame.Same class of bug as open PR #2853 / issue #2750 (indoor light-atlas stall). This branch is a cherry-pick of that fix onto current
main.Fix
In
victory-shaderfill_phis, folded programs now also treat lane-mask joins as read (ballot form), so the back-edge mask is preserved. Other joins keep the previous shortcut. Of ~26k title programs, 18 emit differently (all folded): light atlas (2), shadow masks (6), water volume light (4), scattering gather (2), particle updates (4). All still translate.Includes the synthetic regression tests from #2853 (CPU + host) for a loop whose header reads a mask join over its back edge.
Test plan
cargo test -p victory-shader --lib --locked folded_join— passed (a_folded_loop_header_reads_the_mask_join_on_its_back_edge)cargo build --release --locked -p victory) on Windows MSVCHardware / settings
41adb551Results
Before (from #3835):
After (crowded 24/7 sample):
Notes
Fixes #3835
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by JSa25 on 2026-11-30T10:12:26Z.
RTX 5090 data on the same two programs, in case it helps compare this fix with #2261. Setup: Ryzen 9 9950X3D, Series X profile, 2560x1440 with DLSS Quality, frame generation off, ray tracing off, the opening cell route.
On main (folded light atlas):
41adb551.VICTORY_CARD_METER_PIPELINES=1(main of Nov 29) timed the two programs:ptfx_CS_lightAtlas_Trail(c06aa62112ffba4c): 11.4 ms per binding;ptfx_CS_lightAtlas_Sprite(2561af9577c47289): 3.7 ms average and 6.4 ms at most;A third route we tried, not the fold: a local, opt-in switch that sends just these two programs to the exact wave-wide form (
widen,WidenMode::All) before the fold.Given the loop-guard bug found here, the fold may well be fine once its joins are read, which would explain the 29-92 ms on our side as well. We have not tried this branch yet, and can run the same route on it if that's useful.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by akimfomin on 2026-11-30T10:21:37Z.
@JSa25 Your timed Trail/Sprite split is useful. I backported the fold fix onto our pinned control and ran a 15-second house walk on RTX 4070 Ti SUPER, Series X native 2560×1440, full stock RT, no DLSS or FG. One run came in at 13.01 median / 12.05 average rendered FPS, around the 13.42 median of the previous tuned control. This is a different route, and the fresh branch still deferred some pipelines, so it does not settle whether your opening-cell stall is fixed. If you can run the same cell on this PR, I’d be interested in the two per-program times and whether the 29–92 ms stretch disappears without the wave-wide override.