DirectStorage: decompress file-backed zlib requests in parallel by default #3325
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3325"
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 Prime1997 on 2026-11-29T08:22:21Z.
Requested by Prime
The bounded decode pool (
1495e6df) has been opt-in since it landed, so by default each queue thread still reads and inflates its requests one at a time while the other cores sit idle as a title streams its world. The pool keeps retirement in queue order, a 32 MiB staging budget and four workers, and takes only file-backed zlib requests with virtual destinations, so the change is the default:XCL_DSTORAGE_PARALLEL_DECOMPRESS=0(orfalse) goes back to the queue thread.BCPack and physical-page destinations stay on the queue thread: moving them into the pool is part of open PR #2004.
What is in it
crates/xcl/src/hle/dstorage/parallel.rs: the pool is on unlessXCL_DSTORAGE_PARALLEL_DECOMPRESSis0orfalsecrates/xcl/src/hle/dstorage/parallel_tests.rs:parallel_decompression_is_on_unless_turned_offREADME.md: the switch is described as on by defaultTested
cargo test --workspace --no-fail-fast -- --test-threads=4with the threeuma_drivertests below skipped, one78fe5d2cc: 2606 passed, 0 failed, 49 ignored (SKIPPED GPU tests: 28 lines: 21no wave64(this card runs wave32), 3 a wave32 per-lane form refused by the translator (#1426), 2no heap windows(opt-inXCL_HEAP_WINDOWS=1), 1no dxc.exe, 1cannot disable the driver cache(needs Windows Developer Mode))cargo test -p xcl --lib -- --test-threads=1 uma_driver::tests::a_refused_gpu_upload_segment_becomes_custom uma_driver::tests::mixed_window_keeps_its_bytes_and_the_gpu_sees_every_segment uma_driver::tests::failed_restore_stops_before_importing_an_unbacked_window): 3 passed, 0 failed. They are left out of the whole run because on this PC's driver they can end the library test process (exit 0x7c10003, "coherent window could not be restored"), onmaintoocargo test -p xcl --lib -- --test-threads=4, same skips): 2467 passed, 0 failed; 2467 passed, 0 failedmainfa204595a4: 2605 passed, 0 failed, 49 ignored, 28SKIPPEDlines (own-prs-20261129 run, same command)scripts/smoke.ps1, no input, copied profile and shader cache): blocks belowRegression run
Not tested
AI use
Optional temporary Discord for coordinating contributor work, testing and comparing results.
🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by saintwolf on 2026-11-29T13:47:53Z.
Reviewed and tested at
e78fe5d2.Looks clean and minimal. One small nit:
parallel_enableddoes not.trim()XCL_DSTORAGE_PARALLEL_DECOMPRESS(value == "0"), unlike the other env-var parsers (#3377,#3336,#3330), so" 0 "wouldn't disable it.Tested locally
32.0.16.2140), AMD Ryzen 7 7800X3D,rustc 1.100.0.cargo test -p xcl --lib hle::dstorage:: -- --test-threads=1: 39 passed, 0 failed.AI use
Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-29T22:39:30Z.
Review: COMMENTED
Static review of
e78fe5d2for the stack in the #3041 comparison.The default pool path bypasses scratch reuse for fallback file requests in the measured build. Ineligible requests, including small raw reads, pass
Nonefor the input scratch buffer. The former default queue path used a reusable buffer. Carrying that scratch through the pool's sequential fallback would preserve reuse. Measured fallback ?? Sequential queueReview assisted by Codex (GPT-6, exact variant unavailable). No new build or GPU run for this review.
Imported from ivall/xcl. Originally posted by bmjask on 2026-11-29T22:43:29Z.
Review: COMMENTED
Critical review of current head
e78fe5d2. The default flip itself is narrow, but it makes the pool's serial fallback part of every ordinary run. As noted in the prior review, ineligible file requests can lose the queue's reusable scratch buffer and allocate per request when the pool exists. Please carry scratch reuse into the fallback and compare allocation rate and streaming stalls with0versus default.parallel_enabledalso does not trim the environment string, so" 0 "silently enables the pool; that is minor but easy to fix. No local Windows run.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T03:58:41Z.
Review (head
e78fe5d2, diff read, not a merge-check; draft, so not built or run):parallel.rs~440) and the workers only inflate, so this PR alone doesn't expose them. But if #3364 (workers reopen the file by path and keep handles, see the review there) merges after this, they land in the default path; better fixed first.wait_for_capacity(~402) behind another queue's staged work, so a high-priority queue can wait on a bulk one.NtWriteVirtualMemorycopy.parallel_enableddoesn't trim spaces like the other switches. AI use should name the model.Fine: requests retire in queue order with a drain before status, signal and event entries, zlib length and checksum errors match the sequential path, a worker panic becomes E_ABORT, and a failed pool start or oversized request falls back to the sequential path.
AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T16:20:18Z.
Test report (not a merge-check: draft)
base:
b2b1f109d2head:
e78fe5d2ccmerge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2903 passed, 0 failed, 51 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none
review: not repeated here; my review of this same head is at https://github.com/xcl-dev/xcl/pull/3325#issuecomment-7300252872, and its findings stand. This run adds what reading couldn't: whether the change merges, builds and passes the whole suite on current main.
performance: no smoke run.
assessment: merges, builds and passes the whole suite on current main (0 failed); the findings in my review stand
hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5
AI-written and posted by Foniass without a human check of each point.
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.