Repository navigation
DirectStorage: a destination page array entry that is 0 at enqueue is read at the request's turn - #289
Merged
theaustinayers merged 1 commit intoNov 23, 2026
Conversation
… read at the request's turn A retail title keeps its destination page arrays in its own tables and fills an entry after EnqueueRequest. The array is snapshotted at enqueue (titles also pass it on the stack), so such a request wrote to page 0 and was refused with E_ACCESS_VIOLATION: over 8,000 of them in the first 100 s of the title's streaming, and what they carried never arrived. An entry that is 0 in the snapshot (no page has that number) is read again when the request runs; entries that had a page keep the snapshot's. Measured on the title (RTX 5090, 170 s): 16,384 such requests found their page at their turn, 2,227 still had 0 and are refused as before. Assisted-by: Claude Code (Claude Fable 5.2)
This was referenced Nov 23, 2026
T-Crypt
added a commit
to T-Crypt/bathyal
that referenced
this pull request
Nov 23, 2026
… read at the request's turn From xcl-dev/xcl#289 by @theaustinayers, squashed.
|
Independent static code audit of Summary: Looks clean and well-targeted
Minor edge-case notes
(AI-assisted) |
theaustinayers
added a commit
to theaustinayers/xcl
that referenced
this pull request
Nov 23, 2026
The fork, rebuilt on current upstream main with only what upstream does not have: the launcher's folder picker, click-to-capture mouse handling with F8 and Page Up / Page Down, a heap per DXC compile thread, the limit on waits for pipelines still being built, the installer, build.ps1, BUILDING.md, the release workflow and the README. Everything else the fork carried is in upstream now (ivall#195 in parts, ivall#211, ivall#244, ivall#252, ivall#283, ivall#289) or was a diagnostic. Co-Authored-By: Claude Fable 5.2 <[email protected]>
anoyarou
added a commit
to anoyarou/xcl
that referenced
this pull request
Nov 24, 2026
…fallbacks Incorporate targeted upstream fixes from ivall/xcl PRs and local diagnostics to resolve world-loading E_ACCESS_VIOLATION streaming errors, fence monitor deadlocks, and mesh/compute PSO visibility: - DirectStorage (ivall/xcl PR xcl-dev#549; relates to xcl-dev#289, xcl-dev#476, xcl-dev#1164): * crates/xcl/src/hle/dstorage.rs: Add Pending::late and refill_late_pages() so queues with 0 entries in destination physical-page arrays do not auto-submit at half capacity before the title calls Submit() and fills the page entries. Add unit test a_late_page_array_holds_a_half_full_queue_until_the_titles_submit. * Ensure lazy physical pages via kernelx::lazy::ensure() in snapshot_page_array() and before re-reading stale destination page tables on execute() failure, logging failing snapshot/live entries (adds test dest_physical_pages_rereads_stale_snapshot). - D3D12.X fences (ivall/xcl PR xcl-dev#1297): * crates/xcl/src/hle/d3d12x/fence_x.rs: Track all intermediate queued signal values in Fence::pending (BTreeSet<u64>) before completed_value_address() creates the cell, initialize the cell from GetCompletedValue() before publishing, and arm all pending values > initial so *cell cannot remain stale at 0 and deadlock callers waiting on intermediate fence values. Adds test intermediate_signal_queued_before_completed_value_address_updates_cell. - D3D12.X PSOs (ivall/xcl PR xcl-dev#1300 / xcl-dev#1035 and PR xcl-dev#1298): * crates/xcl/src/hle/d3d12x/real.rs: Log driver rejections of translated compute PSOs (hr, DXIL byte size, elapsed compile ms) directly via xlog_warn! so refusals are not masked after note_translation_error's 40-reason limit is consumed (PR xcl-dev#1300). * Update fallback_stream() to handle subobject types 24/25 (AS/MS) so mesh pipelines with MS in slot 24 rewrite cleanly with stand-in mesh shaders instead of invalid null AS payloads (PR xcl-dev#1298). Assisted-by: Antigravity (Gemini 4 Neon)
CalvyPZ
pushed a commit
to CalvyPZ/xcl
that referenced
this pull request
Nov 24, 2026
…xcl-dev#476) A destination page array entry that is 0 at EnqueueRequest is read again at the request's turn (xcl-dev#289). That read checked `readable()` and then dereferenced the title's memory: an array the title unmapped between the two faulted in the xcl-dstorage worker and ended the process. It now reads with `read_own` (ReadProcessMemory), as the snapshot at enqueue already does: the request fails with E_ACCESS_VIOLATION instead. An array the title frees and reuses before the request's turn cannot be told from a late fill; the title keeps it until the request is done, as the comment now says. The test runs 20000 requests with a deferred entry while another thread decommits and recommits the array's page: before, the test process ended with 0xc0000005 (5 of 5 runs); after, it passes (10 of 10). Fixes xcl-dev#476 Assisted-by: Claude Code (Claude Opus 5.5)
CalvyPZ
pushed a commit
to CalvyPZ/xcl
that referenced
this pull request
Nov 24, 2026
A retail title enqueues requests whose destination page array has an entry of 0 and fills that entry after EnqueueRequest, before its own Submit. xcl-dev#289 reads such an entry again 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 before the title has filled the entry: the reread still sees 0 and the request fails with E_ACCESS_VIOLATION (0x89240009). Logged on a local build: every refused request had a one-entry array still holding 0 at its turn. Now a queue holding such a request does not submit by itself; the title's Submit reads the missing entries again on the title's own thread (through ReadProcessMemory, as at enqueue), where the array is still the title's - which also narrows the window xcl-dev#476 describes. An entry still 0 then is read again at the request's turn, as before. Test: a capacity-2 queue does not run a request with a missing page before Submit, and the request lands once the title fills the entry and submits; it fails without the change. Assisted-by: Claude Code (Claude Opus 5.5) Claude-Session: https://claude.ai/code/session_01SEW8zXNUmMq1tRUZpstWXS
CalvyPZ
pushed a commit
to CalvyPZ/xcl
that referenced
this pull request
Nov 24, 2026
A retail title keeps its destination page lists in slots of its own table and writes a slot's pages after EnqueueRequest. At enqueue such a slot can still name the pages of the slot's previous request, and the snapshot taken then is what execute() wrote to (xcl-dev#289 rereads only the entries that are 0). Over 16 000 requests a run were written into pages the title had since reused: its objects got garbage pointers and it crashed about 20 s into world loading; when the old pages were freed, the request failed with E_ACCESS_VIOLATION. The console reads the list when it runs the request. execute() now reads it again (through read_own, as the snapshot) and takes it when it differs and every page in it is allocated (kernelx::physical_pages_live); otherwise the snapshot stays, so arrays on the stack that were overwritten since still work. Co-Authored-By: Claude Opus 5.5 <[email protected]>
theaustinayers
pushed a commit
to theaustinayers/xcl
that referenced
this pull request
Nov 25, 2026
A retail title keeps its destination page lists in slots of its own table and writes a slot's pages after EnqueueRequest. At enqueue such a slot can still name the pages of the slot's previous request, and the snapshot taken then is what execute() wrote to (xcl-dev#289 rereads only the entries that are 0). Over 16 000 requests a run were written into pages the title had since reused: its objects got garbage pointers and it crashed about 20 s into world loading; when the old pages were freed, the request failed with E_ACCESS_VIOLATION. The console reads the list when it runs the request. execute() now reads it again (through read_own, as the snapshot) and takes it when it differs and every page in it is allocated (kernelx::physical_pages_live); otherwise the snapshot stays, so arrays on the stack that were overwritten since still work. Co-Authored-By: Claude Opus 5.5 <[email protected]>
mgrein
added a commit
to mgrein/xcl
that referenced
this pull request
Nov 25, 2026
A retail title keeps its destination page lists in slots of its own table and writes a slot's pages after EnqueueRequest. At enqueue such a slot can still name the pages of the slot's previous request, and the snapshot taken then is what execute() wrote to (xcl-dev#289 rereads only the entries that are 0). Over 16 000 requests a run were written into pages the title had since reused: its objects got garbage pointers and it crashed about 20 s into world loading; when the old pages were freed, the request failed with E_ACCESS_VIOLATION. The console reads the list when it runs the request. execute() now reads it again (through read_own, as the snapshot) and takes it when it differs and every page in it is allocated (kernelx::physical_pages_live). A list that was on the enqueuing thread's stack keeps the snapshot: that memory is reused once the call returns, and a page ID written there since can belong to another live allocation. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A title that keeps its DirectStorage destination page arrays in its own tables, and fills an entry after
EnqueueRequest, had those requests refused withE_ACCESS_VIOLATION(0x89240009): the array is snapshotted at enqueue, the snapshot held page number 0, andwrite_physical_pagesrefuses a page that is not live. With this change an entry that is 0 in the snapshot is read again when the request runs. No issue is open for it; I searched open and closed PRs for "page array", "DestinationPageArray" and "physical pages DirectStorage" and found none covering it.Reproduced on main (
9ab7d76): a retail title, launched withscripts/smoke.ps1 -Game <folder>(XCL_NETWORK=0, 60 s, no input), reaches its first screen (an account prompt) and starts streaming in the background. In that run the activity lines add up to 28,298 DirectStorage requests, 537 failed, and the log hasDirectStorage: a request failed (0x89240009): 65536 bytes from …for texture pool files. With extra logging on a local build, each refused request hadoptions 0x200001(zlib, destination is physical pages), a one-entry page array holding0at enqueue, and the same address holding a live page number (for example0x80f50) by the time the request ran.What is in it
crates/xcl/src/hle/dstorage.rs,execute: when the enqueue-time snapshot of the destination page array contains a 0, those entries are read again from the title's array; entries that had a page keep the snapshot's value, so an array passed on the stack and overwritten after enqueue behaves as before (the existingphysical_page_destinations_and_sourcestest still covers that).a_destination_page_filled_in_after_enqueue: an array whose second entry is 0 at enqueue and gets its page beforeSubmit; the data must land across both pages, and an array still 0 at the request's turn must still fail withE_ACCESS_VIOLATION. It fails without the change (S_OKexpected, 0x89240009 returned) and passes with it.Tested
D3D12.X: backend 'real' – NVIDIA GeForce RTX 5090).cargo build --workspacethencargo test --workspace -- --test-threads=4ond0b6079(debug): 651 passed, 0 failed, 40 ignored (lib 612 / 0 / 20).gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware(no wave64).d0b6079: 24,067 DirectStorage requests, 157 failed, no 0x89240009 line in the log (main: 28,298 / 537). I did not break the remaining 157 down by code in this run. On a longer run of a local build with the same change and a counter (170 s into streaming): 16,384 requests found their page at their turn, 2,227 still had 0 and were refused.Regression run
The
gpu:line is the firstWin32_VideoControlleron this PC (the CPU's integrated graphics); XCL ran on the RTX 5090 in both runs. The blocks are as the script wrote them.main:
this PR's head:
Not tested
SourceIsPhysicalPages) with a 0 entry: not changed.AI use