Repository navigation
DirectStorage: reuse small sequential file input buffers - #2530
razormontana wants to merge 1 commit into
Conversation
Sequential file requests repeatedly allocate and zero the input buffer. Keep up to 64 KiB per worker and expose only the exact bytes of a successful read. A synthetic read-loop probe counted 16,384 allocation calls without reuse and four with reuse. Part of xcl-dev#1833. Assisted-by: Codex (GPT-6 family, exact variant unavailable)
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
Test run on exact head Tested
Regression run (60 s, default settings, a retail title) main: this PR: No crash or device removal; frames 104 % of Not tested
AI use
|
|
Tested: current PR head merged onto current
Targeted run of the DirectStorage sequential/reuse tests: 6 passed, so the reused buffer path is covered on the Wine lane too. AI use: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting. |
|
Independent AMD RDNA4 (native wave64) verification of exact PR head Tested
(Compare against Not tested
AI use
|
Part of #1833. The default DirectStorage worker allocates and zeroes an input buffer for every file request. A worker now retains up to 64 KiB of initialized input storage and reuses it across requests. Larger reads use a temporary buffer.
What is in it
crates/xcl/src/hle/dstorage.rskeeps a worker-local buffer and passes the exact bytes of each successful read to the existing decode and delivery paths. The opt-in decompression pool uses its existing staging budget.crates/xcl/src/hle/dstorage/parallel_tests.rschecks allocation reuse at the high-water size, reads beyond the cache size, and FIFO status and destination bytes after a short read.Tested
73643dae7e179eb0dfc2c27d3503aff7e2351f34.cargo test --offline --locked -j 2 -p xcl --lib hle::dstorage:: -- --test-threads=1 --nocapturepassed 34 tests with zero failures, ignored tests, or skips both with default settings and withXCL_DSTORAGE_PARALLEL_DECOMPRESS=1. With the new tests and the old allocation path, the high-water assertion failed and the short-read compatibility case passed.cargo build --offline --locked --workspaceandcargo build --offline --locked --release --workspacesucceeded. The debugcargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --show-outputrun withXCL_ADAPTER=3070reported 1,426 passed, 0 failed and 46 ignored across 37 targets. The pass count includes 26SKIPPEDnotices (21 native-wave64 checks, 3 unsupported per-lane forms, 1 reserved cube with mips and 1 heap-window check).Regression run
Both clean release builds ran
scripts/smoke.ps1 -Game <folder> -Seconds 60on the same retail title in the Series S profile on the RTX 3070. They usedXCL_DIRECT_DXIL=1, networking off and identical starting copies of XCL's warmed cache. NVIDIA's driver cache settings were left at their defaults.Main
Candidate
Not tested
AI use