Skip to content

D3D12.X: integration branch that reaches the in-world HUD on NVIDIA (reference, not for merge) - #2057

Draft
theaustinayers wants to merge 87 commits into
xcl-dev:mainfrom
theaustinayers:integration/nvidia-world
Draft

theaustinayers wants to merge 87 commits into
xcl-dev:mainfrom
theaustinayers:integration/nvidia-world

Conversation

@theaustinayers

@theaustinayers theaustinayers commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Draft, for reference only: the tree my runs of the newer retail title of #505 use on an RTX 5090, so that others can build and run the same thing. It is not meant to be merged as it is. Most of it is other people's open PRs; my own commits on top will be split into small PRs (list below). Merged with main at 568e7db.

The game runs listed under Tested were made with the same commits on an older base (7f7e768, no rebuild of the shader caches needed there). This merged tree has unit and GPU tests but has not run in the game yet: its compute pipelines are being built now.

What is in it

Other people's work:

New commits, each to become its own PR or a note on the PR it changes:

  • Hang and freeze: 16826cb, 3877446, c28d531 the counts of an ExecuteIndirect are read by a program of XCL's before the GPU runs them; f98a1d6 D3D12.X: a wait an earlier signal covers does not make a signal a cycle #2052's rule for title fences; 0d25b89 the console's cache flushes (list #131, Add synthetic Cargo benchmark suite #132, FlushPipelineX) are UAV barriers; dc651ea a tile a placed buffer uses stays mapped
  • Loading: 70a160e, 0764a57 on Memory: new sparse tiles are mapped together before the next submit #1517 (a mapping put off goes before a CPU or queue signal, before lists that follow a CPU wait, and after 2 ms at the latest); 6112bd8 on kernelx: commit a mapping call's sparse pages once per run, not per page #1792 (a page with data is told to the sparse windows before its bytes come: a look in between dropped them); f659f75 the mapped runs and the pieces to clear are kept in order; 77be198 a thread that maps memory lets waiting submits have the sparse lock first (171 ms median wait → 0.14 ms in a test); 04c2fe7 a texture whose memory is not all there is read region by region
  • Uploads: 80dc4dc small CPU writes go up in one dispatch; 73fc616, 0b66349, b659291, f064c82 the parts of a texture that changed go up, through lists and buffers that are kept, in order across queues; a261e72 what a file read puts into graphics memory is a known write; 55e58c3 readable asks the working set
  • Recording: 6e7040b, 2987c19 what each recorded call looks up is kept in parts with a lock each; 680a719, 0ba3b8c last releases
  • Looks: 7c18bc4 and after it (blocks written lately, a thread walks the rest; off with XCL_WATCH_HOT=0). Not strict: a write to a block that was idle reaches video memory up to about 20 ms late. a004fe7 XCL_LOOK_AHEAD=ms (off; known gaps, see its commit)
  • 414adb2 one device is opened at a time (two test threads made two and opened the memory windows for each)
  • 9baaa6f a compute pipeline's driver blob reaches the disk cache although the memory store is full; 5ea55e2 XCL_PRECOMPILE_SLICE=i/n
  • 1225bb9, 5e3c657, b5e8baf on top of D3D12.X: a copy back after a submission does not wait for the title #1993
  • Diagnostics (XCL_ACTIVITY call times, XCL_LOOK_STATS)

Tested

Regression run

  • none: a reference branch, not for merge.

Not tested

  • This merged tree in the game; AMD; other titles; a cold shader cache.

AI use

  • Claude Code, Claude Fable 5.2 and Claude Opus 5.5: wrote the new commits and their tests, made the runs on the hardware above and wrote this description. The upload and loading commits were reviewed by separate agents (Claude Opus 5.5).

🤖 Generated with Claude Code

vakaobr and others added 24 commits November 24, 2026 17:48
Helpers for the copy path that changes no behaviour yet:

- sparse.rs: extract new_state from the inline closure in init, so
  shadow_window (next commit) can call it when no sparse windows exist
- uma.rs: Uma::shadowed flag and is_gpu_copy(p): a sparse window or a
  committed one the GPU has a copy of. Never set to true in this commit.
- list_x.rs: note_copy_into tracks PC copies into console buffers whose
  memory the GPU has a copy of; note_write uses is_gpu_copy
- real.rs: uma_shadowed helper, res_map and dev_create_placed_resource_x
  use is_gpu_copy (= is_sparse while shadowed is false)

Based on Ahmet-Dedeler's c70bf8a on mac-on-main-wip.

Co-authored-by: Ahmet Dedeler <105894172+Ahmet-Dedeler@users.noreply.github.com>
Assisted-by: Claude Code (Claude Opus 4.6 ported it; Claude Opus 5.5 reviewed it)
D3DMetal 3.0 applies SetPredication for draws, dispatches and
ExecuteIndirect but not for copies: a predicated CopyBufferRegion runs
unconditionally. The UMA shadow path (next commit) makes UMA available
on this host, so the predication test would run and fail.

A one-copy probe detects whether a predicated copy is skipped (Windows,
any real D3D12) or run (D3DMetal). When run, the test skips with
"host ignores SetPredication for copies" instead of failing.

Based on us3r40456's bisect and measurement in xcl-dev#258.

