DirectStorage: a late page array holds a half-full queue until Submit #549
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!549
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-549"
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?
@papasmurph0 on GitHub · 2026-11-24 01:38 UTC · original
papasmurph0:dstorage-late-page-arrays→main· +123 −12 · 1 files · 1 commits · draftA retail title fills a destination page array entry after
EnqueueRequestand before its ownSubmit. #289 rereads such an entry at the request's turn, but a half-full queue submits by itself, so during the title's loading bursts the worker reaches the request first and it fails withE_ACCESS_VIOLATION(0x89240009). Part of #476: the missing entries are now read on the title's thread atSubmit, which narrows that issue's window.What is in it
crates/xcl/src/hle/dstorage.rs:Pending::latecounts requests whose destination array had a0entry. A half-full queue holding one doesn't submit by itself. The title'sSubmitrefills the missing entries (refill_late_pages, throughsnapshot_page_array/ReadProcessMemory). #289's reread stays as the fallback.a_late_page_array_holds_a_half_full_queue_until_the_titles_submit. It fails without the change.Tested
cargo test --workspace -- --test-threads=4at1870880: 677 passed, 0 failed, 41 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.XCL_RUN_SECONDS=230, with a local failure counter by HRESULT on both builds (not part of this PR):main: about 2,850 failures with0x89240009(counted in steps of 50), plus 1,050 BCPack refusals.0x89240009, plus 161 BCPack refusals.title_textures(refresh→note_gpu_write, copying a page that was no longer mapped). This PR doesn't touch that code, and it's the same kind of race as #454/#484.main's run didn't hit it. One run each.Regression run
Not tested
Submitafter enqueuing such a request. Its requests would then wait for the nextSubmit.AI use
https://claude.ai/code/session_01SEW8zXNUmMq1tRUZpstWXS
github-bot referenced this pull request2026-11-26 04:59:09 +00:00
@dervoxx on GitHub · 2026-11-24 03:32 UTC · original
Additional local validation of the late-page change: the baseline recorded 3,972 DirectStorage
destination_physicalfailures withpage_reason: zero_page(3,906 + 66). Two runs with a local port of the change recorded zero each. The local Submit counter recorded 32,816 and 33,604 destination page IDs populated at explicitSubmit, respectively. The local port checks the autosubmit guard under the pending-queue lock and includes that counter.Both patched runs still crashed before reaching the prologue, and BCPack refusals remained. The measured improvement is specific to the zero-page DirectStorage failures.
@Celegans12 on GitHub · 2026-11-24 06:10 UTC · original
I ran into the same failures independently before finding this PR, so here's a second machine's
numbers – it lines up with your diagnosis.
How I got there. On a laptop I added a local log line for every failed DirectStorage request
(main only logs the first one per queue). During world loading almost all of the
0x89240009failures were zlib requests with a destination page array (options
0x200001) whose entries wereall 0 when the worker reached them – #289's reread at the request's turn still saw 0. XCL never
hands out page 0 (
page_number = (index + 1) * FRAMES), so the title simply hadn't filled them yet.Only letting the queue submit itself when it's full (a local experiment, not your approach) took
them from 2,171 to 0 on the base I had then.
This PR on my machine. Your commit on
maine50836b(clean pick), release build, same title,same save,
XCL_NETWORK=0, 240 s throughscripts/smoke.ps1, scripted A presses; a local failurecounter on both builds (not part of the PR).
0x89240009failures0x89240030)e50836be50836bOn the older base (
64b3f35) the same burst was about 2,000 failures, so main has already narrowedthe window a lot since; this PR closes what's left. Both runs still end in world loading (main: read
of
0xffffffffffffffffat+0x43a6b7a, 86.9 s; #549: read at0x527c,+0x4e59848, 84.9 s) –with BC1 still refused, that looks like the next missing data rather than anything in this change.
Adding Kalmarv's #208 + #273 (BC1) on top of #549 bears that out: failures fall to 302, all
BC5/BC6H/BC7 refusals, the garbage reads are gone, and the run ends instead in the familiar
+0x23cf683watchdog at 105.8 s (#232) – the compute-pipeline stall, not missing data.Setup and test suite
Rust 1.100 MSVC, DXC 1.9.2609.
cargo build --workspace && cargo test --workspace -- --test-threads=4on #549-on-e50836b:705 passed, 0 failed, 41 ignored; SKIPPED (no wave64):
gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.Not tested: AMD, runs longer than 4 minutes, the PR on its own base.
AI use: Claude Code with Claude Opus 5.5 built and ran everything, wrote the local counter and drafted
this; I reviewed it before posting.
@badoomtch on GitHub · 2026-11-24 06:52 UTC · original
One input pattern worth covering in
refill_late_pagesis two pending file requests that use the same page-array address and write disjoint byte ranges. I measured this on Windows with an RTX 5080, in an offline run of a retail title. The instrumented build was based onaf20b4b38e5a, with a local change to inspect page arrays at explicit Submit on manual file queues.In one run, 17,639 requests shared a table start with another pending request, had disjoint proposed destination writes, and had no other Enqueue snapshot that independently identified the missing page. Another 26 had partially overlapping tables with the same properties. These are counts of requests, not distinct tables. The local build left those requests alone. It adopted 6,612 independent snapshots in that run and completed all 6,612 file reads (1,488,826,368 bytes).
A small test case for this PR would enqueue two file slices against one initially empty table, fill it before Submit, reuse the table immediately afterwards, and check both destination byte ranges and their untouched neighbours. The counters establish that sharing occurs. They do not tell us whether the title intended to recycle the table, or whether either destination was incorrect. This was a local experiment, not a run of
1870880.AI use: Codex (GPT-6) checked the per-run counters and the PR diff and drafted this note.
@JFyuhong on GitHub · 2026-11-24 08:57 UTC · original
I tested the late-page change on Windows 11 build 26300, i7-14650HX, 32 GB RAM, RTX 4060 Laptop 8 GB, NVIDIA 616.92. Both release builds ran the same retail 1.0.2.1 story load with the same saved profile, initial cache, four memory windows and default pipeline waits. I ran
xcl runonce per build withXCL_ACTIVITY=1andXCL_DSTORAGE_FAILURE_DETAILS=1.The control was #905 at
d19a3d3a727dwith diagnostics from #816 (2ffb5a4ebaef), #899 (c3d54293d2f1) and #924 (dc0fb788704f), local Git treecbe61bec7ffc765090e73efb9895586f3a278ab9. The second build added the queue change from this PR at187088002783, preserving the submission-origin diagnostics, tree7e16903531f94f7cd578bc3b4a44018dd51334d5.All eight detailed failures captured in the control were
HalfFullsubmissions on queue 12, withstage=DestinationPagesand zero entries both in the captured page array and on reread. Both runs later exited with the same guest null write at+0x23cf683. The focused testcargo test --release -p xcl --lib a_late_page_array_holds_a_half_full_queue_until_the_titles_submit -- --nocapturepassed on the second tree (1 passed, 0 failed, 0 ignored).AI use OpenAI Codex (GPT-6) prepared the local builds, ran the tests and wrote this report.
@Ali-AbdulHadii on GitHub · 2026-11-24 12:29 UTC · original
Retail data from Linux for this PR: the failure it fixes, and a run with it merged.
Setup: RTX 5080 (NVIDIA 620.73.04), proton-cachyos-slr Wine, vkd3d-proton master
30b0eb9+ the repo patch. XCL: a local branch ofmain47efa2e(+ #640 and others), retail title 1.0.2.1 loading its world.0x89240009(the first: 64 KiB fromttdb\props\octa_imposters.ttpf). The title stopped submitting right after, and its watchdog ended it ~30 s later (+0x23cf683).write_physical_pagesrefusing destination page arrays that still held a0entry at the request's turn (ttdb\vfx\ttdb_vfx.ttpf, 128 KiB – 4 MiB).0entry a hole: the other pages are written and an all-0array is still refused. That did not make the failures go away. In the next 11 runs they were nearly all arrays with no page at all yet: 128 to over 2 048destination physical pages all 0per run (the counter logs at powers of two). So the arrays are filled after the worker gets there, which is what this PR reads into.With this PR merged (head as of today, on the same branch, stopgap still in): 0 DirectStorage failures in a 270 s world-loading run, where the 11 runs before had 128 to over 2 048 each.
a_late_page_array_holds_a_half_full_queue_until_the_titles_submitpasses here too. The run still ends on the title's watchdog, for other reasons (compute pipelines still being built).Not tested: Windows, AMD.
AI use: Claude Code (Claude Opus 5.5) found this in the run logs, ran the PR and wrote this text; the user approved posting it.
@ArturoWolff on GitHub · 2026-11-24 13:59 UTC · original
Linux RTX 4060 (8 GB), 16 GB RAM, NVIDIA 620.73.04, GE-Proton11-14; retail 1.0.2.1, Series X profile. Five runs used the same unmodified release binary from
47efa2ecea0a12934719ae69b81930cf02a4b1c3, with different run settings. A run on the baseline can have zero DirectStorage failures even well into loading. This matters when interpreting a single zero-failure run on a patch.0x89240009. In three, the first warning namedocta_imposters.ttpf, but the requested destination lengths differed: 32,768, 131,072 and 28,672 bytes. The fourth namedlighting.ttpf. The stock warning doesn't distinguish a refused physical-page write from other destination checks.I didn't test the PR head. This is baseline variability on a second Linux/NVIDIA configuration, not confirmation or refutation of a late page array. For comparisons here I'd report the first same-request stage and the cumulative request count alongside the failure total. No game data or logs attached.
AI use: Hermes Agent (gpt-6.2-astra) ran the local measurements and checked the activity intervals against the title logs for this note.
@komglebissarov on GitHub · 2026-11-24 14:02 UTC · original
AMD (RDNA4) run of this change: 2 072 requests failed with
0x89240009without it, 0 with itTested
main47efa2e. With it:main930e8b4with1870880cherry-picked (it applies cleanly;dstorage.rsis the same in bothmaincommits).cargo test --release -p xcl --lib dstorageon the second tree: 15 passed, 0 failed, 0 ignored.xcl run <game folder>withXCL_NETWORK=0 XCL_ACTIVITY=1 XCL_PSO_WAIT_MS=50, menus passed by hand, into the story load. One run each; the run with the change also hadXCL_FRAME_DUMP=1.47efa2e930e8b4+ this change0x89240009(2 069 of them in one 2 s window of the load)Wait64BitValueXtimeouts#1010x80000003attitle+0x4da63150x887a0006The run with the change ended on a device removal 2.7 s after
split command list (type 2) around mid-list Wait after Write64 (#2); the last 2 s window before it had 6 submits with 835 dispatches. I cannot tell from one run whether that has anything to do with this change.Not tested
main, and its run had frame dumps on.scripts/smoke.ps1.AI use: Claude Code (Claude Fable 5.2) built both trees, ran the tests, read the logs and wrote this report. A person passed the menus. All numbers are from the logs of these two runs.
@shelbykb2 on GitHub · 2026-11-24 14:29 UTC · original
@papasmurph0 a follow-up to
refill_late_pages, measured on an AMD RX 6800 with a newer retail game: the title also rewrites entries that were not 0 atEnqueueRequest. A local diagnostic compared each destination array at the title'sSubmitand at the request's turn with the copy kept. Of 33,050 requests, 6,173 had entries rewritten beforeSubmit(9,105 entries, 0 cleared). Nothing changed afterSubmit, and 0 arrays were unreadable.Plan: at the title's
Submit, take every entry that is not 0 from the array as it is then. A 0 keeps the enqueue copy, and so does an unreadable array. Every request with a page array holds the half-full auto-submit. In 6 runs with this, none ended on the title assert that ended the run without it.It is a small commit on top of this PR, with two tests. You can fold it in, or I can open it stacked on this one.
Measured in runs on my machine; the diagnostic, the change and this report were written with Claude Code (Claude Opus 5.5, reviewed with Claude Fable 5.2).
@einfachama on GitHub · 2026-11-24 14:49 UTC · original
Test report for #549 at
1870880, merged locally ontomain47efa2e(no conflicts), on my retail title's world load. On this title it removes the0x89240009failures: 0 in 4 runs, against failures in all 6mainruns.Setup
cargo build --release -p xcl).XCL_NETWORK=0,XCL_ACTIVITY=1,XCL_RUN_SECONDS=100, A pressed at 26 s and 30 s. The world load starts by itself at about 66 s.DirectStorage … failedcounts in theXCL_ACTIVITY2 s lines.Results
main47efa2emain+ #549mainruns inside an earlier 8-run A/B with another PR, then #549 /main/ #549 / #549 /main/ #549.main's failures are all0x89240009on file-source reads, 1–9 s into the world load.main+ #816 withXCL_DSTORAGE_FAILURE_DETAILS=1, run twice in the same session, wrote 10 records, allsubmit=HalfFull stage=DestinationPages destination=pageswith the destination page array's entry at 0 (dst-snapshot=[1 total/1 zero] … late-reread=Read). That is exactly the case this PR holds back.main.main.main's only one is the failure line, and #549's runs have none.main, my title kills itself at+0x23cf683at 122.7 s and 123.8 s, ~30 s after its presents stop at ~94 s, the heartbeat watchdog from #505/#232. A 100 s run ends before that. JFyuhong's report on this PR found the same stop with and without it.Not tested
cargo testwas not run on this merge, nor was the PR's test on its own.AI use
@Royalflamejlh on GitHub · 2026-11-24 14:53 UTC · original
Linux (Wine + vkd3d-proton) + NVIDIA test of
1870880onmain67a3735+ #684, 5 alternated runs of 100 s each way of a retail title: without it DirectStorage requests failed with0x89240009in 5 of 5 runs (3 to 2,032 of them), with it none failed in 5 of 5.Setup: Fedora 44 (kernel 7.2.9), Wine 11.21 Staging (Wayland driver), vkd3d-proton v3.1-90-g30b0eb9b with the relaxed-vtable patch from #175 and a local dxil-spirv patch. RTX 4070 12 GB (driver 615.71.09), Ryzen 9 9950X3D, 64 GB RAM. Release, cross-compiled to
x86_64-pc-windows-gnu(rustc 1.98.0),XCL_NETWORK=0,XCL_PSO_PRELOAD=0. Retail title 1.0.2.1, the first-run screens completed once and no story progress, one A press at 44.8 s throughXCL_PRESS_AT.1870880merged ontomain67a3735+ #684 (e56dbc3) without conflicts. Counts are the sums offailedin theactivity (2 s)lines (XCL_ACTIVITY=1).Tested
cargo test --release -p xcl --lib a_late_page_arrayunder Wine, on the merge: 1 passed, 0 failed.67a3735+ #684, runs 1 to 51870880, runs 1 to 5a request failed (0x89240009)warningsWithout the change the failures come in one burst, nearly all within one 2 s window between 74 s and 90 s of the run (for example 1,994 in the window ending at 82 s), during the world load. The files named in the warnings are the title's texture tables (
data\ttdb\…). No fault and no device removal in any of the ten.Read
dstorage.rs:1194(submit_if_half_full) and:1074(submit): a queue holding a request with a missing page entry no longer submits by itself and waits for the title'sSubmit, whererefill_late_pages(:1007) reads the entries on the title's thread. In these runs that held nothing up that I can see: the request totals and frame counts of the two trees overlap.Submitwould now wait on a half-full queue. This title calls it: no request failed in these five runs.Not tested: past 100 s, so not the
title_texturesfault the description saw at 222 s; the preload of #690 on; the rest of the test suite; AMD and Intel.AI use: Claude Code (Claude Fable 5.2) read the diff, built the tree, ran the test and the ten runs with
XCL_PRESS_AT, summed the counters and wrote this report.title_memory_budget_mbis 13,824 MB regardless of the adapter's memory #1337@pickles976 on GitHub · 2026-11-24 15:52 UTC · original
Bumping with emphasis because the queue has jammed elsewhere and this has sat done-with-evidence since 14:53Z: Royalflamejlh's five alternated 100 s Wine/NVIDIA runs are the cleanest A/B posted on any thread this weekend — 5/5 fail-then-5/5 pass on the same build plus #684, DirectStorage request failures eliminated. Meanwhile #1337 today added an independent field data point of the same class from the other direction (texture-page failures at streaming start surviving everything else), and the mechanism is not speculative: enqueue-time page-array snapshot (
dstorage.rs:697) with refill at submit is exactly what the trace picture in #175 predicts. If the hold-up is review bandwidth — 460+ open issues will do that — this is the one to spend it on: it is scoped, it has reproduction and fix-validation from a third party, and three separate threads' failure counts depend on it.@kesku on GitHub · 2026-11-24 17:20 UTC · original
Half-full check happens before
submitlocks the pending queue meaning another thread can enqueue a request with missing pages in between, so it still gets submitted.Rechecking the late-page count inside the lock fixes that, may want to add!
Cancelling the last request with missing pages also leaves the late-page count set which holds up ready requests afterwards
Recomputing it after cancellation fixes
@Filip722 on GitHub · 2026-11-24 17:07 UTC · original · edited 2026-11-24 17:45 UTC
Reproduced the half-full queue failure on an RTX 5060 Laptop GPU (8 GB, NVIDIA 615.78.08), Bazzite 44 Testing and Proton Experimental 11.0-20261112, with vkd3d-proton 3.1
4522cc1and dxil-spirv1dc543f. I compared two Windows MSVC release builds on XCL930e8b4with identical local texture/mesh changes, #816 diagnostics, Series X title data and cache seeds.I also tested the one-file port on clean main
9e3831e. All 19 DirectStorage tests passed under headless Proton. The two added tests cover initial deferral, an auto-submit that must recheck readiness after another enqueue, cancellation recovery, and retaining existing nonzero destination entries on explicit Submit. The branch contains the source and synthetic tests. Clean-main port at4cd10c0OpenAI Codex with GPT-6.2-Sol high prepared the local port, ran the comparison and wrote this report.
@Razen114514 on GitHub · 2026-11-25 09:24 UTC · original · edited 2026-11-25 10:16 UTC
Native Windows follow-up (not a story-load A/B)
This is another occurrence of the already reported
HalfFull/DestinationPagessignature, not a new issue.2ffb5a4ebaefb922952d72b35901d39d04ec715e. The eight detailed0x89240009samples wereHalfFull→DestinationPages; every destination page number was still zero on reread. The last 2 s activity interval counted 909 failures in 3,473 requests. The local memory guard closed the title after host commit headroom fell to about 0.1 GiB. This was not a natural crash or a confirmed out-of-memory error.9e3831e1f570d3646e53ab753b19ec07eb8f1485: 17 passed. The one-file #549 port at4cd10c0d6f43b69e1a482bd7d863cc753ec8e503: 19 passed. Both: 0 failed, 0 ignored. The two added tests cover deferral/rechecking/cancellation and preserving nonzero destination entries.Not tested: No fresh title run with the port; I could not verify the local package's publisher. No claim about reduced real-game failures, the black screen, or playability. This is a focused retest, not the full suite.
AI use: OpenAI Codex reran the focused tests, checked the previous diagnostic evidence, and drafted this note (model ID not exposed).
Follow-up: same synthetic test on main
568e7dbNative Windows 11 (build 26200), base
568e7db7729c8fa6c8f0f4b32d798faaf11462bb. Both local trees ran the identical synthetic fixture: a capacity-four queue receives a memory-source request with an initially zero destination page number, plus a status entry. The test supplies the page before calling explicitSubmitand checks both request status and the payload it writes.Submitwith0x89240009instead of stayingE_PENDING. The focused assertion failed as expected (0 passed, 1 failed).4cd10c0d6f43b69e1a482bd7d863cc753ec8e503E_PENDING, then becameS_OKafter explicitSubmit. All 37 payload bytes matched. The focused test passed.The focused command uses a local test fixture, not a test in either public tree. Clean main's DirectStorage suite passed 18 tests; the patched tree passed 19 including this fixture (0 failed, ignored or skipped in either suite). No #1464 changes were included. This confirms the premature submission in this synthetic case only, not a game or story-load fix.
AI use: OpenAI Codex wrote and ran the synthetic fixture, applied the existing runtime hunks in the local test tree, and drafted this follow-up (model ID not exposed).
Reusable test-only patch
The diff below adds just the synthetic fixture; it changes no runtime code. Save it as
0001-synthetic-test.patch(UTF-8, LF) in a disposable checkout. The exact reproduction is pinned to568e7db7729c8fa6c8f0f4b32d798faaf11462bb. To try a different candidate, apply only this fixture to that branch aftergit apply --checksucceeds. No title data is needed.Run in a Windows x64 MSVC developer shell with Git, the Rust MSVC toolchain and Windows SDK available:
A reproduces the assertion
before explicit Submit: expected pending, got 0x89240009; B with the tested reference port passes and checks the payload. A compiler error or aSKIPPEDresult is not a reproduction. Keep distinct target directories: while validating separate source checkouts, using one target directory caused Cargo to reuse A's test executable for B. The intended results were reproduced with separate target directories. Undo the fixture withgit apply -R $fixtureafter testing.Test-only patch (0001-synthetic-test.patch)
@DavidM1911 on GitHub · 2026-11-25 13:30 UTC · original
Verification on RTX 3060 Ti (Windows 11): merge conflict with current
main— needs a rebase before it can be tested.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.