DirectStorage: Close completes what was submitted #430

Open
github-bot wants to merge 1 commit from github-bot/gh-430 into main AGit
Owner

@⁠marquezinii on GitHub · 2026-11-24 03:15 UTC · original
marquezinii:fix/dstorage-close-completes-submitted → main · +30 −8 · 1 files · 1 commits · open

IDStorageQueueX::Close "blocks until all enqueued requests either complete or fail. After the method returns, the queue will no longer complete any more requests, even if some are submitted." close_lane instead cleared the lane's submitted reads that had not started and all of its pending status entries, then waited only for the reads already running. A status entry behind a dropped read stayed E_PENDING for good, so a title polling IsComplete after Close would spin forever. Grand Theft Auto VI calls Close on its queues (the comment on close says so).

close_lane now drops only what was enqueued but never submitted (so a_closed_queue_completes_nothing still holds) and waits until the lane has no reads left, none running and no status entry unwritten. The workers already take reads from a closed lane and finish flushes its statuses, so nothing else changes.

Tested with a new test that submits 32 reads of 256 KiB and a status entry, then closes the queue at once: before the change the status was still E_PENDING after Close (3 of 3 runs); now it is S_OK and the destination holds the whole file (3 of 3). cargo test -p victory-hle passes and clippy reports nothing new.

#234 also touches close_lane (its counters), so one of the two may need a small rebase.

https://learn.microsoft.com/gaming/gdk/docs/reference/system/dstorage/interfaces/idstoragequeuex/methods/idstoragequeuex_close

**@⁠marquezinii** on GitHub · 2026-11-24 03:15 UTC · [original](https://github.com/Marvisak/VIctory/pull/430) `marquezinii:fix/dstorage-close-completes-submitted` → `main` · +30 −8 · 1 files · 1 commits · open `IDStorageQueueX::Close` "blocks until all enqueued requests either complete or fail. After the method returns, the queue will no longer complete any more requests, even if some are submitted." `close_lane` instead cleared the lane's submitted reads that had not started and all of its pending status entries, then waited only for the reads already running. A status entry behind a dropped read stayed `E_PENDING` for good, so a title polling `IsComplete` after `Close` would spin forever. Grand Theft Auto VI calls `Close` on its queues (the comment on `close` says so). `close_lane` now drops only what was enqueued but never submitted (so `a_closed_queue_completes_nothing` still holds) and waits until the lane has no reads left, none running and no status entry unwritten. The workers already take reads from a closed lane and `finish` flushes its statuses, so nothing else changes. Tested with a new test that submits 32 reads of 256 KiB and a status entry, then closes the queue at once: before the change the status was still `E_PENDING` after `Close` (3 of 3 runs); now it is `S_OK` and the destination holds the whole file (3 of 3). `cargo test -p victory-hle` passes and clippy reports nothing new. #234 also touches `close_lane` (its counters), so one of the two may need a small rebase. https://learn.microsoft.com/gaming/gdk/docs/reference/system/dstorage/interfaces/idstoragequeuex/methods/idstoragequeuex_close
IDStorageQueueX::Close blocks until all enqueued requests complete or
fail. close_lane dropped submitted reads that had not started and every
pending status entry, and waited only for the reads already running, so
a title polling a status entry after Close waited forever. Requests
enqueued but never submitted are still dropped.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:03:38 +00:00
Author
Owner

@⁠DaviTostes on GitHub · 2026-11-24 03:33 UTC · original

Verified 129d289 on Arch Linux x86_64 with the Windows build under Wine 11.22 (cargo xwin, x86_64-pc-windows-msvc, release, rustc 1.98.1):

  • victory-hle: 86 passed, 1 failed. The only failure is modules::net::tests::only_loopback_is_reachable — the known Wine WSAConnectByList environment gap (#217), unrelated.
  • The new closing_a_queue_completes_what_was_submitted passes (with the Wine GetTempPath2W fixme in its output).

Not covered: a real title queue at close, and throughput/latency effects (no game data here).

**@⁠DaviTostes** on GitHub · 2026-11-24 03:33 UTC · [original](https://github.com/Marvisak/VIctory/pull/430#issuecomment-7121214573) Verified `129d289` on **Arch Linux x86_64** with the Windows build under **Wine 11.22** (`cargo xwin`, `x86_64-pc-windows-msvc`, release, rustc 1.98.1): - `victory-hle`: **86 passed, 1 failed**. The only failure is `modules::net::tests::only_loopback_is_reachable` — the known Wine `WSAConnectByList` environment gap (#217), unrelated. - The new `closing_a_queue_completes_what_was_submitted` passes (with the Wine `GetTempPath2W` fixme in its output). Not covered: a real title queue at close, and throughput/latency effects (no game data here).
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:29 UTC · original · edited 2026-11-25 15:56 UTC

Automated triage for the maintainers.

This pull request no longer merges cleanly into main (conflicts in crates/victory-hle/src/modules/dstorage.rs). It will be reviewed once it is rebased onto the current main. The earlier verdict (merge-candidate) was for an older state of main.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 00:29 UTC · [original](https://github.com/Marvisak/VIctory/pull/430#issuecomment-7148567189) · edited 2026-11-25 15:56 UTC <!-- victory-triage v1 head=129d2897c43fed991ffb1160b49e85a6b1a1aba0 verdict=needs-rebase at=2026-11-25T15:56:30Z --> Automated triage for the maintainers. This pull request no longer merges cleanly into `main` (conflicts in `crates/victory-hle/src/modules/dstorage.rs`). It will be reviewed once it is rebased onto the current `main`. The earlier verdict (merge-candidate) was for an older state of `main`. --- _Generated by [Claude Code](https://claude.ai/code)_
This pull request has changes conflicting with the target branch.
  • crates/victory-hle/src/modules/dstorage.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/430/head:github-bot/gh-430'
git switch 'github-bot/gh-430'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-430'
git switch 'github-bot/gh-430'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-430'
git switch 'github-bot/gh-430'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-430'
git switch 'main'
git merge --squash 'github-bot/gh-430'
git switch 'main'
git merge --ff-only 'github-bot/gh-430'
git switch 'main'
git merge 'github-bot/gh-430'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!430
No description provided.