Skip to content

DirectStorage: trace access-failure stages and submission origins - #816

Open
Prime1997 wants to merge 1 commit into
xcl-dev:mainfrom
Prime1997:contrib/dstorage-access-diagnostics
Open

Prime1997 wants to merge 1 commit into
xcl-dev:mainfrom
Prime1997:contrib/dstorage-access-diagnostics

Conversation

@Prime1997

@Prime1997 Prime1997 commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

DirectStorage's first-error message identifies a file and length, but an access failure can come from different checks. This adds opt-in records that distinguish an unreadable page-array snapshot, a source/destination access check, and a failed physical-page write, along with whether the batch came from capacity auto-submission or the title's Submit.

What is in it

  • XCL_DSTORAGE_FAILURE_DETAILS=1 captures bounded metadata: at most 8 access-failure records per queue and 64 per process. The added records contain logical queue IDs, stages, submission origins and zero/total page counts, without addresses, PFN values, file paths or contents.
  • Counts use owned snapshots and the existing late reread. No new guest-memory probes, retries, decoder substitutions or submit decisions. Refusal traces are boxed only when enabled and the HRESULT is an access failure.
  • Five synthetic CPU controls cover bounded admission, address-free formatting, zero/nonzero invalid page IDs, protected sources/destinations and actual auto/title-submitted queue batches with unchanged guest HRESULT/error records.
  • Based on official e50836bdf6f5c026f281d545ed86fb2f07ba6e6a. This does not include or replace the behavior changes proposed in DirectStorage: a late page array holds a half-full queue until Submit #549, DirectStorage: a deferred page-array entry is reread without faulting (#476) #509 or DirectStorage: read deferred zero mappings as native inputs #671, and does not claim to fix the retail loading abort.

Tested

  • Windows 11 Pro build 26200, Intel Core i5-10400, NVIDIA driver 32.0.16.1714, Rust 1.100.0 MSVC, debug. At clean 2ffb5a4ebaefb922952d72b35901d39d04ec715e, cargo test --locked -p xcl --lib failure_diagnostics -- --nocapture --test-threads=1: 5 passed, 0 failed, 0 ignored; no skips, 684 filtered. These CPU controls use no GPU execution; XCL_COHERENT_MB=1 XCL_UMA_MB=1 bound their memory setup.
  • cargo build --locked --workspace passed on that head, refreshing the synthetic title and DLL fixtures before wider validation. cargo build --locked --release --workspace also passed for the clean candidate and pristine official baseline.
  • NVIDIA GeForce RTX 3060 Ti: cargo test --locked --workspace --no-fail-fast -- --test-threads=4 --nocapture on that clean head completed with 709 passed, 0 failed, 41 ignored, using the packaged DXC pair and private test data/DXIL cache directories. Two hardware cases reported SKIPPED: gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware, both no wave64. Optional external samples and the console XG oracle were unset; their early returns are not asset/oracle validation.

Independent retail test

JFyuhong used this tracing change at 2ffb5a4 in two matched story-loading runs on an RTX 4060 Laptop 8 GB. All eight detailed failures captured in the control came from half-full submissions on queue 12. The destination page arrays still contained zero entries on reread. The control recorded 2,045 failed requests out of 87,461. Adding the queue change from #549 reduced that to zero out of 87,038. Both runs still reached the same guest exception at +0x23cf683. The linked report gives both integration trees, settings and the additional patches in the comparison. JFyuhong's test on #549

Regression run

Two 60-second release startup runs, identical offline settings on the same RTX 3060 Ti, no input, and distinct initially empty XCL data/DXIL caches. The new switch was unset (default off); these check startup regressions, while the five controls exercise the metadata. No performance improvement is claimed.

Baseline:

xcl-smoke v1
commit: e50836bdf6f5c026f281d545ed86fb2f07ba6e6a
gpu: NVIDIA GeForce RTX 3060 Ti
title: 419239bf
seconds: 60
exit: 0x0
frames shown: 284 (PresentX 284)
presents per 2 s (last 3): 10 10 11
device removals: 0
crashes: 0
peak commit: 15343 MB

Candidate:

xcl-smoke v1
commit: 2ffb5a4ebaefb922952d72b35901d39d04ec715e
gpu: NVIDIA GeForce RTX 3060 Ti
title: 419239bf
seconds: 60
exit: 0x0
frames shown: 236 (PresentX 236)
presents per 2 s (last 3): 9 8 9
device removals: 0
crashes: 0
peak commit: 15345 MB

