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!1590
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1590"
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?
@kibagami-nc on GitHub · 2026-11-28 21:59 UTC · original
kibagami-nc:fix/lds-write-only-last-resort→main· +168 −6 · 3 files · 1 commits · closed without mergingFixes #1435 (AiToR51's bisect: since #43, eight compute programs of the game no longer translate on 32-lane hosts, and their dispatches are dropped). It also takes the three ray-tracing structure builder programs of #1475.
Confirmed on the game's programs (details in "Tested by others" below):
VICTORY_LDS_WRITE_ONLY_OK=1, where main translates 1.What happens
Before #43,
lds_meetingsrefused a lane-branch region (one not every lane runs) only when it both read and wrote LDS. A region that only wrote, or only did atomics, was taken:#43 replaced that with
lds::analyze, which wants a proof for those regions: disjoint constant ranges on one base, or lane-private slots. Without one it refuses (unproven LDS writes in one lane-branch region, and the like). The old shortcut is behindVICTORY_LDS_WRITE_ONLY_OK=1, off by default.After a refusal, the lowering asks for 64 lanes, and
emittries its other forms: without early-outs, without skips, local waves, the approximate local waves. A plainifis taken by "without skips". But a region inside a per-lane loop stays where it is, so nothing takes the program on 32-lane waves. It is refused withno wave32 lowering for this wave64 program, the line #1435 shows for all eight hashes.The change
lds::analyzenotes when it refuses a region the write-only shortcut would have taken (take_shortcut_refusal).emitthen tries the program once more with the shortcut on (with_last_resort), when:VICTORY_LDS_WRITE_ONLY_OKis unset.VICTORY_WAVE_WHY=1, a program taken this way printsLDS-WRITE-ONLY last resort: the program translates only with the write-only shortcut.The proofs are still tried first, for every program. The shortcut's risk is two writes from both halves to one dword, landing in an order the console doesn't have. That risk is taken only where the alternative is a dropped dispatch. Before #43 it was taken for every such region.
VICTORY_LDS_WRITE_ONLY_OK=0keeps the proofs alone.=1still has the shortcut on from the start.The shader cache key already holds
VICTORY_LDS_WRITE_ONLY_OK, and the translator's own hash changes with this, so cached translations are made again once.Beside #1450, #1575 and #1504
Three open PRs bring these programs back. They differ in which programs get the shortcut:
This PR is #1450's mechanism without the list, so a program not yet named is covered too. Unlike #1575, it leaves the proofs' outcome alone wherever it translates: a program another form takes keeps that form.
#1575's measurement is also the confirmation that was missing here: on a 32-lane host, the shortcut brings back the programs #43 made refused.
Tests
emit::lds_loop_tests::a_shared_write_in_a_lane_loop_is_taken_by_the_last_resort. The program: 64 threads, wave64. Each lane goes round a per-lane loop writing one shared dword, then reads the dword of lanet ^ 63, in the other host wave. WithVICTORY_WAVE_WHY=1:unproven LDS writes in one lane-branch region. Every other form stays at 64 lanes (local wavesSome(64), approximate local wavesSome(64)), so the program is refused:no wave32 lowering for this wave64 program.cargo test -p victory-shader --locked: 349 passed, 8 ignored, the new test included.--all-targets, default and--all-features): nothing new. Main's own findings are the same with and without this PR.Tested by others
AiToR51 (RTX 3080, 32 lanes, Windows 10). Empty cache for every run,
VICTORY_HOST_WAVE=32, #1435's ten hashes:d4b5d517d4b5d517VICTORY_LDS_WRITE_ONLY_OK=18e0e35368e0e3536VICTORY_LDS_WRITE_ONLY_OK=0Hash by hash on this PR, with
VICTORY_WAVE_WHY=1:LDS-WRITE-ONLY last resort: the tree culling passes and three more;caf96a32…already translates on main;6871d6e4…and6b82bc7d…stay refused, as they were before #43. #348 is the PR for those.unueberlegt, on the title's own files (v1.0.2.1), on this branch: ten programs, including the four
CS_Tree_BatchCull_*,CS_Classification_Water,CS_VarianceFilterAlphaand twoXboxBvhBuilder.dllkernels.LDS-WRITE-ONLY last resortappears 9 times.CS_Tree_BatchCull→46738758aa9b0c76). So the last try gives exactly the programs the pre-#43 default gave.What the dropped programs cost in game. icdmkg2 (#1435) ran an RTX 5060 Laptop GPU, Series S, the same save, by script:
923e38c: 9.3 fps median, with the submitting thread at 86 ms a frame preparing;icdmkg2, in game on this PR, the same laptop, script and save. Both builds are on
d4b5d51and differ only in the fix; medians over 60 s, runs alternated:d4b5d51with #43 reverted923e38cThis PR recovers the same as the revert, within this machine's run-to-run noise (about ±1.5 fps). Hailey-Ross reports that #1450, which retries some of these kernels, brings back the trees and bushes main leaves missing.
#1475, the ray-tracing structure builder (AiToR51, RTX 3080). Its three programs in
XboxBvhBuilder.dll(e63d22c4…,28918b71…,caa78b8c…) translate on this PR: 0 of 3 on main, 3 of 3 here, each printingLDS-WRITE-ONLY last resort, as withVICTORY_LDS_WRITE_ONLY_OK=1. Only the translation was checked; the builder wasn't run in game.bchamberlin23 (RTX 5070 Ti, Windows 11, diagnostics builds), on the title's own programs captured with
VICTORY_SHADER_SAVE. Nine of #1435's ten hashes were in the capture:=0, the result is main's again.6b82bc7d…stays refused, as before #43. The frame rate was the same (17 fps, a PCIe-limited PC), and both runs exited cleanly.No game files, dumps or extracted data are included.
@unueberlegt on GitHub · 2026-11-28 22:38 UTC · original
Ran the check you asked for, on your branch (
8e0e353), against the title's v1.0.2.1 files withVICTORY_HOST_MAX_WAVE=32:victory translate --list --jobs 8 <dump>withVICTORY_TRANSLATE_ONLYon the program hashes — the fourCS_Tree_BatchCull_*,CS_VarianceFilterAlpha,CS_ProjDecalReduceClassification_Scalarized,CS_Classification_Water,CS_CollisionRaytraced, and the twoXboxBvhBuilder.dllkernels (28918b7150a7aad5,caa78b8ca62bc3d6, which sit in the DLL, not inshaders.rpf):VICTORY_WAVE_WHY=1printsLDS-WRITE-ONLY last resort9× across the attempts, as you said it would;CS_Tree_BatchCull→46738758aa9b0c76,_ImposterOnly→28b364d01f2a57d2) — the last-resort route produces the same modules the pre-#43 default did.For scale, on a build with the shortcut simply default-on (same programs, RTX 5070, in game): trees and bushes stand from a distance and the whole session's log holds 1 wave64 refusal (the
CS_CollectTriangles_Meshletsbaseline failer). So both routes bring the programs back; the difference is which one runs when the proofs could have taken a better form.@kibagami-nc on GitHub · 2026-11-28 23:00 UTC · original
@unueberlegt, thank you. The bit-for-bit match with the shortcut's output is the strongest check this PR could get: the last try gives exactly the programs the pre-#43 default gave. It's in the description now, with AiToR51's table from #1435.
The difference from #1575, as you put it, is which form runs where the proofs could have taken a better one. On these ten, there's none: they're the same modules.
Shaders: the LDS write-only shortcut as emit's last resort, for programs the proofs leave at 64 lanes (#1435)to Shaders: the LDS write-only shortcut as emit's last resort, for programs the proofs leave at 64 lanes (#1435, #1475)@bchamberlin23 on GitHub · 2026-11-28 23:45 UTC · original
Tested #1590 (
8e0e353) againstmain(d4b5d51) on an RTX 5070 Ti 16 GB (32 lanes, driver 617.14), Ryzen 9 9950X3D, 64 GB, Windows 11 Pro 26200. Diag builds, title build 1.0.2.1.Offline, on the title's own programs. I captured them with
VICTORY_SHADER_SAVEduring a run, then ranVICTORY_HOST_WAVE=32 victory translate --warm hashes.txt <capture>on #1435's ten hashes with an empty cache each time. 9 of the 10 were in my capture;6871d6e4b3ac9a10wasn't.mainVICTORY_LDS_WRITE_ONLY_OK=0In game. Series X 1440p, DLSS Performance, DLSS frame generation, same save, open world. Each run is short, about 30 to 45 s in the world.
mainrefused 8 programs (0e366d15868e17bd 1f1fbd86759b3da2 21f7ad7863620328 55679a0547649d0b 5964b734c70b91eb 6b82bc7d22016cb5 7c9a6a83826cdfac 89d08e561897d4e5). It logged about 1.4 dropped compute dispatches per frame for them.6b82bc7d22016cb5, and logged no dropped dispatches for these programs.About
6b82bc7d22016cb5. A local port of Vice-Tay's loose-LDS fallback (Vice-Tay #29, the approximate last-resort retry) does translate it on this card, through "loose LDS + local waves (any mask)". That might be useful for #822 or #348. It's approximate, though, so for the other 8 I'd keep #1590's route, the existing write-only shortcut.AI-assisted (Claude Code).
@kibagami-nc on GitHub · 2026-11-29 00:26 UTC · original
Closing: main has this now, the maintainer's way.
33027354adds the same last try, only for a program that would otherwise be dropped, and9f628a0eturns it off by default asVICTORY_LDS_LAST_RESORT=1, keyed in the shader cache.24556e2balso gives the trees' culling passes their own wave-wide form, so the frame-rate gain icdmkg2 measured shouldn't need the shortcut any more.Thanks to AiToR51, unueberlegt, icdmkg2 and bchamberlin23 for the runs. They're in this PR's description, for whoever takes on #1435's correct wave32 form for the remaining programs.
Pull request closed