Shaders: LDS bounds and looped LDS atomics as the console does them (cloud tile sort, port of foxhound 9f8838b) #104
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/104"
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 ballsimulation on 2026-11-27T18:09:51Z.
Port of the shader half of foxhound 9f8838b ("cloud tile sort fix"). It was not in this tree or in any open PR. Both changes concern
CS_SortRayTiles, the cloud pass's sort of its ray tiles (256 threads a group), on 32-lane hosts:VICTORY_LDS_BOUNDS=0turns it off): outside a program's own shared memory, reads give 0 and writes are dropped, as on the console. Without this, the host's group-shared memory past the program's dwords is undefined. In the sort, 31 of the 32 groups dispatched clear and read up to 32 KiB past their 2.5 KiB.VICTORY_LDS_LOOP_ATOMICS=0turns it off): LDS atomics in a loop with nothing but atomics leading in get no meeting of the host waves. A host wave that takes fewer rounds otherwise waits at the barrier behind the loop while the others wait inside it. The first then reads counts the others have not written yet, and tiles drop out of the sorted list. foxhound saw 971 of 1,068 tiles kept, and a tile out of the list shows as an 8x4 square of clear sky in a cloud.The violet-probe filter from the same commit is already in this tree (
826ba15). The rest of that commit (launcher, samplers, bcpack) is left out; static sampler order is #69.Checked (RTX 4070, driver 610.74): applies on current
mainwith one hunk placed by hand (lds_bounds()besideneeds_every_lane);cargo test -p victory-shaderandcargo clippy -p victory-shader --all-targets -- -D warningspass; played in a build with it for about 30 minutes with no device loss.Not checked by me: the clouds themselves. foxhound's evidence is captures cloud3/cloud4 on an RTX 4070 SUPER. A daytime look at the sky after a camera cut, with and without it, would settle it.
🤖 Generated with Claude Code
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by wasonidas on 2026-11-27T19:22:33Z.
A measurement that may help, since the description says the clouds themselves were not checked. We ran our own port of the same foxhound commit (9f8838b) on an RTX 5080 (driver 621.24, 32-lane waves): Series X profile, 2560x1440, DLSS Quality, no frame generation, diagnostics build, a 300 s unattended run outdoors (the prologue, then the boat ride), its captures reviewed by eye against a run of the build before.
Two differences from this PR to keep in mind:
VICTORY_LDS_BOUNDSis off unless asked for (it changes 480 programs on this profile), so the figures above say nothing about the bounds half, which this PR turns on by default. With bounds off, the change reachedCS_SortRayTilesalone, as the description says.VICTORY_LDS_LOOP_ATOMICSandVICTORY_LDS_BOUNDSto the switches listed inbuild()incrates/victory-gpu/src/shader_cache.rs(whereVICTORY_THREAD_TICKETis). As far as I can see this PR does not touch that file, so=0on a filled shader cache would still be served the translations made with the switch on. Worth a look before anyone does the with/without comparison on one cache folder.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by ballsimulation on 2026-11-28T12:47:01Z.
Closing this PR: main now has both halves.
64d4931baddedVICTORY_LDS_BOUNDSandVICTORY_LDS_LOOP_ATOMICS, both on by default, and put both switches in the shader cache's key inshader_cache.rs. That also takes care of the cache point @wasonidas raised. Thanks for the cloud measurement.Pull request closed