DirectStorage: a zlib request that fails is tried again, the last time past the file cache #3245
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!3245
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3245"
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?
@ve3xone on GitHub · 2026-11-29 20:59 UTC · original
ve3xone:dstorage-zlib-retry→main· +121 −2 · 1 files · 1 commits · openMitigates #1272 (root cause still open; evidence in the comment there).
What
When a zlib request fails to inflate (
0x8007000d),executenow tries again before the title is told, instead of failing the request:FILE_FLAG_OVERLAPPED | FILE_FLAG_NO_BUFFERING(the existingread_direct), past the host's file cache.The result is copied into the destination in one go. Each rescue logs which step worked and how the reads differed (
differ: how many bytes, first/last offset, first byte before and after). If all three fail, the request fails as before. The happy path is untouched: no extra copy and no extra read unless a chunk has already failed.Why
On one PC with the packs on a local SSD, 7 of 9 runs crashed within about 2 minutes, 1 to 3 s after 2 to 8 such failures (an access at null, or the title's own break). The failed chunks inflate fine offline, and reads outside the runtime never mismatch. See #1272 for the full evidence.
Measured
Same PC, same settings (
io=Handles), 6-minute run with this change:Before: crashes in 7 of 9 runs.
Tests
a_failed_zlib_request_is_tried_again. It covers three paths: the same-source retry, a wrong first read with the file right on re-read, and bad on disk too, where the request still fails. It also checksread_uncachedat an offset and size that are not sector multiples,Nonefor a memory source, and thediffertext.cargo test -p victory-hle --lib dstorage: 30 passed.cargo clippy -p victory-hle --all-targets --no-deps -- -D warnings: nothing indstorage.rs. The workspace clippy gate is already red onmain, independent of this change:gameinput.rs(unnecessary_lazy_evaluations),lifecycle.rs(items_after_test_module), and unused items invictory-shaderandvictory-loader.cargo xtask policy --staged: ok.Not in this PR
VICTORY_DSTORAGE_IO=directthe default forvictory play. It may avoid the bad cache pages entirely, but I have not measured a run with it yet.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.