DirectStorage: Close completes what was submitted #430
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/430"
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 marquezinii on 2026-11-24T03:15:56Z.
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_laneinstead 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 stayedE_PENDINGfor good, so a title pollingIsCompleteafterClosewould spin forever. Grand Theft Auto VI callsCloseon its queues (the comment onclosesays so).close_lanenow drops only what was enqueued but never submitted (soa_closed_queue_completes_nothingstill 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 andfinishflushes 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_PENDINGafterClose(3 of 3 runs); now it isS_OKand the destination holds the whole file (3 of 3).cargo test -p victory-hlepasses 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
Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T05:11:45Z.
Review: APPROVED
Tested
129d289on Windows 11, RTX 5070, MSVC:cargo test --workspace --no-fail-fastpasses (265 passed, 0 failed). I ran the newclosing_a_queue_completes_what_was_submitted8 more times on its own and it passed each time (about 0.1 s each), with no hang.I traced the new wait to check that it always ends:
Lanes::starttakes reads from any lane with reads, closed or not, so submitted reads still run afterClose.finishremoves the job fromrunningand callsflush, which writes every status entry with no earlier read outstanding. Oncereadsandrunningare empty,statusesempties too, and each worker'sfinished.notify_all()wakes the waiter.submit, so they cannot be left in a lane that has nothing running.unsubmitted.clear()keepsa_closed_queue_completes_nothingvalid.One edge case, not blocking:
scheduler()returnsSomeeven when no worker thread started. Before this changeClosereturned at once in that case. Now it waits forever if reads were submitted. Every read on such a lane already stalls forever, so this only moves where the hang shows up, but aworkers == 0guard inclose_lane(orscheduler()returningNone, as its doc says) would rule it out.AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by DaviTostes on 2026-11-24T03:33:51Z.
Verified
129d289on 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 ismodules::net::tests::only_loopback_is_reachable— the known WineWSAConnectByListenvironment gap (#217), unrelated.closing_a_queue_completes_what_was_submittedpasses (with the WineGetTempPath2Wfixme in its output).Not covered: a real title queue at close, and throughput/latency effects (no game data here).
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:29:41Z.
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
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.