DirectStorage: worker count and priority switches (VICTORY_DSTORAGE_WORKERS, VICTORY_DSTORAGE_PRIORITY) #402
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!402
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-402"
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?
@Esteban-V on GitHub · 2026-11-27 00:02 UTC · original
Esteban-V:perf/dstorage-workers→a-publier· +34 −3 · 1 files · 1 commits · openThe DirectStorage scheduler starts one worker per logical processor (
available_parallelism,crates/victory-hle/src/modules/dstorage.rs:631), so 24 on a 12-core/24-thread CPU. The workers inflate zlib and unpack BCPack on the CPU at normal priority, inside an above-normal process, and in streaming bursts they can take every core away from the frame-critical threads. Nothing could change the count or the priority. This adds two opt-in switches for both.VICTORY_DSTORAGE_WORKERS=n: startnworkers, clamped to 1..=64. Unset (or not a number): one per logical processor, as before.VICTORY_DSTORAGE_PRIORITY=below: each worker sets itself toTHREAD_PRIORITY_BELOW_NORMALwhen it starts. Unset: as before.worker_count(asked, processors), likepipeline/make.rs::worker_count, with a unit test. The startup log line now also printsbelow.Files::newkeeps its handle count and a worker picks its handle bythis_thread() % n, so any count works. One worker still drains the queue, becauseLanes::startstarts a read whenever nothing is staged (covered bystaging_bounds_compressed_bytes_in_flight).To A/B:
VICTORY_DSTORAGE_WORKERS=8to12, with and withoutVICTORY_DSTORAGE_PRIORITY=below, against the default, comparing frame times during streaming (driving through the city). Please also check load times:runtime.rsrecords that starving loading once made loads take 40 to 60 s instead of 28 to 33 s, which is why both switches are opt-in.Testing
windows-latest): Clippy, default tests and diagnostics tests pass (run).x86_64-pc-windows-msvcon a macOS host (cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-msvc -- -D warnings, default and--all-features).worker_count_follows_the_processors_and_the_switchadded.@MamaLeVrai on GitHub · 2026-11-27 01:23 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
9a19fd3:cargo test --release -p victory-hle --lib163 passed, 0 failed, 2 ignored.AI-assisted (Claude Code); no game data.
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.