DirectStorage: read a page list naming page 0 again before failing its request #1725
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1726"
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?
Imported from Marvisak/VIctory. Originally posted by npanu420 on 2026-11-24T21:24:23Z.
What
A DirectStorage request into physical pages (
PAGE_DESTINATION) whose page list names page 0 is read again for up to 8 ms before the request fails.Why
The title writes a request's page list after enqueueing it, and
queue()submits a queue on its own once half of it is enqueued. A worker can then start the read before the list is filled: it names page 0, which is no page (numbers start at0x10_0000),xmem::write_physicalreturns false and the request fails withE_INVALIDARG. Nothing logs it, and the title never reads a request's result (it only polls for completion), so the model or texture is silently left unwritten.Two measurements on the same machine (RTX 3070, Windows 11, Series X profile, a world load into the first story pack):
These were taken on a branch of
fxceless/victory-gta6, whoseinto_destinationis the same code asmainhere apart from a warning line. This PR is the change rebuilt onmain(ffe310e).Changes
into_destination: ifwrite_physicalfails and the list holds a 0, the title's list is read again every 1 ms, 8 times. Recovered writes are counted and logged at powers of two (written late). A request that still fails now logs a warning instead of failing silently.a_page_list_filled_after_its_request_starts: the list is filled 2 ms after the request is submitted, and the data must arrive. It fails without the change (checked with the retries set to 0) and passes with it, repeatedly.Verification
rustfmt --checkreports 9 differences indstorage.rs, all already onmain. This change adds none.No game data is used or committed. AI-assisted (Claude Code).
🤖 Generated with Claude Code
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T21:36:43Z.
Review: COMMENTED
Static review only: this crate is Windows-only (D3D12/windows_sys/Win32) — nothing compiles or runs on macOS; source review of the diff.
DirectStorage page-list race: page 0 means 'not filled yet' (page numbers start at 0x10_0000); instead of failing the request immediately, the read retries for a few ms (LATE_LIST_TRIES × 1ms sleep), re-reads the title's list, and writes late with a power-of-two-throttled info log. Bounded retry, no unbounded wait. The 'title never looks at a request's result' justification is the kind of assumption worth a comment in the code — it is here. Windows-only.
Imported from Marvisak/VIctory. Originally posted by acetonahard-code on 2026-11-24T22:08:35Z.
Tested on Windows 11 with the repo toolchain, merged into current
main(70564ae):cargo test -p victory-hlemainmain+ this PRcargo clippy --all-targets -- -D warnings, with and without--all-features: clean.I didn't test with game data.
Tested locally with an AI-assisted script (Claude Code); I checked the results before posting.
Imported from Marvisak/VIctory. Originally posted by kais7654 on 2026-11-24T22:50:21Z.
Reviewed and verified: the late-fill test passes and all 14 dstorage
tests stay green on Windows — a list naming page 0 written while the
request runs is caught and applied once the title fills it. One note:
each late request sleeps on its worker thread for up to 8 ms before
failing; fine at these rates, worth revisiting if a frame ever waits
on a batch of them.