DirectStorage: decode eligible file requests in parallel #819
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!819
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/819/head"
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?
@ZekkJJ on GitHub · 2026-11-24 05:57 UTC · original
ZekkJJ:codex/dstorage-parallel-decompression→main· +1271 −68 · 4 files · 1 commits · merged 2026-11-24 20:03 UTCAdd an opt-in worker pool for file-backed, single-stage zlib DirectStorage requests with virtual destinations. The queue worker reads files and retires results in FIFO order. The pool is off by default.
What is in it
1495e6df204a0836a7a4515fd16437cbe9ed7000is based onc160d86ef2efe3a07e4dfb473e4fa72eafb413c0. Its entire patch matches the previously validated59e9f3f85fd8292bd7bb4517a52a586489bea8bcbyte-for-byte.XCL_DSTORAGE_PARALLEL_DECOMPRESS=1enables four workers and a shared 32 MiB staging budget by default. The runtime changes and 647 lines of deterministic tests are kept together to verify ordered retirement, cancellation, and the memory bound.Tested
cargo test --locked --workspace --no-fail-fast -- --test-threads=4 --nocapturereported 870 passed, 0 failed, and 42 ignored. The log also reported 3 feature or adapter skips (gpu,gpu,heap_window_out_of_memory_falls_back_to_the_switch_form).59e9f3f85fd8292bd7bb4517a52a586489bea8bc, five alternating pairs per workload. Enabled versus disabled was 2.19× median (2.02–2.34×) for 64 KiB zlib and 1.020× (0.978–1.058×) for 1 MiB uncompressed. Disabled versus its tested main measured 1.006× (0.980–1.062×) and 0.995× (0.944–1.038×), respectively.Regression run
Pending on the current head. Please run independent
scripts/smoke.ps190-second tests on one retail title with three clean builds or configurations.c160d86ef2efe3a07e4dfb473e4fa72eafb413c0, pool off.1495e6df204a0836a7a4515fd16437cbe9ed7000, pool off.XCL_DSTORAGE_PARALLEL_DECOMPRESS=1, four workers and a 32 MiB staging budget.Use the same adapter, console profile, offline/no-input conditions and equivalent initial caches across runs. Leave
XCL_DIRECT_DXILunset to use upstream's default. Keep host memory safeguards active and attach the official smoke blocks for the three cases.Historical retail run on main
9e3831e1f570d3646e53ab753b19ec07eb8f1485and candidate59e9f3f85fd8292bd7bb4517a52a586489bea8bc. All three completed 90 seconds with zero crashes and zero device removals on Series X with a fresh 512 MiB coherent UMA window, RTX 4060 Laptop GPU, and DXC 1.8.2502.11.Both historical candidate runs passed local acceptance. The disabled run's 12.4% frame deficit widened late as it processed more streaming requests than main. The cause remains unresolved after one ABC sequence.
Not tested
Retail execution and performance on the current head, exact simultaneous retail decoder job count, retail staging waits, and validation on AMD.
AI use
OpenAI Codex (GPT-6, exact serving variant unavailable) implemented the earlier rebase and tests, verified the unchanged patch on the new base, built and tested the current candidate, verified the historical evidence, and drafted this description.
@ryosen0 on GitHub · 2026-11-24 06:15 UTC · original
Windows cross-check of
7f1ecc4(RTX 3060 Ti 8 GB, Ryzen 7 9800X3D, driver 32.0.16.1742, Windows 11, release build) — the Regression run gap, on the retail title this repo smokes:Head, default (pool off):
Head,
XCL_DSTORAGE_PARALLEL_DECOMPRESS=1(pool on, defaults: 4 workers / 32 MiB):The title's boot traffic is exactly the eligible shape (file source, zlib, virtual 64 KiB destinations — thousands of requests in the first seconds), both runs clean, frame counts within noise, peak commit identical. So the opt-in path survives a real retail boot on a second host.
Tests on this head:
cargo test --release -p xcl --lib hle::dstorage -- --test-threads=1→ 23 passed / 0 failed;... --lib parallel -- --test-threads=1→ 10 passed / 0 failed (the dedicated pool contract tests).Two honest limits: (1) this 90 s window ends before the title's BCPack phase, so it says nothing about the refusal path interactions; (2)
pipeline_metrics()has no runtime consumer in this diff, so I could not verify from the log how many decodes actually ran in parallel on the retail workload — the synthetic benchmark carries that claim, not this run. A one-line periodic log of the pool metrics under the existing activity line would close that gap cheaply, if you want it in this PR or a follow-up.The main-side pair for Regression run still needs a block from current main (
beaa245) per the checks; the head blocks above are yours to paste.AI use: GPT-6.2 Astra (API model selector) in DSH built the head, ran both smokes and the tests, and drafted this comment; the human contributor reviewed the numbers before posting.
@mastrr9 on GitHub · 2026-11-24 06:18 UTC · original
Clean-room build, audit, and native hardware test run on NVIDIA RTX 5080 (Windows 11 Pro 25H2
26200.9974, driver617.42/32.0.16.1742,rustc 1.100.0, DXC Windows SDK10.0.26100.0).7f1ecc4fe3a642f8eeb9c3da367c3ee729d5c8decargo build --workspace): clean (only the pre-existingfetch_updatedeprecation warning).cargo test --workspace -- --test-threads=4):714 passed; 0 failed; 41 ignored(SKIPPED: only the 2 hardwareno wave64tests).hle::dstorage::parallel_tests::*tests passed cleanly (budget_retires_ready_error_and_payload_without_worker_notification,cancellation_of_started_or_prepared_work_keeps_existing_results,failed_worker_task_reports_error_and_preserves_the_next_result,parallel_decode_reports_corruption_and_zero_pads_the_next_request,parallel_out_of_order_completion_retires_fifo,queue_close_waits_for_started_preparation,request_larger_than_staging_budget_uses_sequential_fallback,staging_stays_charged_until_the_other_queue_finishes_retirement,submitted_batch_retires_without_notifications_or_followup_submits,tight_budget_makes_progress_after_immediate_file_failure).E_ABORTfallback; staging budget accounting is RAII-paired viaReservation::dropwith close wakeups under the mutex; oversized requests fall back to the sequential path; opt-in viaXCL_DSTORAGE_PARALLEL_DECOMPRESS.(Clean-room hardware check only; no retail title or
smoke.ps1run. Assisted-by: Antigravity / Claude Sonnet 5.5 + Gemini 4 Neon)@MesshM on GitHub · 2026-11-24 06:21 UTC · original
Test run of
7f1ecc4fe3a642f8eeb9c3da367c3ee729d5c8deon AMD RDNA4. I merged it onto currentmainbeaa245locally (clean merge) and tested that tree.Tested
stable-x86_64-pc-windows-msvc, debugcargo build --workspace+cargo test --workspace -- --test-threads=4on the merge: 723 passed, 0 failed, 41 ignored, exit code 0;xcllib tests 682 passed; 0SKIPPED.Review: Opt-in (
XCL_DSTORAGE_PARALLEL_DECOMPRESS=1); with it unset nothing changes, and the suite passes that way. At 1399 lines I reviewed the structure only; the parallel path itself was exercised only by its own tests.Not tested: no retail title or regression run (I have no unpacked game), release build.
Run and review by Claude Code (Claude Opus 5.5) on this machine.
@iggyvilla on GitHub · 2026-11-24 07:34 UTC · original
Review of
7f1ecc4, read only (nothing built or run by me).The copy into the title's buffer in
retire_onecan fault the process.retire_onecheckswritable(task.req.destination, n)(hle/dstorage.rs:1641) and then does a plaincopy_nonoverlappinginto the destination (:1647).startcheckswritabletoo (:1527), but that check runs before the file read and the inflate, and the copy comes after both, behind FIFO retirement. If the title decommits the destination in that time, the copy is an access violation in the XCL process, where the old path would returnE_ACCESS_VIOLATIONfor the request. That is the window #705 closes inexecuteby writing withwrite_own(NtWriteVirtualMemory) instead of a direct copy. The sequentialexecutepath onmainstill has the same direct copy (:1333), so this PR does not add a new kind of fault, but it adds a second site with a much longer window, and #705's test (aSOURCE_MEMORY_BITrequest) does not reach this path, which the parallel path excludes (:1690).Whichever of the two lands second should send the retirement copy through
write_own(and treat a false return asE_ACCESS_VIOLATION). A test with a file-backed request whose destination is decommitted while the worker decodes would cover it. #819 and #705 also conflict textually indstorage.rs, so this will have to be resolved in the rebase anyway.Smaller:
set_profiling_enabled,set_retirement_profiling_enabled,take_retirement_timings,timing_breakdown,reset_timing_breakdownandpipeline_metricsare never called from the PR tree, so theInstant::now()branches that depend on them never run, andXCL_DSTORAGE_MEASUREis not in the README. Removing them (or wiring the metrics into the existing activity log line, as the Windows cross-check above suggests) would also take the diff nearer the size guide.AI use: read with Claude Code, Claude Sonnet 5.5, checked against the PR head and
main; the findings are mine and I checked each line reference.@SlopTart on GitHub · 2026-11-24 08:09 UTC · original
Linux / AMD RDNA3 datapoint.
Merged state: head
7f1ecc4onto main1ec4c98, clean merge.Full suite,
cargo test --workspace --release --no-fail-fast --target x86_64-pc-windows-gnu -- --test-threads=4: 718 passed, 7 failed, 41 ignored. Failures = the known Wine-lane set from my #42 rows - zero flakes in this lane. parallel DirectStorage decode tests green (718 passed, zero flakes).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.
@Creaa on GitHub · 2026-11-24 08:47 UTC · original · edited 2026-11-24 08:51 UTC
RTX 4070 startup performance
Tested on an RTX 4070 (617.14), Core i7-13700F, Windows build 26300, and Rust 1.100.0. Built the exact base and PR revisions using
cargo build --locked --release -p xcl. Ranscripts/smoke.ps1 -Game <game-folder> -Seconds 45 -Xcl <release-exe>offline against the same title (packageRockstarGamesInc.28872443D20A7), with a fresh XCL title-data directory for each run. A baseline warm-up preceded the measured runs. The PR trials ran in off/on/on/off order, withXCL_DSTORAGE_PARALLEL_DECOMPRESSset to0or1.e50836bThe flag brought the first PresentX forward by 0.51-0.54 s across two pairs. All measured runs exited normally with zero crashes and zero device removals. PresentX timestamps measure presentation calls. Intro visibility, menu, gameplay, and the automated suite were not checked in this run.
Regression run
Base
PR, flag off
PR, flag on
AI use
Codex (GPT-6) built both revisions, ran the smoke trials, extracted the metrics, and drafted this report.
@gbuyssens on GitHub · 2026-11-24 19:27 UTC · original
Test report for
1495e6d(on top of mainc160d86), as asked.Tested
RTX 3060 (driver 32.0.16.2101), i5-9600K, 32 GB, Windows 11 Pro 26300, Rust 1.98.0 MSVC.
cargo test --workspace --no-fail-fast -- --test-threads=4(debug):1495e6d: 870 passed, 0 failed, 42 ignoredc160d86: 858 passed, 0 failed, 42 ignoredgpu_geometry_wave32_prefix_count_over_a_mask(no wave64),gpu_wave32_program_in_wave64_hardware(no wave64),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows)scripts/smoke.ps1 -Seconds 90, retail title (RockstarGamesInc package, zlib file requests of 64 KiB), release builds, 11 runs back to back on an idle machine, interleaved, after one warm-up run of main:0 crashes and 0 device removals in every run.
What this shows
7f1ecc4I suspected the pool of making the title stall more often. These runs show the same stall with the pool off and on main, so I withdraw that.The default-path block, for the regression check (main 1 and PR pool off 1, back to back):
main:
PR:
Review of the changes since
7f1ecc4retire_onefault from iggyvilla's review is fixed: the copy now goes throughwrite_destination(NtWriteVirtualMemoryon the current process, parallel.rs:484), so a destination decommitted after the check returns a status instead of faulting.Entry::Refusedand the refused-cancel handling from main are kept (dstorage.rs:1140, 1414).parallel.rs.parallel.rs, +647 in tests), over the ~800 at which CONTRIBUTING asks for a reason not to split.Not tested
AI use
@Gevroska on GitHub · 2026-11-24 22:58 UTC · original
I confirmed that GTA VI uses the parallel DirectStorage decode pool during world loading on Windows with an RTX 3080. I ran the same locally instrumented release (
1d027e5cplus diagnostic counters) for 850 seconds twice, first with the pool off, then with it on.With the pool enabled, the counters continued to rise after I pressed Confirm. By the last counter update, 49,578 requests had matched the pool criteria, 49,576 had been admitted, and all 49,576 admitted requests had decoded and retired successfully. Both runs passed the first-run form and still showed a black screen at the final capture, about 838 seconds after launch. Neither reached a controllable scene or reported a GPU removal.
Across all DirectStorage paths, I counted 1 failure in 87,923 requests with the pool off and 1,871 in 87,816 with it on. All three sampled warnings carried
0x89240009, which several request checks can return. Those totals don’t identify the failing stage. With one run per setting and a shared driver cache, I can confirm pool activity but can’t attribute the failure difference or a performance effect to the pool.I used Codex with GPT-6.2 Sol (high) to adapt the counters and run the tests. A separate GPT-6.2 Sol agent independently checked the saved counters and captures. GPT-6.1 Terra (medium) checked for overlap with existing upstream reports.