Not tested

  • The 60-second startup runs stop before the later prologue/access-failure phase. They do not validate longer gameplay or capture the new metadata from that failure. No counts from the compatibility integration are used for this topic.
  • The cause of the later story-loading abort is still open.
  • AMD/Intel adapters and console-reference texture accuracy.

AI use

OpenAI Codex (GPT-6) assisted with implementation, CPU controls, source review, duplicate screening and this description. Another Codex agent independently reviewed the error/ordering paths and identified the inline trace footprint before it was corrected.

I use a temporary Discord to coordinate my work. Anyone helping test XCL or compare results is welcome. Test coordination on Discord

The first-error message does not distinguish an unreadable enqueue snapshot,
a source/destination access check, or a failed physical-page write. It also
does not say whether capacity or the title submitted the batch.

XCL_DSTORAGE_FAILURE_DETAILS=1 adds stage/origin and owned-array zero counts,
limited to 8 records per queue and 64 per process. New records contain no
addresses, PFN values, paths or data. There are no new guest-memory probes,
retries, decoder substitutions or submit decisions. Keep opt-in refusal
metadata boxed, and allocate it only for access failures.

Five synthetic CPU controls exercise counts, bounded admission, protected
memory and actual auto/title batches while preserving HRESULT/error records.
This does not include or replace the behavior changes in PRs 549/509/671.

Assisted-by: OpenAI Codex (GPT-6)
@ryosen0

ryosen0 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Windows run of 2ffb5a4 (RTX 3060 Ti 8 GB, Ryzen 7 9800X3D, driver 32.0.16.1742, Windows 11, release) on the retail title, toward the pending Regression run:

xcl-smoke v1
commit: 2ffb5a4ebaefb922952d72b35901d39d04ec715e
gpu: NVIDIA GeForce RTX 3060 Ti
title: ScarlettGame
seconds: 90
exit: 0x0
frames shown: 2436 (PresentX 2436)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14596 MB

Clean boot, steady 60 presents / 2 s — the tracing adds no visible cost in this window. Tests on this head: cargo test --release -p xcl --lib dstorage -- --test-threads=1 → 18 passed / 0 failed; ... --lib failure -- --test-threads=1 → 11 passed / 0 failed.

One note on your "metadata not yet captured from retail access failures" gap: this title's failures in a 90 s boot are all BCPack refusals (0x89240030, BC1/BC5/BC7 decode), which start around t≈55–105 s depending on the walk — a 120–150 s run with scripted presses reaches 128 of them. If your stage/origin tracing classifies those, a longer window on this title would give you real retail failure metadata, not just synthetic controls. Happy to run that shape against a revision that logs the new fields.

The matched official-main block still needs to come from current main (beaa245) for the checks.

AI use: GPT-6.2 Astra (API model selector) in DSH built the head, ran the smoke and tests, and drafted this comment; the human contributor reviewed the numbers before posting.

@SlopTart

Copy link
Copy Markdown

Linux / AMD RDNA3 datapoint.

Merged state: head 2ffb5a4 onto main 1ec4c98, clean merge.

Full suite, cargo test --workspace --release --no-fail-fast --target x86_64-pc-windows-gnu -- --test-threads=4: 713 passed, 7 failed, 41 ignored. Failures = the known Wine-lane set from my #42 rows - zero flakes in this lane. DirectStorage trace tests green (713 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.

@einfachama

Copy link
Copy Markdown
Contributor

Test report for #816 at 2ffb5a4, merged locally onto main 47efa2e (no conflicts), with XCL_DSTORAGE_FAILURE_DETAILS=1 on my retail title's world load. These are desktop data next to JFyuhong's laptop run. It names the failing check here as well: every record is a half-full auto-submission failing at DestinationPages, with a zero entry in the destination page array.

Setup

  • NVIDIA GeForce RTX 4060 8 GB (driver 621.24), Ryzen 7 5800X, 32 GB RAM, commit limit 63.9 GB, Windows 11 Pro 26300, Rust 1.100.0, release build (cargo build --release -p xcl).
  • My retail title, XCL_NETWORK=0, XCL_ACTIVITY=1, XCL_RUN_SECONDS=100, XCL_DSTORAGE_FAILURE_DETAILS=1, A pressed at 26 s and 30 s. The world load starts by itself at about 66 s.
  • 2 runs, right after an 8-run main / DirectStorage: resolve GPU-view addresses to their paired CPU view #979 A/B with the same caches.

