fix(shader): folded light-atlas lane-mask joins (24/7 interior stall, #3835) #3871
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!3871
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@Still-Cam on GitHub · 2026-11-30 09:52 UTC · original
Still-Cam:fix/24-7-mesh-rest-stall→main· +302 −6 · 5 files · 2 commits · merged 2026-11-30 14:12 UTCSummary
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
@JSa25 on GitHub · 2026-11-30 10:12 UTC · original
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.
@akimfomin on GitHub · 2026-11-30 10:21 UTC · original
@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.