Keep DirectStorage source files alive for queued reads #518
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Belobug--VIctory-Belobug-AMD!518
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-518"
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?
@suren1013 on GitHub · 2026-11-27 08:08 UTC · original
suren1013:codex/dstorage-retain-source→a-publier· +103 −20 · 1 files · 1 commits · openGuards against a title releasing a DirectStorage file right after it queues a read from it. Each queued read keeps its own reference to the source file until the read finishes or is discarded.
Two regression tests fail on the base commit and pass with this patch. In-game testing is pending.
@lvndrpup on GitHub · 2026-11-27 11:17 UTC · original · reviewed
Tested on an RTX 3060 Ti (Windows 11, debug build), base
4eb6cfdagainst head444abaa.4eb6cfd444abaaqueued_reads_keep_their_source_after_the_caller_releases_it, copied onto basereleasereturns 0, so the file is freed with its read still queuedclosing_a_queue_releases_the_sources_of_unsubmitted_reads, copied onto basecargo test -p victory-hle --lib dstoragecargo clippy -p victory-hle --all-targets -- -D warnings, with and without--all-featuresThe fix is the right size.
FILE_VTABLEhas no Close of its own, so the reference count is the only thing keeping a file's handles open, and a queued read now holds one. The first test also checks that the read gives it back:remove_filesucceeds only once the handles, opened withoutFILE_SHARE_DELETE, are closed. A rejected request takes no reference. A running job drops its own beforefinishwrites the status, so the title never sees a read complete while that read still holds the file.It merges cleanly with the other open PRs on
dstorage.rsthat still merge witha-publier(#525, #471, #461, #402, #375, #254).The PR has no description. One line saying what it guards against (a title releasing a file right after it enqueues a read from it) would help whoever merges it.
@MamaLeVrai on GitHub · 2026-11-27 11:40 UTC · original
Tested on an RX 6950 XT (RDNA 2), driver 32.0.21045.29003, Windows 11 build 26300, Rust 1.98.1, release. At
444abaa:victory-hle165 passed, 0 failed, 2 ignored.AI-assisted (Claude Code); no game data.
@suren1013 on GitHub · 2026-11-27 13:56 UTC · original
Thanks, I've added a description to the PR. Still unit tests only , not run in-game, so if anyone with a working dump can confirm the bug shows up in play, that would help.
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.