The clustered local-light loop runs as local waves before the fold (interiors 4 fps) #3717
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!3717
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3717"
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?
@stasadance on GitHub · 2026-11-30 04:37 UTC · original
stasadance:perf/light-loop-local-waves→main· +35 −0 · 1 files · 1 commits · closed without mergingRelated: #3173, #2261
What it changes
The clustered local-light shader (
2561af9577c47289,c06aa62112ffba4c) loops over every light in its tile, so indoors, with many lights, it runs many trips. It was taking the folded wave64 form: two console lanes per host lane, 129 VGPRs, 308 KB of DXIL, spills and low occupancy. Indoors the card showed 98% busy at only 90 W and GPU time went from about 3 ms to over 200 ms a frame.Those two programs now run as local waves before the fold is tried (99 KB and 95 KB of DXIL). The loop data itself is valid: no runaway bound, no atomics.
VICTORY_LIGHT_LOOP_LOCAL=0puts back the folded form.How it was tested
cargo testpassed for the crates it touches: yes,cargo test -p victory-shader --lib(Linux host: 295 passed; the Windows-only emit tests not run). Windows clippy reports the same 4 errors as current main, none in this diff.Checked for overlap
@nikitronick-crypto on GitHub · 2026-11-30 15:13 UTC · original
Tested on Windows on a 12 GB 30-series card, where this pass was the limit indoors: RTX 3080 Ti, Ryzen 5 7500F, Series X 1440p, DLSS Balanced, FSR FG 2x. This PR's one-file change applied on
41adb551, release build, shaders translated again from an empty state for the new translator.Same interior, medians of the 5 s lines:
41adb55141adb551+ this PR2561af9577c47289/cabb87599722e59a(card meter)Both programs were bound in the run with the PR (first bind at frame 10994), so the pass runs.
cabb87599722e59ais not in this PR's list but its list is cheap now too. 0 pipelines failed, 0 shaders untranslated. Picture over an 8-minute session indoors: lamps light the walls and floor, dust shows in the light, no blocks or flicker that I could see.Caveats: one machine, one interior, the two runs were a few hours apart, and the second also had
VICTORY_STORE_BESIDE=1andVICTORY_TABLE_SAME=1on, which do not touch card time. The measured four minutes had no remote-desktop client connected. Background and the earlier numbers are in my comment on #2415 (section 3), where I had been leaving the pair out withVICTORY_LEAVE_OUT; this is the better fix.Run on my own PC; logs read and this written with an AI assistant (Claude).
@CubeB on GitHub · 2026-11-30 18:23 UTC · original
A small thing I hit when merging this into my fork: the new switch
VICTORY_LIGHT_LOOP_LOCALis read by the translator (light_loop_local()inemit/mod.rs), but it is not inKEYEDincrates/victory-gpu/src/shader_cache.rs.shader_cache::tests::every_switch_of_the_translator_is_in_the_keythen fails ("switches the translator reads that the shader cache's key leaves out: ["VICTORY_LIGHT_LOOP_LOCAL"]"), and changing the switch would reuse translations made the other way.The fix is one entry in
KEYEDplus the array length. Mine is CubeB/paradise-fork fbd3676e, next toVICTORY_WAVE_LOCAL.🤖 Generated with Claude Code
@nikitronick-crypto on GitHub · 2026-11-30 18:30 UTC · original
@CubeB Good catch on the cache key, and it applies to anyone carrying this PR in a fork.
One thing to consider before fixing it there: upstream no longer has this switch.
VICTORY_LIGHT_LOOP_LOCALis in neither v2026.11.30.01 (c71899d9) nor v2026.11.30.02 (84bd61e2).The clustered local-light pair this PR targets (2561af9577c47289 / cabb87599722e59a) was fixed
upstream another way, through #3896 / #3871 (
UNFOLDED_BY_DEFAULTwith "lightAtlas"), whichneeds no new switch and so no new entry in
KEYED.So for a fork based on current main, the simpler route is to drop this PR's change and take
upstream's fix. The
KEYEDentry is only needed if the fork stays on a base before v2026.11.30.01and keeps this PR. On my 3080 Ti, clean v2026.11.30.01 without this PR no longer lists the pair
in the card meter indoors.
Checked and written with an AI assistant (Claude).Good catch on the cache key, and it applies to anyone carrying this PR in a fork.
One thing to consider before fixing it there: upstream no longer has this switch.
VICTORY_LIGHT_LOOP_LOCALis in neither v2026.11.30.01 (c71899d9) nor v2026.11.30.02 (84bd61e2).The clustered local-light pair this PR targets (2561af9577c47289 / cabb87599722e59a) was fixed
upstream another way, through #3896 / #3871 (
UNFOLDED_BY_DEFAULTwith "lightAtlas"), whichneeds no new switch and so no new entry in
KEYED.So for a fork based on current main, the simpler route is to drop this PR's change and take
upstream's fix. The
KEYEDentry is only needed if the fork stays on a base before v2026.11.30.01and keeps this PR. On my 3080 Ti, clean v2026.11.30.01 without this PR no longer lists the pair
in the card meter indoors.
Checked and written with an AI assistant (Claude).
@VibeCodeGuy on GitHub · 2026-11-30 23:16 UTC · original · edited 2026-11-30 23:33 UTC
Offline corpus check (every shader container in a v1.0.2.1 dump: 25,699 unique programs),
maine1251c31againstmain+ this PR at1ec374d7.How:
victory translate <dump> --validate --listbuilt for each side (release, cross-built with cargo-xwin, run under Wine),VICTORY_HOST_WAVE=32, plus the four shader-cache-key settingsplaystarts with (VICTORY_EARLY_DEPTH=1,VICTORY_NAN_SCRUB=1,VICTORY_BVH_MISS=1,VICTORY_SAMPLED_MARKS=1). Validator:dxil.dllfrom DXC v1.9.2609. "Changed" compares translate'semittedhash of each module and its bindings. There was no GPU on this side, so no host pipelines were made and nothing was run on a card. Onmainthe same run has 72 failures: 71 mesh programs over the 32 KiB output limit (the known shortcut inmesh_prologue) andCS_TraceShadowRays_FullAdaptive(#2993).The two programs this targets are in the corpus. In this dump they are
ptx_prerender:ptfx_CS_lightAtlas_Sprite(2561af9577c47289) andptx_prerender:ptfx_CS_lightAtlas_Trail(c06aa62112ffba4c). Neither comes out different with this PR merged ontomaine1251c31at 32 lanes.VICTORY_WAVE_WHY=1onmain(translate shaders.rpf --warm <these two> --jobs 1, same settings as above) shows why. Both already end inWAVE64-RETRY local waves (APPROXIMATE), without early-outs: wave Some(32), not the folded form, presumably since folding went off by default (VICTORY_WAVE_FOLDED=1to opt in). So on currentmainwith 32-lane waves this looks like a no-op. The 64-lane case the description tested was not checked here.Edit: the reason is #3896 (merged today, "run the particle light atlas programs as local waves, not folded"). It already does this for the same two programs.
@stasadance on GitHub · 2026-12-01 02:13 UTC · original
Closing this: main now covers these programs through #3896 / #3871 (
UNFOLDED_BY_DEFAULT = ["lightAtlas"]inemit/mod.rs), with no new switch and no cache-key entry. Thanks @nikitronick-crypto for the 3080 Ti numbers and @CubeB for catching the missingKEYEDentry. Any fork still carrying this on a base before v2026.11.30.01 needs that entry, or should take main's fix instead.Pull request closed