Faces with only eyes and teeth: the face programs are exempt from VICTORY_LDS_BOUNDS #938
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!938
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-938"
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?
@Victorywillbeours222 on GitHub · 2026-11-28 09:27 UTC · original
Victorywillbeours222:lds-face-exempt-nvidia→main· +58 −2 · 3 files · 1 commits · merged 2026-11-28 19:39 UTCFixes the faces drawn as floating eyes and teeth (#100, #586).
Cause
VICTORY_LDS_BOUNDShas been on by default since64d4931b. With it, a shared-memory access pastLDS_SIZEin the program's header reads 0, and a write there is dropped. The game's face network does not stay inside that size:compute_graph_opsprograms (the matrix products, dot products and reductions);ped_morphable_model_cs,ped_standard_head_cs).Both use shared memory past the size in their headers. Held to that size, their results are zeros, so the skin of the head is not drawn and only the eyes and teeth are left.
slot=0x218does not decide it: that warning is logged in runs with the faces drawn too. The defaultVICTORY_LEAVE_OUT(02384a60fda6f2d0,731a39171b568298) does not decide it here either. All the runs below had it, and only the bounds changed between them.Change
compute_graph_opsprograms and the two normal programs. They are named by the first 16 hex digits of the container's BLAKE3, as run logs name shaders.VICTORY_LDS_BOUNDS_EXEMPT=<hash>[,<hash>..]replaces the list.VICTORY_LDS_BOUNDS_EXEMPT=0exempts none, which is the bounds as they are now.host_shaderpasses the container's hash to the translator throughemit::with_program, a thread-local. That is the only place it is needed.Tested
RTX 5080 with a Ryzen 7 5800X, Series X profile, 1440p with DLSS Quality. Each run is a scripted 10-minute walk through the opening: the interview, the store flashback and the street. The shaders were translated again and the used pipelines warmed before each run.
64d4931bmerged into Kemerd's main)VICTORY_LDS_BOUNDS=0VICTORY_LDS_BOUNDS=0brings the faces back too, but switching the bounds off everywhere costs the card a lot of time. Exempting only the programs that need it keeps the speed.Clippy (both CI steps, toolchain 1.98.1) finds nothing in the lines this changes. On this main it already stops on three lints elsewhere:
descriptor.rs:1234andshadow.rs:1708(is_multiple_of), andemit/mod.rs:2768(let_and_return, test build).@Yuanzer on GitHub · 2026-11-28 15:34 UTC · original
I reviewed the exemption path and found two concrete isolation issues worth fixing before merge. The default 25-hash list itself is not affected, so these concern the override API and panic behavior.
The documented 16-digit key is matched as an arbitrary prefix.
lds_bounds_exempt()usesp.starts_with(h.as_str()), while the comment says the setting is<16 hex digits>. A value such asVICTORY_LDS_BOUNDS_EXEMPT=atherefore exempts every program whose hash starts witha, even though it is not a valid program name. That can silently remove the bounds from many more shaders and reintroduce the very LDS/performance problem this PR avoids. Please validate each entry as exactly 16 ASCII hex digits and compare withp == h(after normalizing case), then add tests that an exact hash matches while a shorter prefix does not.with_programdoes not restore state iffunwinds, and it breaks if calls are nested. It clones the new hash, callsf(), and only then clears the thread-local. If translation panics orwith_programis used recursively, the outer value is lost and the stale value can remain on a reused worker. A small RAII guard that saves the previous value and restores it onDrop, or an equivalenttry/finallystructure, would preserve the current API without allocation beyond the saved state. A nested-call test and acatch_unwindrestoration test would pin that down.These are both small changes and do not alter the measured face fix.