VICTORY_FRONT_SIFT / VICTORY_FLUSH_SIFT: a span dropped before the write-watch asking may miss a write that lands before the copy (found by reading, not seen in play) #3240
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#3240
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@CuteBooty on GitHub · 2026-11-29 20:57 UTC · original
Not seen in play. No build or test was run for this. It was found by reading the source at main
829188e96, and the reading has not been checked by anyone else. Treat it as a question for the authors of #1760 and #1761 (merged as4e42a1d8eandc2aaf907f).Where
crates/victory-gpu/src/host.rsat829188e96:Batch::refresh_front(about line 12434):sift_frontruns whenVICTORY_FRONT_SIFT=1, with more than 256 spans and no shadow batch.Batch::flush_all(about line 12662):sift_refreshesruns whenVICTORY_FLUSH_SIFT=1and there are more than 256 refreshes.Both switches are still off by default.
The sequence
Shadow::nothing_newon every span, on all threads, beforecrate::watch::ask_ahead. A span that looks clean is removed.refresh_frontevery span was already put inself.aheadbefore the sift, soBatch::addskips any later refresh of that range in the same submission. The removed span is not looked at again.crate::watch::owner_wroteafter its bytes are in. Its comment says a copy that began earlier "finds the pages written since". If the note is published after step 1 but before the copy would have run, nothing finds it.nothing_newafterask_ahead, next to the copy. They see the newer note and copy. With the sift, the GPU reads the older shadow bytes for this submission.Main's default front path
Since
acc6df7d4(PR #1133),refresh_frontalso drops clean spans beforeask_aheadwhenVICTORY_FRONT_SIFTis off, on one thread instead of all. So at829188e96the front sift does not change when a span is checked. If the sequence above is real, the default front path has it too. OnlyVICTORY_FLUSH_SIFTmoves the check earlier than the default path does (more than 256 refreshes).Suggested fix
ask_ahead, if it has moved, runnothing_newagain on the dropped spans whose pages were noted since, and put back any that now have something to copy. This costs nothing when no write came in meanwhile.ask_ahead, in the workers, asflush_alldoes without the switch.owner_wrotebehind a barrier between the sift and the copy, then check the shadow bytes. The existing sift tests use fixed stamps, so they pass with this gap.Limits
This is a race window between threads, found by reading. Whether the title writes owned memory in that window in play is not known. The more-than-256 case comes up at heap-sized flushes, about once a frame.
Hardware where this was read against: RTX 3070 8 GB, Ryzen 7 5800X3D, 32 GB, Windows 11 26200, driver 621.24 (no run was made for this report).
@github-actions[bot] on GitHub · 2026-11-29 20:57 UTC · original
Please attach both logs from the run that went wrong. Without them we can only guess. Paste
%LOCALAPPDATA%into the address bar of File Explorer to get there.%LOCALAPPDATA%\victory\logs\: the newestvictory-nvidia-play-<date>-<time>-<number>.log(fromvictory.exe) orvictory-nvidia-<date>-<time>.log(from the script launcher). The window shows its path at the start, on the lineLog: ....%LOCALAPPDATA%\VIctory\data\7952987A\crashes.log, and, if there is one from that run, the newestvictory-<date>-<time>-<number>.crash.login%LOCALAPPDATA%\VIctory\data\7952987A\temp\.Also say which GPU, Windows version (10 or 11)