Results

  • Run 1 ended at 65.3 s with 0x887a0006 (device hung), just before the world load. No DirectStorage failure up to then, so no records.

  • Run 2 reached 100 s, exit 0x0. 2 061 failed requests, all 0x89240009, in three bursts at 67.4 s, 74.7 s and 83.5 s. That is in the range of plain main on this machine, where 4 runs had 17–754 failed requests.

  • Run 2's records: 10 of them (8 on queue 8, which is its per-queue limit, 1 on queue 9, 1 on queue 14). All 10 have the same shape:

    submit=HalfFull stage=DestinationPages source=file destination=pages
    dst-snapshot=[1 total/1 zero] src-snapshot=[unavailable] dst-used=[1 total/1 zero] late-reread=Read
    

    The requests were 8–12 KB: 8 zlib, 2 BCPack.

  • So here too, a request whose single destination page entry is still 0 goes out with a queue that submits itself when half full, before the title's Submit. The late reread also still finds 0. That is the case DirectStorage: a late page array holds a half-full queue until Submit #549 targets. No record has TitleSubmit, and none has any stage other than DestinationPages.

  • Off the record path, the build behaves like main in run 2: peak commit 28 179 MB at 96 s (main: 26 886–28 345 MB), and no WARN kind other than the failure lines from the load start on. With the variable set, the records' only cost was the 10 log lines.

  • Run 1's device hang: I can't attribute it to DirectStorage: trace access-failure stages and submission origins #816. In the same session, 1 of 4 main + DirectStorage: resolve GPU-view addresses to their paired CPU view #979 runs also hung (at 83.5 s). None of the 6 main runs and none of the 4 main + DirectStorage: a late page array holds a half-full queue until Submit #549 runs did.

Not tested

  • With the variable unset. cargo test was not run on this merge, and the 5 failure_diagnostics tests were not run here.
  • Past 100 s, AMD, other titles.

AI use

  • Claude Code (Claude Opus 5.5) ran the builds and runs, read the records from the logs and wrote this report; I checked it before posting.

@Gevroska

Copy link
Copy Markdown

I measured where DirectStorage access failures were reported during a GTA VI world-load run on Windows with an RTX 3080. I used a separately instrumented build (local 00e4c7f, based on 20cf130) with the parallel decode pool off and fresh XCL caches. The run lasted 300 seconds and reached world loading after Confirm.

All 93 reported failures landed in the serial physical-destination stage. That count matched the failure total in the ordinary runtime logs. The other nine instrumented stages stayed at zero, and both sampled warnings carried 0x89240009.

My counter groups two checks together: a missing physical-page list and a rejected physical-destination write. Distinguishing those two cases on the same route would be the most useful comparison with this PR’s per-request diagnostics. The viewport later went black, but this run doesn’t establish whether either check caused the stall.

I used Codex with GPT-6.2 Sol (high) to run the measurement. A separate GPT-6.2 Sol agent verified the counts against the saved logs. GPT-6.1 Terra (medium) checked for overlap with existing upstream reports.

@Gevroska

Copy link
Copy Markdown

I followed up on my earlier RTX 3080 report with a build that distinguishes zero destination pages and records how the queue was submitted. In this run, all 1,374 reported DirectStorage failures fell into the same category: the queue drained automatically at the half-full threshold, and the worker still read a zero destination page when it checked again. The counters identify the drain path and the worker’s observation. They don’t tell us what the page entry contained at submission time.

In a later run on unmodified main (bf9eebd), I confirmed that the title requested AutoSubmitDisabled and reached world loading. That run recorded zero failures across 88,113 DirectStorage requests. Since the baseline didn’t reproduce the failures, I didn’t run the #1790 candidate in-game. I can’t attribute the black screen to these failures or draw a conclusion about that patch.

I used Codex with GPT-6.2 Sol for the runs and a separate GPT-6.2 Sol agent to verify the saved measurements. GPT-6.1 Terra checked for overlap with existing upstream reports.

@throny throny added the goal:world-load Bears on the retail title getting past world loading label Nov 25, 2026
@DavidM1911

Copy link
Copy Markdown
Contributor

Verification on RTX 3060 Ti (Windows 11): merge conflict with current main — needs a rebase before it can be tested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

goal:world-load Bears on the retail title getting past world loading

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants