HLE: keep DirectStorage file references alive for queued reads #1181

Closed
github-bot wants to merge 1 commit from gh-pr/1181/head into gh-pr/1181/base
Owner

@⁠matheusfrta on GitHub · 2026-11-24 16:21 UTC · original
matheusfrta:patch-1795537297 → main · +68 −14 · 1 files · 1 commits · closed without merging

Holds a reference on the IDStorageFile object while a file-backed read is queued or running, matching StatusArray's lifetime handling and DirectStorage's contract that callers may release a file immediately after enqueuing requests. Releases the reference when the read completes or the queue is closed, with a regression test covering early file release.

**@⁠matheusfrta** on GitHub · 2026-11-24 16:21 UTC · [original](https://github.com/Marvisak/VIctory/pull/1181) `matheusfrta:patch-1795537297` → `main` · +68 −14 · 1 files · 1 commits · closed without merging Holds a reference on the IDStorageFile object while a file-backed read is queued or running, matching StatusArray's lifetime handling and DirectStorage's contract that callers may release a file immediately after enqueuing requests. Releases the reference when the read completes or the queue is closed, with a regression test covering early file release.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:22:43 +00:00
github-bot closed this pull request 2026-11-26 04:22:43 +00:00
Author
Owner

@⁠Aniseto on GitHub · 2026-11-24 17:38 UTC · original

Ran the new test and the whole dstorage module at 715293e:

Environment: Windows 11 Pro build 26200 x64, Intel Core i5-12400F, 64 GB RAM, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only) driver 32.0.16.2124, Rust 1.98.1 (pinned by rust-toolchain.toml), MSVC 14.44.35207, DXC 1.9.2609.5, debug build.

cargo test -p victory-hle releasing_file_after_enqueue
1 passed; 0 failed; 0 ignored      (exit 0)

cargo test -p victory-hle dstorage
14 passed; 0 failed; 0 ignored     (exit 0)

modules::dstorage::tests::releasing_file_after_enqueue_keeps_it_alive passes and the rest of the module is unaffected. This is a lifetime test with a real file read queued, so it exercises the ownership path the PR changes, not just a mock. Unit-level overall, so the adapter is not the variable; the datapoint is the pinned 1.98.1 toolchain. No test report on this PR yet.

Not tested: a title streaming archives through this path (no game data here), RDNA2/RDNA4 and Intel GPUs.

AI-assisted (OpenCode), model: DeepSeek V4.1 Flash 1017 - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; no game data was used.

**@⁠Aniseto** on GitHub · 2026-11-24 17:38 UTC · [original](https://github.com/Marvisak/VIctory/pull/1181#issuecomment-7139481779) Ran the new test and the whole `dstorage` module at `715293e`: Environment: Windows 11 Pro build 26200 x64, Intel Core i5-12400F, 64 GB RAM, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only) driver 32.0.16.2124, Rust 1.98.1 (pinned by `rust-toolchain.toml`), MSVC 14.44.35207, DXC 1.9.2609.5, debug build. ``` cargo test -p victory-hle releasing_file_after_enqueue 1 passed; 0 failed; 0 ignored (exit 0) cargo test -p victory-hle dstorage 14 passed; 0 failed; 0 ignored (exit 0) ``` `modules::dstorage::tests::releasing_file_after_enqueue_keeps_it_alive` passes and the rest of the module is unaffected. This is a lifetime test with a real file read queued, so it exercises the ownership path the PR changes, not just a mock. Unit-level overall, so the adapter is not the variable; the datapoint is the pinned 1.98.1 toolchain. No test report on this PR yet. Not tested: a title streaming archives through this path (no game data here), RDNA2/RDNA4 and Intel GPUs. AI-assisted (OpenCode), model: **DeepSeek V4.1 Flash 1017** - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; no game data was used.
Author
Owner

@⁠Zipettte on GitHub · 2026-11-24 18:00 UTC · original

Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 715293e: cargo test -p victory-hle passes, 96 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).

Tested with AI assistance (Claude).

**@⁠Zipettte** on GitHub · 2026-11-24 18:00 UTC · [original](https://github.com/Marvisak/VIctory/pull/1181#issuecomment-7140025917) Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 715293e: `cargo test -p victory-hle` passes, 96 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed). _Tested with AI assistance (Claude)._
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:33 UTC · original

Automated triage for the maintainers. Closing because another open pull request covers the same change.

See #577. The same fix as #577 (queued reads keep a file reference), less complete and with formatting damage; it also fails to compile on main for the same reason.

If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

**@⁠Marvisak** on GitHub · 2026-11-25 00:33 UTC · [original](https://github.com/Marvisak/VIctory/pull/1181#issuecomment-7148643880) Automated triage for the maintainers. Closing because another open pull request covers the same change. See #577. The same fix as #577 (queued reads keep a file reference), less complete and with formatting damage; it also fails to compile on main for the same reason. If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

Pull request closed

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!1181
No description provided.