Co-authored-by: Ahmet Dedeler <105894172+Ahmet-Dedeler@users.noreply.github.com>
Assisted-by: Claude Code (Claude Opus 4.6 ported it; Claude Opus 5.5 reviewed it)
D3DMetal answers E_NOTIMPL for OpenExistingHeapFromAddress. A committed
UMA window is then a buffers-only heap of video memory (Uma::shadowed),
kept in step like a sparse window's tiles (sparse::shadow_window): CPU
writes go up before each ExecuteCommandLists (the window's write watch),
GPU writes come back on Map and after the lists' memory writes, and PC
copies into console buffers there are read back after the submit
(list_x::note_copy_into). XCL_UMA_SHADOW=1 forces the path on a GPU
that has such heaps, =0 never.

On main 930e8b4: the start-up check that the GPU sees CPU writes
(check_uma_import) is not run for a shadowed window (it is a copy by
design); sparse::new_state carries the new parked list. The runner's
run_in_region falls back to upload/readback copies per window on
E_NOTIMPL. The sparse test's shadowed readback and constant-rewrite
stress validate the data path.

Part of xcl-dev#258.

Based on Ahmet-Dedeler's c70bf8a on mac-on-main-wip.

Co-authored-by: Ahmet Dedeler <105894172+Ahmet-Dedeler@users.noreply.github.com>
Assisted-by: Claude Code (Claude Opus 4.6 ported it; Claude Opus 5.5 reviewed and fixed the import-check assertion)
…ough the memory store is full

The disk cache of compute driver blobs (xcl-dev#634) wrote a blob only when the
in-memory store had taken it first: keep_compute_blob stored it there within
COMPUTE_BLOBS_MAX (512 MB) and the caller then looked it up for the file. Once
the store was full the lookup found nothing and no later build was written.
Those are the builds that matter most: a retail title's world needs compute
pipelines of 20 to 150 s each in the NVIDIA driver, made after hundreds of
smaller ones, and it built them again in every run.

keep_compute_blob now returns the blob it fetched; it is kept in memory only
while there is room (remember_compute_blob), and goes to the disk either way.

Assisted-by: Claude Code (Claude Fable 5.2)
D3D12.X: eliminate multi-heap UpdateTileMappings and per-texture Signal stalls in vram::Pages
D3D12.X: an ExecuteIndirect reads the arguments written before it
D3D12.X: promote R9G9B9E5_SHAREDEXP render/UAV targets to R11G11B10_FLOAT
`readback_after_execute` made the sparse queue GPU-wait for the title's
queue and then waited on the CPU for the copy, on the thread that was
submitting. The title's queues can wait for work that same thread submits
next (four compute queues waiting for a Write64 on q1 whose list is
recorded but not submitted yet). So the copy waited its 5 s on every such
submission, and the uploads queued behind it on the sparse queue waited
too (`before_execute` waiting for ring room). In thread dumps of a retail
title on an RTX 5090, the submitting thread is in `readback_ranges` ->
`wait_for` while another title thread waits for the sparse state's lock in
`commit_range`. lucsoft found the same cycle on RDNA3 / Linux (xcl-dev#505).

The copies now run on a queue of their own, which GPU-waits for the
title's queue, and the submitting thread returns. Readback buffers are
sized to the copy (64 KiB and up) and reused. Without a readback queue (it
could not be made), the old path runs.

The data lands in the title's memory once the copy is done, before the
title can see the work it follows is done:
- on the next submit, and from a thread that looks every 0.5 ms;
- before Map's readback and in the CPU memory waits of Wait64BitValueX
  (`settle_readbacks`), which wait for the copy once the title's lists it
  follows are done;
- in the title's fence observations: `GetCompletedValue` settles the copies
  first. `SetEventOnCompletion` hands the fence an event of XCL's own, and a
  thread-pool wait on it settles them, then sets the title's event.

The new test `a_copy_back_does_not_wait_for_the_title_queue` waits 5.0 s
on the old path and under 1 s with this change. Without the fence hooks,
the e2e test title read 0 for its Write32BitValueBottomOfPipeX after its
fence wait. With them, both e2e tests pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A retail title's intro cutscene ran at 0.3-0.5 fps with the GPU at
98-100 %, and nothing in XCL measured GPU time per draw or dispatch: the
logs could not say which console programs the GPU time went to.

With XCL_GPU_PROFILE=1 each translated draw, dispatch and ExecuteIndirect
(and an ExecuteIndirect with a PC pipeline) gets a timestamp query on its
PC list before and after it, resolved right behind it into a readback
ring of 2^17 pairs. Nothing on the CPU waits: a reporter thread takes
the written pairs every 100 ms, and every 2 s logs the 15 console
programs with the most GPU time (every 20 s also since the start):
hash, kind, calls, total and longest ms, group counts of the longest
call, and for compute the thread group size, wave64 / split form, code
and DXIL size. Ticks are converted with a title queue's
GetTimestampFrequency. Off by default; with it off each op pays one
LazyLock read.

Overlapping queues are each charged in full, so the sum can exceed wall
time; bundles get no stamps; a recording run again without a Reset is
counted once. The resolve waits on the GPU for the op to finish, so with
the profile on a queue runs its ops one after the other. The unit tests
cover the pair states and the ranking.

Assisted-by: omp (Claude Opus 5.5)
When a bridged Wait64BitValueX times out, the watchdog logs the producer
queue's state, but not the queue.Waits XCL adds on its own: texture page
mappings (vram::before_execute), sparse uploads and tile mappings, and
sparse readbacks. They are not in SYNC_GRAPH, so a producer queue that
stands behind one of them looked like a queue with "no tracked wait".

On an RTX 3080 10 GB (driver 621.01) with the retail title, every timeout
came with the producer queue (and another title queue) waiting for the
texture page-mapping fence, about 25 mappings behind after 7.7 s; skipping
that one wait in a local experiment took the CPU releases from 4 to 0-1
per run.

note_internal_wait records each such wait per queue, and each watchdog
round logs the unmet ones next to the pending title fences. The watchdog
timeout (5000 ms) can now be changed with XCL_GPU_WAIT_TIMEOUT_MS, like
XCL_WAIT_TIMEOUT_MS for the CPU waits. No behaviour change otherwise.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015JSG96tVb4ZSAZ5WH4v95v
The newer factory's CreateQueue (slot 10) takes a 0x20-byte desc whose
u64 @0x18 is the queue's DSTORAGE_QUEUE_OPTIONS; a new retail game sets
bit 0, AutoSubmitDisabled. XCL ignored it, and a half-full queue still
submitted by itself. The title writes a request's destination page list
after EnqueueRequest and before its own Submit, so a request that the
half-full submit sent to the worker could run before its list was
written, with the pages of the slot's previous request.

Such a queue now runs its requests only at Submit, and an enqueue into
it at capacity waits until Submit, a cancel or Close takes entries, as
the console's queue stalls one. Queues made without the option, or
through the first CreateQueue, submit when half full as before. Other
option bits are logged once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ir fence; looks counted against list closes (local test)
theaustinayers and others added 4 commits November 24, 2026 21:31
`would_signal_close_cycle` took every armed wait on the target cell with
`val <= sig_val` as waiting on the new signal. A wait that an earlier
signal of the cell already satisfies (submitted on the GPU or released on
the CPU) does not depend on it. With pipelined frames – queue A waits on
cell X >= N, queue B then signals X = N + 1 after waiting on something A
signals later – every such frame was reported as a cycle, signalled on
the CPU and its waiters released before the GPU work they wait for ran.

A retail title on an RTX 4070 Laptop broke 14-32 such "cycles" in each
run's world load (traced: queue 1 waiting on 0x...fde0 >= 0x6db, covered
by queue 2's earlier 0x6db signal, counted against queue 2's 0x6dc
signal). With the fix: no cycle break in two runs of the same load.

The waiters taken now are those no earlier signal covers
(`val > max(submitted_max, cpu_signaled_max)`); a test reproduces the
traced case and keeps the true cycle detected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 <noreply@anthropic.com>
…al a cycle"

Local test only (the upstream PR is a draft, xcl-dev#2052). On this title the change left a real
multi-queue wait cycle: at 111 s of the world load all five queues waited on each other for
values one past their completed ones, the watchdog released 102 GPU waits and the title froze.
The cycle breaks logged before the change had been the false positives it meant to avoid; the
true ones it no longer breaks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kole07139

Copy link
Copy Markdown

RTX 3070 8 GB / 32 GB RAM, Windows, 4df1e6e unchanged: the whole compute pack precompiles in 46 min at 9.2 GB. In the title, presents stop at 102–124 s in all six runs; one of them ends in DXGI_ERROR_DEVICE_HUNG. In every run whose log has one, the stop comes within 2 s of the first mid-list Wait64 split.

After that stop, the title and XCL are both waiting and nothing runs:

  • no present, submit or DirectStorage request;
  • no GPU-wait timeout;
  • in thread dumps at 140, 200 and 300 s every thread is idle or blocked in a wait, the same in all three.

8ff4b02, on the same machine and settings, kept presenting up to 128–264 s.

This is an 8 GB card on Windows. The stop is at about the time @frenziedcoder's RTX 5080 loses the device on this head.

Setup

  • Hardware and software:
    • RTX 3070 8 GB, NVIDIA 617.42, 32-lane waves;
    • i9-9900K, 32 GB RAM (commit limit 38.3 GB);
    • Windows 11 Pro N 26200, Rust 1.99.0, release.
  • The retail title of Newer retail title (TitleID 7952987A): reaches world loading, then the title's GPU watchdog ("GPU Loc Sig") after ListX #101 stub #505, run from an SSD copy.
  • Settings, as in the description: XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_UMA_SHADOW=1, plus XCL_NETWORK=0 XCL_ACTIVITY=1.
  • 480 s per run (XCL_RUN_SECONDS), with A pressed every 5 s from 15 s.
  • Caches: xcl shaders <pack> --precompile --only cs --pipelines with XCL_PRECOMPILE_SLICE=i/3, 3 processes, into a fresh XCL_DXIL_CACHE. The six runs came one after another on that cache.

Precompile (2 689 compute programs)

head result time peak commit, 3 processes lowest free commit
4df1e6e 2 689 made, 0 errors, 0 refused 46 min 9.2 GB 13.0 GB
8ff4b02 2 689 made, 0 errors, 0 refused 41 min 14.5 GB 4.1 GB

Title runs on 4df1e6e

run extra settings first mid-list split ¹ last presents end
1 – – 104 s device removed 0x887a0006 at 104.9 s
2 – 104.8 s 102–104 s alive until 480 s, no present after the stop
3 – 120.4 s 120 s the same
4 XCL_DRED=1 118.0 s 118 s the same
5 XCL_DRED=1 XCL_WATCH_HOT=0 122.8 s 124 s the same
6 as run 5 + XCL_THREAD_DUMP_AT=140,200,300 116.4 s 116 s the same

¹ D3D12.X: split command list (type 2) around mid-list Wait after Write64 (#1). Run 1 has none before its removal.

For comparison, 8ff4b02 on the same cache method:

run last presents end
1 128 s alive until 480 s
2 240 s alive until 480 s
3 264 s (first mid-list split at 266.6 s) alive until 480 s

In runs 2 and 3 it presented 2–7 frames per second from ~40–60 s on.

What the stop looks like

  • Before the stop: 30 fps in the menus, and 2 s windows at 25–30 fps between 90 s and 116 s.
  • The last seconds:
    1. A burst of dispatches comes with few or no presents: 3 619 in 2 s in run 2, 7 689 in run 3, 8 520 in run 5.
    2. Then the mid-list split.
    3. Then Wait64BitValueX … bridged to GPU queue.Wait (… wait-before-signal, after_write64=false).
      • In runs 2, 5 and 6 one of these is on queue 0 for the same address, 0x704180158, with prod=qNone. In run 4 they are on 0x70417fe58 / 0x70417fe10 / 0x70417fee8, also prod=qNone.
      • In run 5 four queues also wait on 0x704180268–0x7041802a8 >= 0x8e1 with prod=qSome(1).
    4. Within ~2 s presents, submits and DirectStorage requests all go to 0 and stay there. In run 6 the last 2 s window with DirectStorage work is at 118 s: 1 139 requests, 0 failed.
  • Nothing reports a timeout: no GPU queue.Wait … did not complete within 5000 ms, no watchdog release and no device removal (except run 1). Audio keeps decoding. A few graphics pipelines are still built after the stop.
  • Thread dumps (run 6, 140 / 200 / 300 s, 146–152 threads):
    • Every XCL thread is idle, with the same stack in all three dumps:
      • xcl-pso-* and xcl-dxc-* waiting for work;
      • xcl-dstorage ×17 in QueueInner::run waiting on its channel;
      • xcl-sync-watchdog in its condvar wait (no armed GPU waits);
      • xcl-fences, xcl-copy-* and xcl-sparse-readback waiting.
    • Every title thread waits in KERNELBASE (WaitForSingleObject-style) at the same game address in all three dumps:
      • 15 workers at +0x221c3c2;
      • the title's main thread, under xcl::loader::main_thread, at +0x56a0d < +0x23cf735 < +0x8126a7 ….
    • No thread is running code in any dump.
    • So the title waits for something that never comes, and XCL is not working on anything.
    • I have not found which handle the main thread waits on.
  • On screen (I watched runs 4 and 5):
    • After the opening intro, during the world-loading screen, images flicker.
    • In run 4 whole images appeared and disappeared.
    • With XCL_WATCH_HOT=0 (run 5) it is much less: thin horizontal stripes at the top and bottom of the screen.
    • Then a steady black screen.
    • So @Eterst's XCL_WATCH_HOT finding holds here too, but XCL_WATCH_HOT=0 does not move the stop.
  • Compute is not what waits. In runs 2 and 3, 183 and 223 compute pipelines came from blobs, with 2 and 0 built cold. Graphics pipelines are still built cold at first: run 3 built 24, 13 "wanted at once", 75 s in total.
  • Memory:
    • Peak process commit 32.1–35.4 GB.
    • XCL's memory: line reports 17.5–18.4 GB of local video memory on this 8 GB card (14.9 GB on 8ff4b02), so the driver is presumably paging. I have not measured whether that matters for the stop.
  • Without this branch: on the same machine (main 6c89285 + Recompiler: compact cases share code whose branch targets differ #1448 + Shaders: DXC compiles sources over 8 MB one at a time #1660 + D3D12.X: a draw does not wait for a graphics pipeline still being built #1798, HLSL path, compute precompiled the same way), two runs ended in 0x887a0005 at 228 s and 131 s.

Not tested

  • XCL_DRED=1 on a run that loses the device. Run 1, the one removal, was without it.
  • Which handle the title's main thread waits on.
  • What the queue waits on 0x704180158 are for.
  • A VRAM budget or a smaller texture pool.
  • The unit and GPU tests on this tree.
  • Other cards.

AI use: Claude Code (Claude Opus 5.5) built the tree, ran the precompile and the runs, read the logs and thread dumps (XCL frames symbolized with the build's PDB) and wrote this report. I watched runs 4 and 5 and checked the report before posting.

@MrEjecutor

MrEjecutor commented Nov 25, 2026 •

Copy link
Copy Markdown

Test of 41303e4 on a mid-range Blackwell card: the caches fill cleanly, but world loading stops presenting at 80–90 s in 3 of 3 runs

Setup: RTX 5060 Ti 16 GB (32-lane waves), driver 621.24, Intel Core Ultra 5 225F (10 cores), 32 GB RAM, Windows 11 build 26200, Rust 1.100.0, release build of this head. The newer retail title of #505, my own copy, default console type.

Caches: 8 processes with XCL_PRECOMPILE_SLICE=0/8 … 7/8 and the run's switches built all 2,689 compute pipelines, 0 refused, in 218 minutes (on a shared machine, at idle priority). In the runs, the pipelines came from the driver cache.

Runs: XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_UMA_SHADOW=1, XCL_RUN_SECONDS=300, scripted A presses.

run XCL_UMA_SHADOW last present video memory, local (end) committed (end)
1 1 90 s 18.1 GB 34.5 GB
2 1 84 s 18.3 GB 34.7 GB
3 unset 80 s 14.3 GB 30.8 GB
  • All three show the menus at a steady 30 fps, then the loading art. In each, the last 2-second interval with presents, or the one right after it, has about 7,500–8,800 dispatches (against tens to a few hundred before); after that, no presents and almost no submits until the 300 s limit. The process stays alive; I see no crash and no release by the GPU wait watchdog in the log.
  • Just before the stop, the log has Wait64BitValueX … bridged to GPU queue.Wait (…, prod=qNone…; wait-before-signal) on queues 0 and 1, which looks like the Wait64BitValueX item still open in your description.
  • Runs 1 and 2 went past the card's 16 GB of video memory with the copy in video memory, so I ran without it: less memory, the same stop. So on this card the stop does not come from that copy.
  • DirectStorage: 87,500–88,800 requests per run, 0 failed.
  • Edit, after @kole07139's RTX 3070 report: the same marker here. In all three runs, the first D3D12.X: split command list (type 2) around mid-list Wait after Write64 (#1) comes right at the stop: at 89.8 s, 84.6 s and 79.6 s, against last presents at 90, 84 and 80 s. None of my runs ended in a device removal.

So on this card the world is never reached, and I have no frame rate in the world to compare with your 5090.

Not tested: the Series S profile; presses other than A and down; the test suite on this tree.

AI use: Claude Code (Claude Opus 5.5) built this tree, ran it on my machine and wrote this; checked by mrejecutor. No game data attached.

@ShyVortex

Copy link
Copy Markdown

Test report on 4df1e6e (this branch's head), for the "other hardware" and "cold shader cache" points under Not tested.

Setup: NVIDIA GeForce RTX 3080 Ti Laptop 16 GB (driver 32.0.16.2140), Intel i7-12700H, 32 GB RAM, Windows 11 build 26300, release build. Env: XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_UMA_SHADOW=1 XCL_NETWORK=0. Retail 1.0.2.1. Two runs, Enter pressed through the menus: one with a cold cache (25 min), one with a warm cache (20 min).

Result:

Why it stops presenting: after that point, a title thread compiles huge compute pipelines one at a time:

D3D12.X: driver compile start #1538: compute PSO, 814656 B DXIL, record 9ee3ab86b929f4d0, driver blob absent
D3D12.X: driver compile finish #1538: compute PSO, 814656 B DXIL, 12735 ms, huge, ungated here (a title thread's, cached, or gated by its caller)
  • Each takes 12–15 s on this GPU (730–850 KB of DXIL).
  • The disk cache works: 151 compiles in the warm run were "driver blob supplied".
  • None of the warm run's 25 huge records appeared in the cold run. Each run gets further through the backlog; it doesn't look like a hang.

Other observations:

  • The cold run logged ExecuteIndirect of CS … – out of range, not run (30 out of range so far), with float-looking group counts (e.g. 0x43960000 x 0x447a0000 x 0x1). The warm run logged none.
  • coherent 3998/4095 MB in every run.

Not tested: AMD; a run long enough to get through all the huge compiles.

AI use: Claude Code (Claude Opus 5.5) ran the builds and runs on the hardware above, read the logs and wrote this report.

@kole07139

Copy link
Copy Markdown

Follow-up to my report above, same RTX 3070 8 GB machine and caches, 4df1e6e: the stop at ~110 s happens with XCL_UMA_SHADOW=1 only.

  • With the shadow, the stop is the title waiting on the CPU, with every queue and fence caught up.
  • Without the shadow, the title goes on into the prologue cutscene: audio and subtitles play, but the scene is a flat violet background (the colour of the menus' backdrop).

@vakaobr, this may concern #1329's shadow. @theaustinayers.

1. What is pending at the stop, with the shadow.

  • I added a local diagnostic, about 15 lines: when XCL_THREAD_DUMP_AT dumps the threads, XCL also logs the four summaries the GPU-wait watchdog prints at a time-out (fence_x::pending_summary, internal_waits_summary, progress_summary, edges_summary).

  • With XCL_UMA_SHADOW=1 (presents stop at 110 s), the result at 135, 200 and 300 s:

    sync state at 135 s: pending title ID3D12Fences: none
    sync state at 135 s: XCL's own queue waits unmet: none
    sync state at 135 s: queues behind: no queue is behind
    sync state at 135 s: armed GPU waits 0, wait edges: 0 waits:
    

    It is the same at 200 s and 300 s.

  • So every queue has finished all it was given, and no title fence lags its signals or waits.

  • Together with the thread dumps of the report above (every title and XCL thread blocked in a wait), the title is waiting on the CPU for something that is not a D3D12 fence, and it never comes.

2. The same tree without XCL_UMA_SHADOW. Same caches, settings and inputs, XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_WATCH_HOT=0 XCL_DRED=1 (the shadow run with the diagnostic had the same plus XCL_UMA_SHADOW=1), two runs.

run stop near 100 s after it end
shadow on (6 runs, report above, + 1 with the diagnostic) yes, for good no present, submit or DirectStorage request until 480 s alive
shadow off, 1 yes, 100–170 s, the same caught-up state at 135 s resumes at ~172 s: 1 present per 2–4 s, DirectStorage busy, GPU-wait releases every ~10 s from 209 s 0x887a0005 at 363 s
shadow off, 2 no 1 present per 4–6 s up to 270 s, GPU-wait releases from 121 s (0x70417fef8, 0x70417fe68; producer one submit behind) alive, no present after 270 s

3. Why the shadow could leave the title waiting: a reading of the code, not measured.

  • sparse::readback_after_execute copies back, after each submit, the ranges a title list wrote through explicit memory operations (Write32/64, FillMemoryWith32BitValueX, CopyMemoryToMemoryX). D3D12.X: the committed window gets a copy in video memory #1329's description adds Map and PC copies into console buffers.
  • I did not find a copy back of what shaders write through UAVs into the shadowed coherent window. On the console that memory is one memory, so the CPU sees it at once.
  • If the title polls a value a compute or pixel shader writes there, such as streaming or visibility feedback or a counter, it would never see it with the shadow. That would fit what I measured:
    • a wait with nothing pending on the GPU;
    • no recovery with the shadow;
    • progress without it.
  • I have not confirmed which memory the title waits on.

Not tested

  • Which handle or address the title's main thread waits on.
  • A shadow with UAV ranges read back.
  • More runs without the shadow (two here).
  • Other cards.

AI use: Claude Code (Claude Opus 5.5) wrote the diagnostic, ran the runs, read the logs and the code, and wrote this comment. I watched the runs and checked it before posting.

Ariorh1337 added a commit to Ariorh1337/xcl that referenced this pull request Nov 25, 2026
`readback_after_execute` made the sparse queue GPU-wait for the title's
queue and then waited on the CPU for the copy, on the thread that was
submitting. The title's queues can wait for work that same thread submits
next (four compute queues waiting for a Write64 on q1 whose list is
recorded but not submitted yet). So the copy waited its 5 s on every such
submission, and the uploads queued behind it on the sparse queue waited
too (`before_execute` waiting for ring room). In thread dumps of a retail
title on an RTX 5090, the submitting thread is in `readback_ranges` ->
`wait_for` while another title thread waits for the sparse state's lock in
`commit_range`. lucsoft found the same cycle on RDNA3 / Linux (xcl-dev#505).

The copies now run on a lane per title queue: a fence the title's queue
signals after its lists, and a queue of its own that GPU-waits for that
fence. The submitting thread returns. With one fence for all title
queues, a later signal on another queue let a copy start before its own
queue's lists ran (CharlyRien); with one queue for all, a title queue
waiting for work still to come held back the copies of the others.
The lanes (8) are made in `init`, before the device's methods are hooked:
made later, a lane's queue was adopted as one of the title's, and the e2e
title under the debug layer read 0 for what its lists wrote. A lane serves
a title queue while that queue has copies back in flight; with all lanes
busy (or none made), the old path runs. Readback buffers are sized to the
copy (64 KiB and up) and reused.

The data lands in the title's memory once the copy is done, before the
title can see the work it follows is done:
- on the next submit, and from a thread that looks every 0.5 ms;
- before Map's readback (waiting for the copy once the title's lists it
  follows are done), and in the CPU memory waits of Wait64BitValueX, which
  only try the sparse state's lock: its holder can be waiting for work the
  waiting thread is to submit;
- in the title's fence observations: `GetCompletedValue` settles the copies
  first. `SetEventOnCompletion` hands the fence an event of XCL's own, and a
  thread-pool wait on it settles them, then sets the title's event.
Lanes land in their own order, so an older copy back of one lane can land
after a newer one of another: it leaves the bytes the newer one landed.
A CPU wait for a copy uses its lane's event, not the sparse state's: a wait
that gave up leaves its registration behind, which set the shared event
later and ended a tile-queue wait early (theaustinayers, in xcl-dev#2057).

Tests:
- `a_copy_back_does_not_wait_for_the_title_queue` waits 5.0 s on the old
  path and under 1 s with this change;
- `a_copy_back_waits_for_its_own_title_queue`: two title queues, the first
  blocked; with one lane for both, the first one's copy lands before its
  list ran;
- `an_older_copy_back_does_not_overwrite_a_newer_one`.
They run on a WARP device of their own: they block a queue on purpose, and
on the GPU's device, which the tests in the process share, other queue
tests then hung in the driver releasing resources (upipibi; reproduced in 3
of 3 runs of the d3d12x queue tests). Without the fence hooks, the e2e test
title read 0 for its Write32BitValueBottomOfPipeX after its fence wait.
With them, both e2e tests pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kanade333

Copy link
Copy Markdown

RTX 5080 16 GB on 4df1e6e, unchanged: the world runs at 10–12 fps for one to two minutes, then the device goes. With XCL_DRED=1 it is a page fault inside a list of CopyTextureRegions, twice out of two runs. XCL_COHERENT_MB=512 is what gets this card past 53 s, and XCL_WATCH_HOT=0 removes the flicker at no cost in frames here.

Setup: NVIDIA GeForce RTX 5080 16 GB (driver 610.88, 32-lane waves), AMD Ryzen 9 9950X, 32 GB RAM (commit limit 97 GB), Windows 11 Pro 26200, release. This PR at 4df1e6e with no local change. Retail title of #505, 1.0.2.1, XCL_NETWORK=0, scripted A presses. One run per row unless said.

Caches: xcl shaders <pack> --precompile --only cs --pipelines in 6 processes (XCL_PRECOMPILE_SLICE=0/6 … 5/6, XCL_DXC_THREADS=4): 2,689 compute pipelines, 0 errors, 0 refused, 47 min, 12.1 GB private at the peak for the six together. (One process on main 6020a33 took 104 min on this machine.)

Runs (all with XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_UMA_SHADOW=1 XCL_COHERENT_HEAPS=sparse:16 XCL_LOOK_SKIP=1):

added world local video memory at the end end
nothing (the description's switches) loading starts at 42 s, no frame of the world 19,877 MB (15,011 MB at 30 s) 0x887a0006 at 53.4 s, System event nvlddmkm 153
XCL_COHERENT_MB=512 mostly 18–25 presents per 2 s from about 62 s 19,744 MB 0x887a0005 at 127.5 s, no nvlddmkm event
XCL_COHERENT_MB=512 XCL_WATCH_HOT=0 mostly 20–30 presents per 2 s, up to 34 20,146 MB 0x887a0005 at 176.3 s
the same + XCL_DRED=1, run 1 up to 26 presents per 2 s 19,579 MB 0x887a0006 at 70.9 s
the same + XCL_DRED=1, run 2 41–59 presents per 2 s while loading 18,481 MB 0x887a0006 at 56.5 s
  • With the 4,095 MB shadow the coherent window used 64 MB (coherent 64/4095 MB); at 512 MB it used 76–81 MB.
  • 0 draws and 0 dispatches skipped, 0 GPU-wait timeouts and 0 failed DirectStorage requests in every run. The picture of the world is grey (40 console shaders in the PSO without a translation: mes… warnings), 2D overlays are right.
  • In the three runs without DRED the removal comes within seconds of a burst of texture uploads (submit cost, textures in these 1024: … 6264 uploaded, 1853.2 MB / 9130 uploaded, 3060.6 MB).

DRED, the two runs:

run 1  DRED page fault at GPU VA 0x134ba9a000; allocations there: [type 34 ]; recently freed: []
       DRED: list … on queue 0x2ec4f1690: 2 of 13 operations done, around: 46 15 >8 8 8
       DRED: list … on queue 0x7e18d120: 0 of 4 operations done, around: >46 15 26
       DRED: list … on queue 0x7e18ae20: 0 of 28 operations done, around: >46 15 6
run 2  DRED page fault at GPU VA 0x11a2615000; allocations there: [type 34 ]; recently freed: []
       DRED: list … on queue 0x7e85d850: 76 of 210 operations done, around: 8 8 8 >8 8 8
       DRED: list … on queue 0x7e85d850: 0 of 39 operations done, around: >46 15 8
       (three more lists on the same queue, 0 of 4 / 28 / 1 done)

Both times the operation in flight is 8 (CopyTextureRegion) and the faulting address lies in a live resource (type 34), nothing recently freed. XCL_DRED=1 did not keep the driver from taking the kept blobs here (476 driver blob supplied, 10 absent in run 1). I do not know which resource it is, nor whether running 3–5 GB over the card's video memory plays a part: @frenziedcoder's RTX 5080 report above has a DRED page fault too.

Flicker (XCL_WATCH_HOT): three runs of 62 s with XCL_FRAME_DUMP=3, counting single all-black dumps between pictures of the 2D loading screens: 4 with the switches above, 1 without XCL_LOOK_SKIP, 0 with XCL_WATCH_HOT=0 (each run also has one black stretch of 2–3 dumps near its end, which I take for a real transition). That agrees with @Eterst's measurement. The person at this machine saw the flicker with the default and says the logos are right with XCL_WATCH_HOT=0. In all three runs the dumps were black for 9 s between the logo and the first loading picture (frames 683–956), whatever the switch; I have not looked into that.

A page budget does not get this card under its memory. Locally I applied #640 on this head (10 conflict blocks; its pool part rewritten for the TilePool, not pushed anywhere). XCL_PAGE_BUDGET_MB=5120: 16,888 MB local instead of 20,146, same frame rate, 0x887a0005 at 185.7 s. With 3,072 MB and textures evictable after 1 s instead of 5 (a local knob): 15,859 MB, 0x887a0005 at 153.9 s. Target pages stayed at 6.6–7.5 GB and the sparse pools at 6,144 MB.

Series S profile (XCL_DEVICE_TYPE=lockhart, with #495 applied by hand): with sparse:16 the title stops on its own int3 at 2.0 s (+0x1cf336c), after console descriptor heap: the title's memory 0x501400000 (0x2600000 bytes) not used (window Some(1), committed true). With XCL_COHERENT_HEAPS=sparse:1024 XCL_COHERENT_MB=1024 it starts, shows no frame after 60 s (three compute pipelines built in 18, 18 and 66 s, not in the precompiled set), holds 18,024 MB and ends in 0x887a0006 at 193 s.

Not tested

  • A newer driver (610.88 here), AMD, Intel.
  • More than one run of each row, except DRED (two).
  • The whole test suite on this head.
  • Which resource the fault is in.

AI use: Claude Code with Claude Fable 5.2 built the trees, ran the title, read the logs and wrote this report.

@joeypercia

Copy link
Copy Markdown

@kanade333 @dhillonjagdeep650-boop on the CopyTextureRegion page fault: both of your reports are on Ampere (3080 Ti) and Blackwell (5080). On an Ada card (RTX 4070 Ti, 621.40) I haven't seen it in 3 runs of f7e08e6 with or without the budget, and I can't make it happen synthetically either. Here is a probe you can run in a couple of minutes, to tell whether the difference is the GPU generation.

Branch joeypercia/xcl probe/reserved-copy-faults (b39608e, one test file plus its mod line, on #2057's 4df1e6e). Each case writes with CopyTextureRegion into a 64 KiB-tiled reserved texture, the kind vram::place_pages makes for the textures resource_at creates, and reads it back. One process per case:

foreach ($t in 'a_vram_copyq','b_sys_copyq','c_split_copyq','d_sys_direct','e_split_direct','f_half_null_copyq_write','g_half_null_direct_write','h_all_null_copyq_read','i_all_null_direct_read','j_sys_null_copyq_write','r_null_during_copyq','r_null_during_direct','r_other_tiles_during_copyq') {
  cargo test -q -p xcl --lib "copyfault_probe::$t" -- --ignored --nocapture --test-threads=1 | Select-String PROBE
}
  • a–j: tiles in a DEFAULT heap, in an L0 heap (741cb5a's system-memory pools), split between the two, or NULL-mapped. Copy and direct queues.
  • r_*: the mapping flipped to NULL, or to other tiles, about 6,000 times on another queue while 20 × 40 full-texture copies run, with no ordering between the two. That's what vram::unmap_superseded can do to a texture with an upload still in flight: it maps the old texture's tiles to NULL on the Pages queue as soon as a newer texture is placed over it.

On the 4070 Ti, all 13 cases: no removal. Data is right in the mapped tiles, and NULL tiles read 0. Adapter 0 is used; set XCL_ADAPTER if yours differs.

If any r_* case removes the device on your card, the likely fix is to make unmap_superseded's NULL mapping wait for the GPU work submitted before it. I can write that.

AI use

  • Claude Code (Claude Opus 5.5) wrote the probe, ran it on my machine and wrote this comment.

@mgrein

mgrein commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

RTX 4070 12 GB / 32 GB RAM on 4df1e6e: the intro's opening credits are reached; the device then goes at 164–342 s with a GPU page fault, and DRED names the resource: a sampled title texture that XCL's texture upload is copying into.

Setup

What a run looks like now: 30 fps in the menus from 6 s, the loading artwork from ~110 s (the older head 8ff4b02 needed 240–300 s on this machine), the intro's opening credits over a grey scene from ~250 s.

run settings on top end
55, 56 – / XCL_COHERENT_MB=2048 no frame from 130 s to 600 s, no crash: a title thread waits in bind::execute_indirect → pso_async::resolve_wait while the xcl-pso-pre workers build graphics pipelines of 280–500 KB DXIL one at a time (huge, "driver blob absent", 2.6–3.4 s each)
57 XCL_PSO_WAIT_MS=50 XCL_HUGE_PSO_CONCURRENCY=4 presents go on (2–7 per 2 s); intro credits; device hung (0x887a0006) at 261.5 s
58 same + XCL_DRED=1 removed at 342.6 s: DRED page fault at GPU VA 0x0, no allocation; just before it 6 ExecuteIndirect with garbage group counts (0x4729aa76 x 0x46ab67c2 x …) were refused as out of range
59 no XCL_PSO_WAIT_MS (nothing skipped) removed at 164.5 s: page fault at 0x14c8fb0000 inside a resource; the list there had done 25 of 52 CopyTextureRegion
60 same removed at 306.6 s: page fault at 0x0 (after a Wait64BitValueX time-out)
61 + #1592 removed at 238.3 s: page fault in a resource, list at 248 of 700 CopyTextureRegion
62 + the names removed at 186.2 s: page fault at 0x15737a0000 in title 0x12a6a78000 dim3 1024x512 fmt83 flags0x300000 sampled (a BC5 texture on vram::Pages tiles, not GPU-owned); the list there: 7 of 11 operations done, all CopyTextureRegion – the shape of texture_upload::record

So on this card the removals come in two kinds, both while video memory stands far over the card: DXGI reports 20.7–21.0 GB local and 1.6–1.8 GB non-local at the removal (target pages 10.1–10.3 GB, sparse pools 6.1 GB, UMA shadow), with 2–5 GB of RAM free:

  1. a page fault inside a sampled title texture while XCL's upload copies into it (59, 61, 62), and
  2. a page fault at GPU VA 0x0 (58, 60; @frenziedcoder's 5080 above shows the same).

Skipping late pipelines (XCL_PSO_WAIT_MS) is not what causes them: run 59 skipped nothing and was removed earliest. Graphics pipelines are no longer the wall once their blobs are on disk: 161 of 172 came from XCL's disk cache in run 59 (11 built).

Update, runs 63–66 (same tree, same settings unless said): what the faults are not –

  • 63: uploads into textures vram has mapped to nothing (unmap_superseded) left out (a local skip in texture_upload::plan_item; 128+ left out by 150 s): still removed at 201.8 s, page fault in title 0xdef534000 dim3 1024x1024 fmt72 flags0x300000 sampled, again inside CopyTextureRegion (32 of 69 done) – a texture that was mapped when its copy was planned.
  • 64: device Evict kept resident (hooked, counted): the title never called it. That run ended on a title access violation at 131 s (write at 0x279ab0f015, +0x4f878ae) instead.
  • 65: without XCL_UMA_SHADOW: local video memory still 18.3 GB (target pages 10 GB, sparse pools 6 GB), 0–4 presents per 2 s, removed at 290.6 s with the page fault at 0x0. Just before it, as before run 58's: ExecuteIndirect of CS a6724f20f309a480, 51788b20c402ace3, 4401d482ef24797c refused as out of range, their "counts" shaped like addresses (0xf4b482d0 x 0x100004 x 0x1, arguments at 0x4f4b480e0).
  • 66: Series S profile (lockhart): the title stops on an int3 at +0x1cf336c 1.5 s after start.
  • No GPU wait was released by the watchdog and no Write64 cycle was broken in any of 58–65, so the faults do not follow a sync the watchdog broke.

Not tested: more than one run per row; AMD; the tree without #2195 (it changes no behaviour here unless an index lands in 1,000,000 – 2^21); whether the faulting texture's tiles were mapped at the moment of the copy (the next thing I'm looking at).

AI use: Claude Code (Claude Opus 5.5) made the builds and runs on this machine, wrote the two diagnostics and wrote this report.

@Dezmonius

Copy link
Copy Markdown

RTX 5070 / Windows 10 follow-up on exact #2057 head 4df1e6e3d40a011501c046148b6aa470437aa2eb: loading art, then a late DXGI_ERROR_DEVICE_HUNG with the shadow off.

Setup: RTX 5070 12 GiB, driver 610.88 (32.0.16.1088), i7-7700K, 32 GiB RAM, Windows 10 build 19045, Rust 1.100.0, unchanged release build. The newer title of #505 ran offline from an SSD with a copied local profile for each run. Shared flags: XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_COHERENT_HEAPS=sparse:16 XCL_LOOK_SKIP=1 XCL_DRED=1 XCL_PSO_PRELOAD=0. The runs reused their locally generated caches where marked warm. I did not precompile the compute pack.

Run Shadow Result
Cold runtime cache, 300 s On Profile accepted, animated loading art, 557 presents, timer exit 0.
Warm, original input schedule On Profile prompt remained visible. I ended it at 329 s after late keyboard input did not advance it.
Warm, extended automatic A presses, 420 s Off Profile accepted, animated loading art, then black sampled frames. 798 presents, timer exit 0. Last activity sample had 1,032 DirectStorage requests in 2 s, no failures.
Warm repeat, same extended input and shadow off, 600 s limit Off 883 presents summed from the activity samples. At 472.8 s the process exited with 0x887A0006. Last inspected frame still showed loading art.

In the crashing run, the last two 2 s activity samples showed 2,296 and 2,206 DirectStorage requests (0 failed), with 9 dispatches in each sample. DRED reported a GPU page fault against a resource (allocation type 34, no recently freed allocation listed). One list on the reported queue showed 33/36 completed operations with CopyTextureRegion bracketing the breadcrumb and a resource barrier later. Another list on that queue showed 0/4. The breadcrumbs give a location to inspect. The faulting operation or resource ownership has yet to be established.

Peak sampled XCL process commit was 23,820 MiB, peak local video memory was 12,122 MiB, minimum available host RAM was 15.95 GiB and minimum system commit headroom was 29.58 GiB. There were zero GPU queue.Wait ... did not complete entries in the crashing run. All runs logged 40 mesh pipeline refusals for an MS in the AS slot. A cold shadow-on run had already reached animated loading art. Input timing and cache state differed across the shadow settings, so these results do not isolate the shadow or reproduce the prologue reported in the RTX 3070 follow-up. No in-world HUD was visible in the sampled frames, and audio was not monitored.

AI-assisted (Codex) for the runs, log analysis and this report. No game data attached.

@KDenKC

KDenKC commented Nov 25, 2026 •

Copy link
Copy Markdown

RTX 5090 32 GB on 4df1e6e: with the description's switches the device is removed at 50–53 s on the menus, 5 of 5 runs, with at most 11.5 GB of local video memory in use. It takes XCL_WATCH_HOT (on by default) together with either XCL_HEAP_WINDOWS=1 or XCL_COHERENT_HEAPS=sparse:16; XCL_WATCH_HOT=0 or XCL_WATCH_HOT_MS=60000 avoids it.

This looks like the same stop as @kanade333's first row (0x887a0006 at 53.4 s on a 5080). On this card it happens with at most 11.5 of 32 GB of video memory in use, so at least this stop is not the card running out.

Setup

  • NVIDIA GeForce RTX 5090 32 GB (driver 621.24, 32-lane waves), AMD Ryzen 7 9800X3D, 62 GB RAM, Windows 11 26200.9974, rustc 1.99.1 MSVC, release build of this head (4df1e6e, no local change).
  • The retail title of Newer retail title (TitleID 7952987A): reaches world loading, then the title's GPU watchdog ("GPU Loc Sig") after ListX #101 stub #505 (1.0.2.1), XCL_NETWORK=0, a fresh data folder per run, scripted XCL_PRESS_AT A presses every 3 s from 6 to 60 s (the title is idle on Legal Notices from ~45 s).
  • Caches: xcl shaders <pack> --precompile --only cs --pipelines in 6 processes (XCL_PRECOMPILE_SLICE=0/6 … 5/6) with the run switches: 2,689 compute pipelines, 0 errors, 0 refused, 60 min; peak system commit 47.4 GB.

Runs (80 s each unless noted; "hot" = the default XCL_WATCH_HOT; every run a fresh process with only the variables listed)

switches hot runs result
XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_UMA_SHADOW=1 XCL_COHERENT_HEAPS=sparse:16 XCL_LOOK_SKIP=1 (the description's) on 5 removed 0x887a0006 at 52.0, 51.2, 51.8, 50.4, 50.5 s
the same XCL_WATCH_HOT=0 3 ok to 78–80 s
the same on, XCL_WATCH_HOT_MS=60000 2 ok to 80 s
the same without XCL_UMA_SHADOW on 2 removed at 51.5, 50.4 s
XCL_HEAP_WINDOWS=1 only on 1 removed at 53.5 s
XCL_COHERENT_HEAPS=sparse:16 only on 1 removed at 51.5 s
XCL_UMA_SHADOW=1 only on 1 ok
XCL_DIRECT_DXIL=1 only on 1 ok
XCL_LOOK_SKIP=1 only on 1 ok
none on 1 ok
main 568e7db with the description's switches (no hot looks there) – 1 ok
the description's + XCL_COHERENT_MB=512 (@kanade333's change) on 2 removed at 51.3, 51.5 s
  • XCL_COHERENT_MB=512 changes nothing on this card because its coherent window is already 512 MB with the description's switches (coherent 64/512 MB in every run, with or without it), where @kanade333's 5080 had coherent 64/4095 MB.

  • In all 9 removed runs the title was presenting a steady ~28 fps (54–59 presents per 2 s) in the 10 s before the removal, with 0 GPU-wait timeouts, 0 mid-list splits and 0 failed DirectStorage requests; 6.7–11.5 GB local video memory and 16.7–24.1 GB committed at the last memory line before it.

  • The hot looks are active from early on in every removed run (first … blocks hot now … line at 7.6–15.5 s), so the removal is not at their start.

  • In one run (hot + XCL_COHERENT_HEAPS=sparse:16 only) the process did not exit after the removal: it was still running 20 min later, with the log ending at the removal line.

What I think it is (not verified): the description says a write to an idle block can reach video memory ~20 ms late. Both switches that bring the removal put title memory behind XCL's windows, which the looks have to bring up; a value the GPU waits on (or reads indirect arguments from) that arrives late in such a block would explain a hang at a steady frame rate on a static screen. A 60 s hot window, which keeps a block in every look once it was written, removes it here (2 of 2). DRED not tried for the menu stop.

Not tested


Edit (world load on the same card, XCL_WATCH_HOT=0 added to the description's switches, warm compute caches, 5 runs): runs 1–3 had no device removal or crash, at up to 20.1 GB local video memory (nvidia-smi 22.4 GB) and 39.2 GB committed. Runs 4 and 5, the first to stay in the world, lost the device (0x887a0005, at 361 s and 179 s) at 19.7–19.8 GB local of 32 GB; with XCL_DRED=1 it is a page fault at GPU VA 0x0 with no allocation named, the signature @frenziedcoder reported on a 16 GB 5080, so on this card the in-world removal happens with the budget far from used (as @throny found with texture pages in system memory). In run 4 nothing in XCL's log in the 10 s before it but a graphics pipeline finishing at 359.8 s. XCL_DRED=1 no longer stalls start-up here on this head.

run length presents stop presents resume end
1 600 s 133 s never XCL_RUN_SECONDS, no removal
2 600 s 128 s never XCL_RUN_SECONDS, no removal
3 (thread dumps at 160, 220, 300 s) 320 s ~135 s ~300 s: 8,515 draws and 33,249 dispatches per 2 s, a flat grey world XCL_RUN_SECONDS, no removal
4 600 s world drawn ~140 s (12,326 draws, 70,959 dispatches per 2 s), then no presents ~150–352 s while 31 new graphics pipelines were built ~354 s 0x887a0005 at 361.4 s, then the title's int3 at +0x2474606; local video memory 19.7 GB, 39.1 GB committed
5 (XCL_DRED=1) 600 s – (world drawn from ~140 s: 20–33 presents, 10,500–16,700 draws and 55,000–84,000 dispatches per 2 s) – 0x887a0005 at 179.4 s, same int3 at +0x2474606; DRED: page fault at GPU VA 0x0, no allocation there, nothing recently freed; 19.8 GB local, 39.7 GB committed
  • 0 GPU-wait timeouts and 0 would close a GPU cycle in all five; 1, 1, 10, 10 and 10 mid-list splits.
  • What the stop is in run 3: from 133.9 to 284 s the log shows graphics pipelines built one after another, each huge, wanted at once (no slot), driver blob absent, 2.5–7.2 s in the driver (16 of them, 275–570 KB of DXIL), with 2–6 s between them; in the dumps the title threads are waiting, xcl-dxc-4 is inside dxcompiler.dll, nothing else is busy. When the last one is built the world starts drawing. The precompile covers compute only (--only cs), so these are cold graphics pipelines. Runs 1 and 2 were in the same state to their end: after 125 s they built 47 and 59 graphics pipelines (139 s and 185 s in the driver), the last finishing at 596 and 594 s. XCL's driver-blob store works across runs: over each whole run, 4 of 51 (run 1), 49 of 110 (run 2) and 108 of 127 (run 3) graphics builds were supplied a blob kept by an earlier run; the builds after the stop were pipelines new to that run, so each run got further through the list, and run 3 had 16 left.
  • So on a card with this much video memory, this head reaches the world with no removal once XCL_WATCH_HOT=0 keeps it past the menus; the time to the world is set by cold graphics-pipeline builds on a title thread (~10 s each with translation, serial).

Not tested for this part: a run with every graphics pipeline warm from the start (a fourth run should start with none left to build); more than 320 s after the world appears; XCL_WATCH_HOT_MS=60000 instead of XCL_WATCH_HOT=0 at world load.

AI use: Claude Code (Claude Opus 5.5) ran the precompile and every run above, read the logs and wrote this report.

@Dezmonius

Copy link
Copy Markdown

@joeypercia I ran your unchanged synthetic probe at b39608eaa8f5f079f7413173e67c9e07146b9597 on the RTX 5070 (12 GiB, driver 610.88 / 32.0.16.1088, Windows 10 build 19045, release). The probe reproduced the HRESULT from my title run without loading the title.

  • The ten fixed-mapping cases all completed with no device removal. Every mapped word matched and the NULL-mapped tiles read zero.
  • The first concurrent case, r_null_during_copyq, reported device removal 0x887A0006 after 1.8 s. Each case had a fresh process. I stopped the series at that point, so the two remaining concurrent cases are untested here.

This matches the device-removal HRESULT on this hardware. The synthetic probe does not establish that the title lost the same resource or took the same code path.

AI-assisted (Codex) for execution and reporting. The probe ran without title files.

anoyarou pushed a commit to anoyarou/xcl that referenced this pull request Nov 25, 2026
A retail title's world load can stop with no GPU-wait time-out: presents,
submits and DirectStorage requests go to 0 and every thread waits. The
watchdog's summaries of pending title fences and of XCL's own unmet queue
waits are only logged at a time-out, so such a stop did not say whether
a fence or a queue was behind.

At each XCL_THREAD_DUMP_AT dump XCL now logs the two summaries and the
number of armed GPU waits, on a thread of its own so that a lock the
stall holds cannot hold up the next dump. On xcl-dev#2057's tree this showed
every fence and queue caught up at 135, 200 and 300 s after a stop at
110 s (xcl-dev#2057 (comment)).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XZrhsCAiLU1tTuEBwPLaRW
@upipibi

upipibi commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

@joeypercia Your unchanged probe at b39608e (on 4df1e6e) on Ampere: RTX 3070 8 GB, driver 616.56, Windows 11, debug build. Each case ran as its own process, and all 13 completed with no device removal.

case queue tiles vram/sys/null result
a_vram_copyq 3 32/0/0 ok=524288
b_sys_copyq 3 0/32/0 ok=524288
c_split_copyq 3 16/16/0 ok=524288
d_sys_direct 0 0/32/0 ok=524288
e_split_direct 0 16/16/0 ok=524288
f_half_null_copyq_write 3 16/0/16 ok=262144 zero=262144
g_half_null_direct_write 0 16/0/16 ok=262144 zero=262144
h_all_null_copyq_read 3 0/0/32 zero=524288
i_all_null_direct_read 0 0/0/32 zero=524288
j_sys_null_copyq_write 3 0/16/16 ok=262144 zero=262144
r_null_during_copyq 3 remaps=5786, 20 of 20 rounds, 2.1 s
r_null_during_direct 0 remaps=3884, 20 of 20 rounds, 2.1 s
r_other_tiles_during_copyq 3 remaps=3752, 20 of 20 rounds, 2.1 s

other=0 in every case. The System log has 0 nvlddmkm 153 events since the first case started.

So on this card r_null_during_copyq finishes all 20 rounds, while on Dezmonius's RTX 5070 the same case reported 0x887A0006 after 1.8 s. That's one run per case on each card, with different drivers (616.56 here, 610.88 there) and different Windows versions, so this doesn't tell us whether the architecture, the driver or something else makes the difference.

AI-assisted (Claude Code). Synthetic probe only, no title files.

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.