DirectStorage: XCL_DSTORAGE_IO_CONCURRENCY caps concurrent disk reads for HDDs #902
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/908"
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?
Imported from ivall/xcl. Originally posted by auswhalen999-debug on 2026-11-24T08:02:55Z.
Console titles can drive 16+ concurrent DirectStorage file queues at once. On mechanical HDDs, issuing that many simultaneous
seek_readcalls thrashes the read heads and stalls asset streaming.This adds an opt-in
XCL_DSTORAGE_IO_CONCURRENCY=Nsetting (e.g.2for mechanical HDDs, clamped to1..=64). When unset or0(the default), disk reads remain uncapped so SSD/NVMe users see no behavior change. The semaphore gates onlyread_exact_atdisk reads while keeping CPU zlib decompression and destination copies parallel across all queues.What is in it
crates/xcl/src/hle/dstorage.rs: addparse_io_concurrency,IoLimiter/ RAIIIoPermit(Mutex<usize>+Condvarinitialized once viaOnceLock), and gateread_exact_atdisk reads (with an early return for empty reads andchecked_addoffset check).crates/xcl/src/hle/dstorage.rs(mod tests): add unit tests covering env-var parsing/clamping, bounded concurrency (limits 1 and 2) with unwind-safe permit release, and the uncapped default when unset.README.md: documentXCL_DSTORAGE_IO_CONCURRENCY.Tested
cargo test -p xcl --lib dstorage: 16 passed, 0 failed, 0 ignored (0 warnings incrates/xcl/src/hle/dstorage.rs).XCL_DSTORAGE_IO_CONCURRENCY=2compared to uncapped concurrent queue reads.Regression run
Pending: paired
scripts/smoke.ps1runs on clean builds ofmainand commitdc2143cc2614are not yet attached.Not tested
cargo test --workspacerun and pairedscripts/smoke.ps1runs on this commit (dc2143cc2614).AI use
origin/main, added the unit tests and README note, rancargo test -p xcl --lib dstorage, and drafted the PR description.Imported from ivall/xcl. Originally posted by eizispark on 2026-11-24T08:16:56Z.
Hardware check of
dc2143cc2614ce6f6e84dc6f14b6220b8956c5b3(verified clean merge withmain09940bb): pass.Tested
rustc 1.100.0 (0ef1bc386 2026-11-09), release + test profilecargo test --workspace -- --test-threads=4:715 passed, 3 failed, 41 ignored(GPU tests skipped on this adapter:none);placed_title_textures_share_vram_and_preserve_pixelsflaked under 4-thread shared-singleton contention (poisoningtransitions_apply_when_their_list_is_submittedandd32s8_targets_take_their_own_size_of_video_memory), andcargo test -p xcl --lib hle::d3d12x -- --test-threads=1passed (114 passed, 0 failed, 1 ignored)hle::dstorage::tests(16 passed, 0 failed), includingio_concurrency_parsing_defaults_to_uncapped_and_clamps_positive_values,io_limiter_caps_concurrent_holders_and_releases_on_drop, andio_limiter_is_uncapped_when_env_unsetRegression run
main(beaa245):PR (
dc2143c):Not tested
XCL_DSTORAGE_IO_CONCURRENCY=2(smoke ran on SSD with default unset concurrency); gameplay past the menusAI use
scripts/smoke.ps1harness on this machine and formatted this report.Imported from ivall/xcl. Originally posted by dcastell1 on 2026-11-24T08:27:37Z.
Verified on Windows 11 10.0.26300, NVIDIA GeForce RTX 5090 (driver 621.24), Rust 1.100.0 MSVC 14.44.35207, debug build, on clean
main@beaa245(713 passed, 0 failed, 41 ignored on this box):Three more passing tests than main: the DirectStorage IO-concurrency cap is covered and green here; nothing else changes verdict.
Tree restored afterwards (md5 and a full diff against a clean checkout), hardware adapter, no Wine, no game data. AI-assisted (opencode): applied the patch to a built tree, ran the suite, reverted it.
Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-24T09:34:38Z.
Linux / AMD RDNA3 datapoint.
Merged state: head
dc2143conto main09940bb, clean merge.Full suite,
cargo test --workspace --release --no-fail-fast --target x86_64-pc-windows-gnu -- --test-threads=4: 712 passed, 7 failed, 41 ignored; failures are the known Wine-lane set from my #42 rows. DirectStorage IO-concurrency cap green.Not tested: retail titles (none here), Windows, RDNA4.
Counts only, no game data.
Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross
x86_64-pc-windows-gnu,XCL_NETWORK=0, release profile,--test-threads=4. My Linux rows: #42 / #718.AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
upstream-sync referenced this pull request2026-11-25 00:08:32 +00:00
Imported from ivall/xcl. Originally posted by Toons29 on 2026-11-25T03:09:06Z.
Regression run of
85c92109on the retail title, for this PR's Regression run section. Both blocks are fromscripts/smoke.ps1as printed, not edited:mainon4178e888, this PR on its head commit with no uncommitted changes, same title and time.Against the limits in CONTRIBUTING.md: 101 % of
main's frames, 99 % of its peak commit, no crash, no device removal.AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0,
cargo build --release -p xcl, 60 s,XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.AI use: Claude Code (Claude Opus 5.5) built both trees and ran
scripts/smoke.ps1; I checked the blocks before posting.Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T09:31:11Z.
Verification on RTX 3060 Ti (Windows 11): merge conflict with current
main(README.md,crates/xcl/src/hle/dstorage.rs) — needs a rebase before it can be tested.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T04:28:44Z.
Triage (#1607) – head
85c9210No open or merged PR caps DirectStorage disk reads.
read_exact_aton main has no limiter.Problem: the merge commit
85c9210resolved the README conflict by deleting the existingXCL_DRED=1bullet (the three lines about DRED breadcrumbs). The PR's diff against main removes them, so they need to be restored next to the newXCL_DSTORAGE_IO_CONCURRENCYbullet.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.