fix(victory): carry DirectStorage page-array snapshots per request to prevent leaks and stale-wait desync #293
No reviewers
Labels
No labels
accessibility
bloqué : binaire console
bug
chargeur
console-dll
cpu
documentation
duplicate
enhancement
good first issue
gpu
help wanted
invalid
performance
question
runtime-gdk
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LooperSalty--AnyXboxX!293
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-293"
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?
@mauroalvare on GitHub · 2026-11-26 01:29 UTC · original
mauroalvare:fix/victory-dstorage-enqueued-pages→main· +129 −41 · 1 files · 2 commits · closed without merging## Change
In
third_party/victory/crates/victory-hle/src/modules/dstorage.rs,enqueue_requestsnapshottedPAGE_DESTINATIONpage arrays into a globalHashMap<usize, VecDeque<Vec<usize>>>(ENQUEUED) keyed by array address, and only popped an entry insidefilled()(called frominto_destination()).Whenever a
PAGE_DESTINATIONrequest never reachedinto_destination()— for example:close_laneclearsunsubmittedandreads), orinto_destination()(such asEND_OF_FILE/read_sourcefailure,E_INVALIDARG,E_NOTIMPL, or a zlib stage before BCPack) —its snapshot stayed at the head of
ENQUEUED[array]indefinitely:Vec<usize>inENQUEUED.ENQUEUED[array]by +1 for every subsequent request reusing that page-array slot. When a later request is enqueued while the slot still holds stale page numbers from its last run and the title fills the new page numbers asynchronously after enqueue,filled()pops the mismatched stale snapshot from the failed/closed request, skips the stale-array wait, and silently overwrites the previous texture/model's physical pages instead of the new destination pages.This change removes the global
ENQUEUEDmap and carries each request'sOption<Vec<usize>>enqueue-time snapshot directly onCommand::Read,Lane::reads, andJob, passing it throughexecute()→into_destination()→filled(). Closed/failed requests drop their snapshot automatically, stale-array detection stays synchronized per request, and globalENQUEUEDmutex contention is eliminated.Verification
Base SHA:
c4c93bdc413191a9dc909998d2d53080a3f0c880Host: Windows x64, Ryzen 7 9700X, RTX 5070 Ti, Rust
1.98.1.Commands run from
third_party/victory:Note: Python tests (
pytest/ruff) were not modified because this PR only touchesthird_party/victory.Oracle and test data
modules::dstorage::tests::failed_or_closed_page_requests_do_not_desync_late_page_array_wait) built fromxmem::XMemAllocatePhysicalPagesand a temporary file.c4c93bd): fails withstale page 'pages_a' must not be overwritten(left: [192, 199, 206, ...],right: [0, 7, 14, ...]), confirming the later request popped a stale snapshot from the closed/failed requests and silently overwrotepages_ainstead of waiting forpages_c.Checklist
E_NOTIMPL), never a fake success.Made with AI assistance (Antigravity / Gemini).
@mauroalvare on GitHub · 2026-11-26 23:31 UTC · original
Closing after #454. The Neptune fix moved snapshots out of a global queue keyed by page-list address so that a failed or closed request could not leave snapshots for the next request. Vice-Tay has no such queue. It keeps trace information on the request itself and reads the current physical page list when the request runs. The 18 runnable DirectStorage tests passed on the new base.
Pull request closed