DirectStorage: wait up to 250 ms for a page list the title fills late #2336
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2338"
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 JurajSimicevic on 2026-11-25T11:01:50Z.
Problem
A DirectStorage request into physical pages (
PAGE_DESTINATION) whose page list still names page 0 is read again for 8 ms (#1726) and then fails withE_INVALIDARG. The title never looks at a request's result, so each failure is a model or texture left unwritten. #2181 sees untextured geometry after such a burst.On a fast host the data is read and inflated before the title has filled the list, and 8 ms is not always enough. On this host (Windows 11, RTX 5080, NVMe), three world loads on
main940d32f, with the typed-UAV check of #1775/#1763 to boot, logged "a destination's physical pages could not be written; its request fails" 391, 45 and 24 times, each time in one burst while the world loads.What the failed requests had in common (local diagnostics, not in this PR)
Change
LATE_LIST_WAIT) instead of 8 tries of 1 ms. A list that still names page 0 after that fails as before.waited_ms).E_INVALIDARG,-2147024809) and passes with this change.crates/victory-hle/src/modules/dstorage.rsonly, +26 −6.Tested
cargo test -p victory-hle --locked: 144 passed.cargo clippy -p victory-hle --all-targets --locked -- -D warnings, with and without--all-features: clean. No new rustfmt hunks.The limit, said plainly: in both runs the race either did not happen or ended within 8 ms, which the old wait also covers. So the in-title runs show that this changes nothing for the worse. The case it fixes, lists later than 8 ms, rests on the diagnostics above and on the test. The lateness varies between runs on the same machine (likely how warm the file cache is). A run on a fast host that logs the old warning on
mainand thenwritten latewithwaited_msover 8 here would settle it.Notes
No game data attached: counts, timings and log lines only.
AI-assisted.
🤖 Generated with Claude Code
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T11:03:11Z.
Review: COMMENTED
Static review only: victory-hle is Windows-only; not tested on macOS. Replaces the fixed 8 ms retry loop with a 250 ms deadline for late DirectStorage page lists, motivated by observed 3-6.5 ms fill times — sensible; the waited_ms logging helps verify in the field.
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-25T11:11:46Z.
Independent native Windows check on
77d5d1b. I copied only the two test cases onto940d32f. The 2 ms case passed there and the 40 ms case returnedE_INVALIDARG(0x80070057). Both tests passed five consecutive runs on the exact PR head, including the physical-page byte comparison. The fullvictory-hlelibrary suite passed all 144 tests. The runs used synthetic requests and mapped pages.Imported from Marvisak/VIctory. Originally posted by JurajSimicevic on 2026-11-25T12:31:58Z.
In-title result with this PR's change: lists filled 62 to 84 ms late, all written
The PR said the in-title runs after the fix had not yet shown a list later than 8 ms. A longer run has now shown some.
Setup: RTX 5080, diag build of
main940d32fwith this PR's commit (the same diff, cherry-picked), #1762, and #1968's program A skipped so the world keeps running. One run of 15 minutes, through the prologue into the first gameplay prompts.written latelines: five, all in one burst while the world loaded. The counter logs at powers of two, so between 16 and 31 lists were filled late.waited_mson the logged ones: 62, 65, 68, 79, 84. The 8 ms wait onmainwould have failed every one of them withE_INVALIDARG.a destination's physical pages could not be written: 0.So the late lists are not limited to the 3 to 6.5 ms seen first. While the title loads they can trail the request by tens of milliseconds, and the 250 ms bound covers that with room to spare. The test's 40 ms case is still below what the title did here. I can raise it to 100 ms if you prefer a case above the longest wait seen.
No game data: log counts and timings only.
AI-assisted.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T15:23:59Z.
Automated triage for the maintainers.
This pull request no longer merges cleanly into
main(conflicts incrates/victory-hle/src/modules/dstorage.rs). It will be reviewed once it is rebased onto the currentmain. The earlier verdict (merge-candidate) was for an older state ofmain.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by JurajSimicevic on 2026-11-25T16:02:56Z.
Closing this:
eddde73onmainremoves the cause instead of waiting it out. Reads into physical pages now wait for the title's Submit, which is where the title fills the page table. It measured 0 failed and 0 late writes after the change.Our in-title numbers fit that explanation. The 62 to 84 ms lists in my comment above all came in one burst while the world loaded, which matches a queue that submits itself at half capacity before the title's Submit. A longer retry bound only matters if a list is still empty after Submit, and nothing here shows that. If it shows up later, it can come back as a small change on top of
eddde73.Thanks @andrewpozdnakov7-jpg and @catminou4 for checking it.
AI-assisted.
Pull request closed