DirectStorage: requests reuse a worker's buffers, within one budget #1596
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!1596
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1596"
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?
@mizzied on GitHub · 2026-11-28 22:10 UTC · original
mizzied:up/dstorage-buffers→main· +254 −8 · 1 files · 1 commits · merged 2026-11-29 08:16 UTCWhat was wrong. Each DirectStorage request allocated its source buffer, its zlib intermediate and the buffer for a write to scattered pages with
vec![0; size]. That faulted in every page again for every request.The fix. A worker now keeps up to three spare buffers of at most 32 MiB each (
VICTORY_DSTORAGE_BUFFERS, on by default), zeroed before reuse. All workers together keep at most 256 MB of them (VICTORY_DSTORAGE_BUFFER_BUDGET, in MB,0for no bound). Without that bound, 16 workers × 3 × 32 MiB could hold 1.5 GB for the whole run, in a process that's often short of memory. A buffer that doesn't fit is freed at the end of its request.How it was tested. RTX 5070, Windows 11. New tests cover the following:
cargo test --workspacepasses apart fromrepository_passes_policy, which already fails onmain:lower.rsis over the 640 KiB file-size limit there (#1493 raises it). Clippy reports only the 16 findings already onmain, none on lines this PR changes.