DirectStorage: read a page list naming page 0 again before failing its request #1726
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1726
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1726/head"
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?
@npanu420 on GitHub · 2026-11-24 21:24 UTC · original
npanu420:dstorage/late-page-lists→main· +84 −3 · 1 files · 1 commits · merged 2026-11-25 00:18 UTCWhat
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
@acetonahard-code on GitHub · 2026-11-24 22:08 UTC · original
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.
@kais7654 on GitHub · 2026-11-24 22:50 UTC · original
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.