Repository navigation
DirectStorage: a destination page number the title has not written yet is read again, not failed at once - #855
PiloteCode wants to merge 7 commits into
Conversation
…s-only count `cargo clippy --workspace --all-targets -- -D warnings` (CI) fails on 9376fd6 with this toolchain: unnecessary_sort_by in draw.rs, the bench's depth_written in indirect.rs never read, and placed_filler_twins unused without the diagnostics feature. No code changes.
…t is read again, not failed at once The title may fill a request's page numbers after it enqueued the request, and a queue submits on its own once half full, so a worker can take the request first. An unknown page failed the request at once, and its model or texture kept whatever its pages held (the title never reads a request's result): 302 requests of one burst at the opening's loading in one run, 44 and 9 in others (RTX 5090). The page numbers are now read as the title has them (volatile, each time, not kept as a slice). One not known after the decode is read again for up to 250 ms (15 yields, then 1 ms sleeps); the retries of the write (VICTORY_DSTORAGE_RETRIES) read them again before each try. In a run, a number was known 17 us later, and no request failed. Requests that waited are counted in the lanes' line (destination_waits); the first wait that ends with every number known is logged once. A request that still fails says why in one warning: a page number unknown, or pages the host could not map.
… instead of failing streaming requests
…d VICTORY_SKIP_WC_COMPARE water-physics caveat
|
Test report on real hardware: AMD RX 6950 XT (RDNA2), Windows 11, Rust 1.98.1, with a GPU present. I merged this PR's head AI-assisted (Claude Code); no game data. |
|
@MamaLeVrai Thanks for the build and test run on an RX 6950 XT. It confirms that the branch merges into The clippy failures you saw on
#854 starts with the same commit. For the effect in the title: on our RTX 5090 test machine, 302, 44 and 9 requests failed in three runs of the opening's loading before the change, and none after. If you run the title with it, any build logs:
A diagnostics build with |
…held for the title's Submit, beside the wait for late page numbers One conflict, in crates/victory-hle/src/modules/dstorage.rs: each side added a static after into_destination (DESTINATION_WAITS here, AUTO_SUBMITS upstream). Both are kept. Upstream's 79cfdd9 leaves the reads into physical pages out when a half-full queue submits itself, until the title's Submit (Lanes::submit_as), and starts them before it only where a full queue would otherwise never empty. It does not touch into_destination: the page numbers are still read volatile each time, read again for up to 250 ms where one is unknown, and read again before each retry of the write.
…rt, an if joined to its let, counts tested with is_multiple_of) `cargo clippy --workspace --all-targets --locked -- -D warnings` fails on 085ee7c with the pinned toolchain (1.98.1), after the two fixes before this one too: map_entry in fpsbox.rs, collapsible_if in pipeline/library.rs, manual_is_multiple_of in queue.rs and shadow.rs, and with --all-features in draw.rs and watch.rs (twice). No change of behaviour.
…d the reads held for Submit, and a test of a number written after its read started Since upstream's 79cfdd9, a queue that submits itself half full leaves its reads into physical pages for the title's Submit. The wait in into_destination is then reached only by a read that starts before the title wrote its numbers: a full queue's held reads. Its note and the README line said that a half-full queue's own submission brought a worker to the request first. Both now say where that still happens, and that the failures they count were measured before reads were held. The test submits a read whose list holds no page number yet and writes the number 20 ms later: the request succeeds and the page holds its bytes. No change of behaviour.
|
Merged The conflict. One, in What
The numbers in the description (302, 44 and 9 failed requests before, none after) were measured before 79cfdd9. What this PR changes in the title on top of the hold has not been measured: the merged branch has not run in the title. Added after the merge:
Checked, the branch as it is (
|
|
Closing this one: on today's
If failed destinations show up again (the warning "a destination's physical pages could not be written", or "a full queue's reads into physical pages start before the title's Submit"), we will come back with a log. |
Based on
9376fd6. It changes one file ofvictory-hle(modules/dstorage.rs) and adds a README line.What was wrong
A request to a destination of physical pages carries an array of page numbers, one per 64 KiB. The title may fill that array after it has enqueued the request. A queue also submits on its own once it is half full, so a worker can take the request before the numbers are there. Until now, an unknown page number failed the request at once. The title never reads a request's result (it only polls for completion), so the model or texture kept whatever its pages held.
Measured at the opening's loading on an RTX 5090: 302 requests of one burst failed this way in one run, and 44 and 9 in two other runs.
What changes (
into_destination)VICTORY_DSTORAGE_RETRIES, 12 tries, about 0.9 s) read the numbers again before each try.destination_waits). The first wait that ends with every number known is logged once, with the tries and microseconds it took. When a request still fails, one warning now says why: a page number is unknown, or the host could not map the pages. It also gives the first page number, the tries, and the totals given up and recovered on a retry. This one warning replaces two.Measured
RTX 5090, the opening's loading and the first minutes after it:
Switches
VICTORY_DSTORAGE_RETRIES=0: as before, no retry of the write. The wait for page numbers has no switch of its own: it only runs where the request would otherwise fail.Tested
RTX 5090, Intel i9-14900KF, Windows 11. The branch was checked as it is, on
9376fd6:cargo test -p victory-hle: 98 + 1 passed, none failed.cargo clippy --workspace --all-targets --locked -- -D warnings, and the same with--all-features: clean. The first commit fixes the three lints that make CI fail on9376fd6; the shader and GPU PRs start with the same commit.cargo build --release -p victory,cargo build --profile diag -p victory --features diagnosticsandcargo xtask policypass.No unit test: the race needs the title's own queue.
Overlaps with open pull requests
#816 (
VICTORY_DSTORAGE_ZERO_FAILED) and #836 (decode intermediates) touch the same file, for other failures.Not tested
Other GPUs, the Series S profile, Linux/Proton.