Skip to content

D3D12.X: texture workers copy title memory instead of borrowing it - #2877

Open
b3IKK wants to merge 1 commit into
xcl-dev:mainfrom
b3IKK:review/2841-worker-copy
Open

b3IKK wants to merge 1 commit into
xcl-dev:mainfrom
b3IKK:review/2841-worker-copy

Conversation

@b3IKK

@b3IKK b3IKK commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

A texture subresource's bytes come from title_bytes(), which lends the title's page in place when readable says the range reads. A texture worker detiles them while the title may decommit a page; the borrow then faults in the copy — a VCRUNTIME 0xc0000005 read at a title VA (#2841).

The workers now read through title_bytes_read: read_committed copies the committed pages with ReadProcessMemory, page run by page run, and zeroes the rest, so a decommit during the copy reads short instead of faulting. The title's own submit (content_hash) keeps the in-place path.

What is in it

  • crates/xcl/src/hle/d3d12x/title_textures.rs: title_bytes_read; subresources uses it for its volume and slice reads; test a_texture_worker_copies_title_memory_instead_of_borrowing_it (a readable page is still borrowed by title_bytes; the worker helper copies it).

Tested

Regression run
Blocked on this machine by the startup preparation in #2555: on main 8b957be the preparation builds the whole form of every split compute program (26,503 shaders; the DXIL cache grew to 28,847 entries over ~1 h) and scripts/smoke.ps1 never starts the title — XCL printed no log path with -StartupTimeoutSeconds 120, 300, 600 and 3600. XCL_PIPELINE_MAX_KB=8192 does not help: those whole forms are 0.7–1.1 MB, under the cap. No smoke block is written by hand; the pair will be added once the preparation is bounded (the same branch smokes in seconds on 5b9d4ff, before #2555).

Not tested

  • the title's own submit path keeps the in-place borrow (content_hash), and a deterministic decommit-during-detile inside a title run
  • AMD GPUs, other titles, Linux / Wine

AI use

  • OpenCode, Claude Fable 5.2: implemented the worker copy and its test, checked the test fails when the worker path borrows, ran the suite and the in-title comparison, and wrote this.

A texture subresource's bytes come from title_bytes(), which lends the title's page in
place when 
eadable says the range reads. A worker detiles them while the title may
decommit a page, and the borrow faults in the copy (xcl-dev#2841).

The workers now read through 
ead_committed: it copies the committed pages with
ReadProcessMemory, run by run, and zeroes the rest, so a decommit during the copy is
read short instead of faulting. The title's own submit keeps the in-place path.

Test: a committed, readable page is still borrowed by title_bytes, and the worker's
title_bytes_read copies it (fails when the worker path borrows instead).
@b3IKK

b3IKK commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

In-title validation update: this fix is part of the stack that just ran a stable 600 s world on the RTX 5080 (0 device removals, 0 crashes, frames to 599.2 s, exit 0x0), with #684, the 2 GiB shader heap, #2519's scratch and the free_aside patch. The earlier run without #2555's startup preparation hit no VCRUNTIME read AV either; with this fix the copy path reads through read_committed, so the borrowed-page race is gone. The PR description check stays blocked by #2555's first-launch preparation on this machine; the suite (1447/0/47) and the 600 s run are the evidence.

AI use: OpenCode, Claude Fable 5.2 ran the stable stack and wrote this.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant