Slot eviction: a slot another thread is making is not waited for (a freeze with the sampled marks) #1557
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!1557
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1557"
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?
@Amar-D3V on GitHub · 2026-11-28 21:43 UTC · original
Amar-D3V:fix/slot-evict-deadlock→main· +39 −12 · 3 files · 1 commits · merged 2026-11-29 08:16 UTCRelated: #846 (one way to get its stall and the watchdog crash), #1425, #807
What it changes
Slot eviction (
resource::slot_evict) holds the table of textures (textures()) while it puts each slot back to null, andtexture_slot_evictedwaited for the slot's lock. A thread making a slot takes the same locks the other way round, the table last:mirror_innerholds the slot's lock, thenbegun_before→texture_at(PLACED_TEXTURES) →create_at_address→hand_out_resource(textures()). So the two can wait for each other forever:That is the stack dump (
VICTORY_STACKS, symbolized with the diag build's PDB) taken 25 s into a freeze. About 30 s after the frames stopped, the title's own hang watchdog ended the process with the write to 0 at+0x23cf683that #846 describes.The slot's lock is now only tried there (
Made::try_lock). A slot that another thread is making at that moment is in use, so it is not one to let go:evict_slotsreports it, andslot_evictkeeps that texture's host copy and goes through its existing "used meanwhile" branch, which makes the slots it already put back again before the next submission.It is rare without the sampled marks, because eviction then takes few slots. With
VICTORY_SAMPLED_MARKS=1 VICTORY_SAMPLED_EVICT=1it takes many (82,972 slots in nine minutes here), and it froze in both runs with them.How it was tested
cargo test -p victory-gpupassed (550 passed, 43 ignored). Clippy reports nothing in the changed lines;main's own findings elsewhere are unchanged.Checked for overlap
VICTORY_SAMPLED_MARKSto the shader cache key, which this needed too, so it is not repeated here), #972 and #943 (eviction's log lines).