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 70 commits into
xcl-dev:mainfrom
theaustinayers:integration/nvidia-world
Draft

theaustinayers wants to merge 70 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 are of older commits of this branch (up to 14d7a3c). Everything from 16826cb on has unit and GPU tests but has not run in the game yet.

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
  • 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
  • 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

Tested

  • NVIDIA GeForce RTX 5090 32 GB (driver 621.14), AMD Ryzen 9 9950X3D, 128 GB RAM, Windows 11 build 26300, release.
  • cargo test --workspace -- --test-threads=4 at 70a7e1d: lib 1134 passed, 4 failed, 26 ignored. The 4 are gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3 (the driver answers E_OUTOFMEMORY to CreateComputePipelineState); they fail the same way on main with this card. The later targets did not run after them.
  • The sparse uploads' and the texture uploads' GPU tests under the debug layer with GPU-based validation: 0 errors or warnings.
  • Cost, measured in isolation: 2 000 small CPU writes 594 → 66 µs; 64 KiB of a 22 MB BC7 texture ~15 → 0.08 ms; a recorded dispatch on 8 threads at once 17.1 → 0.5 µs.
  • The newer 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 (14d7a3c, XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_UMA_SHADOW=1, shader caches filled): one 5-minute run, 4 299 frames in 298 s; 30 fps in its menus, 5 – 6 fps in its world. A later build froze after about 30 s in the world, one run ended in a driver reset: the reasons for the commits under "Hang and freeze".

Regression run

  • none: a reference branch, not for merge.

Not tested

  • The commits from 16826cb on 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 commits were reviewed by separate agents (Claude Opus 5.5); what they found is in the commits named "review".

🤖 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>
A title changes thousands of scattered 64-byte chunks between two submits (a retail title's world:
~2 000 runs of ~240 bytes a submit). Each was a CopyBufferRegion, 0.3 us in the driver however
little it copies. The runs under 4 KiB now go into the staging ring one after another behind a table
of their places, and one compute dispatch puts them there; longer runs keep their copies. Measured
with upload_dirty on an RTX 5090: 2 000 runs of 256 bytes 594 -> 66 us, 400 runs 160 -> 60 us.

Only the changed chunks are written, as before: what lies between them may be the GPU's.
XCL_SPARSE_SCATTER=0 goes back to a copy each. The "sparse windows timing" line counts both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@HKEY-Funk-Machine

Copy link
Copy Markdown

AMD RX 9070 follow-up: 0d25b89 (cache flushes as UAV barriers) gets this card further into the world load: 3 of 4 runs, against 0 of 6 without it, and once to the prologue's first title card.

Follow-up to my 7152473795 above. Same machine, warm caches, same settings: 8ff4b02 with 0d25b89 cherry-picked on top (its runtime part; the test hunk conflicted with the test module at 8ff4b02 and I left it out). One local change in xgameruntime/api.rs (start-up hang here; XCL_NO_PC_RUNTIME=1).

XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_PSO_WAIT_MS=50 XCL_GPU_PROFILE=1 XCL_PRESS_A_AT=8,10,…,90 XCL_RUN_SECONDS=360, nothing refused, the same exe name for every run (warm driver cache).

runs reach world loading (first ListX #101) dispatches before the end end
8ff4b02 6 4 of 6, at ~90 s 10 000–32 000 0x887a0006 at 120–154 s, ~30 s into the world load
8ff4b02 + 0d25b89 4 3 of 4, at 139–144 s ~30 000–33 000 in those three 0x887a0006 at 172–184 s in those three; the fourth hung at 108 s before world loading (2 048 dispatches, nothing skipped)
  • With 0d25b89 the menus hold 30 fps to ~3 000 frames (~1 800 without it), and the world load runs 30–45 s before the GPU stops, about 40 s more than without it.
  • In one of the four runs the prologue's first title card was on screen before the hang. In the other two that reached world loading it wasn't, although they did about as much work.
  • The hang is still there, so something else stops the GPU after that. On main, @madaraXor's RX 6700 XT got past it with 39f23deaf6a63310 and b78fa10b425b8e54 refused (Retail title 1.0.2.1: GPU hang / crash at +0x23cf683 when the story loads (RTX 3070 Ti) #675 7152834098); I haven't combined that with this commit yet.

So on AMD this commit is worth its own PR. I'll test it there if you split it out.

Not tested: 0d25b89's unit test; this PR's new head 41303e4 (it changes the translator, so these caches would be cold); combined with the #675 refusals or #929; more runs.

AI use: Claude Code (Claude Opus 5.5) ran the runs, read the logs, and wrote this comment.

… that are kept

A title's texture went up as a whole whenever a page of it was written: hashed as a whole on the
submitting thread, every level of every slice detiled into fresh memory, copied again into a new
upload buffer, on a new allocator and list, and released through the hooks that ask every queue how
far it is. A streamed texture arrives 64 KiB at a time, so it went up many times over. In a retail
title's world that was half of what a submit cost (73 ms of a 180 ms frame).

- The written pages are compared one by one with what they held, and only the blocks of the levels
  (mip tails, rows of linear levels) the changed ones are go up (`tiling::Chain::parts`).
- They are detiled block by block by the standing workers, straight into a mapped upload buffer, in
  runs of up to 16 bytes (`detile_blocks`).
- Lists, allocators and upload buffers are kept and used again; what XCL makes for its own work is
  not hooked as a title's object.
- An upload for a compute or copy queue's submit runs on XCL's own queue as before, but the title's
  queues wait for it on the GPU; the submitting thread waited for it on the CPU with everyone
  behind it.
- A texture that becomes active again (the one over it was released) goes up as a whole at its next
  write; one whose upload failed too. Pages that go while they are read (another thread decommits
  them) read as zeros.

Measured (RTX 5090, 9950X3D): 64 KiB of a 22 MB BC7 texture 15 ms -> 0.08 ms before copies and
objects, all of it 15 -> 1.7 ms.

XCL_TEXTURE_PARTS=0 uploads changed textures as a whole. submit_cost counts pages compared and bytes
uploaded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each last Release of a resource signalled every queue and spun for up to 300 us in case the GPU had
nothing to do. With work in flight (always, in a scene) that is 300 us of the title's thread and a
Signal on every queue per resource, and a title that streams releases many at a time. Queues found
busy are now taken to be for 5 ms: those releases go to the thread that lets them go (as before, when
the wait did not help). An idle GPU still lets a resource go before its Release returns.

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

ettehn commented Nov 25, 2026 •

Copy link
Copy Markdown

Independent Windows unit-test results on clean 41303e41661f0dc741737f8a59d328892fdd772c (Windows 11 25H2 build 26200.9974, Ryzen 9 8945HX, Rust 1.97.1 MSVC, debug):

cargo test --offline -j 2 -p xcl --lib filter Passed Failed Ignored
auto_submit_disabled 2 0 0
a_destination_page_rewritten_after_enqueue 1 0 0
cache_flushes_are_uav_barriers 1 0 0

All three commands used -- --test-threads=1. The page-list test exercised the late reread and confirmed that the destination received all 256 bytes while the old page retained its sentinel. The queue tests covered explicit submit, the automatic-submit control, and an enqueue blocked until Submit or Close.

I also applied just 0d25b89 to main at 6020a33. The only patch conflict was the test insertion context in list_x.rs. After relocating that test and adding a slot-table check for old/new slot 69, new slot 71, and slots 131/132, the cache_flush filter passed 2/2.

These are targeted unit tests. GPU execution, a retail run, and the full suite are untested here.

Verification assisted by OpenAI Codex (GPT-6).

Follow-up: DirectStorage on current main with both fixes. On the same Windows setup, I applied #1405 at bb27ed6 and #1599 at 5b1518f together to main at 6020a33. cargo test --offline -j 2 -p xcl --lib hle::dstorage:: -- --test-threads=1 reported 33 passed, 0 failed, 0 ignored in each of two runs (XCL_DSTORAGE_PARALLEL_DECOMPRESS=0 and =1). XCL_SAMPLE_BCPACK was unset, so these runs did not cover retail BCPack streams.

The updated #1405 test exercised both cases: a persistent page list was reread at execution, while a stack-backed list kept its enqueue-time snapshot even after it was rewritten to name another allocated page. The 41303e4 tests above cover the persistent-list case. That revision lacks the newer stack-list check, and applying bb27ed6 directly to it conflicts in dstorage.rs. This follow-up used synthetic requests only.

Windows follow-up on f7e08e6. I compared the clean head with a local adaptation of #751 (copy non-coherent texture reads) and #1527 (unregister tracked textures before the last release). The adaptation keeps this head’s delayed-release path.

On the same Windows/Rust setup, cargo test --locked --offline -j 2 -p xcl --lib <filter> -- --test-threads=1 passed 7/7 on each tree. This covered DirectStorage auto-submit and page-list reread, cache-flush barriers, and texture uploads (missing pages, written-page tracking, and buffer growth). The candidate also passed 5/5 focused tests for safe reads, concurrent decommit, tracked release, and upload batching. Both Release builds succeeded and their three shader translation source IDs matched.

Coverage is CPU-only. Retail execution, GPU behavior, and cache hits remain untested. Verification assisted by OpenAI Codex (GPT-6).

… one lock

A title records its lists on many threads, and every root argument, draw and dispatch looked up the
list's state, the pipeline's stand-in, whether it is translated, its root signature and user SGPRs
and the windows' addresses, each under one lock for all threads. The maps are in 64 parts by address
now, each on a cache line of its own; the windows' addresses are read without a lock, and whether a
heap of views is bound is asked once per recording.

A dispatch with six root constants (XCL's part, 9950X3D, warm memory): 1 thread 0.52 -> 0.44 us, 4
threads 4.1 -> 0.43, 8 threads 17.1 -> 0.52, 16 threads 45.8 -> 0.93 us on each.

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

Alm0stSurely commented Nov 25, 2026 •

Copy link
Copy Markdown

Retail-run follow-up to the cache-flush unit test above. On RTX 5080 / 620.73.04, Arch Linux, Ryzen 9 9950X3D, Proton Experimental and patched vkd3d-proton 3.1 (4522cc1), I compared 14d7a3c + #751 (59f8e7c) with the same build plus just 0d25b89. I relocated the upstream test to fit that base and added one log at the first eligible range flush. cache_flushes_are_uav_barriers passed under Proton.

The control's report recorded 9 calls to stub #131 and 5 to #132. The patched run took the nonempty range-flush path on a direct or compute list at 0.752 s. Both captures reached the loading illustration, followed by a uniform screen. Both ended with VK_ERROR_DEVICE_LOST on queue submission / 0x887a0005 (control 119.571 s, patched 115.432 s). One run per build. This confirms these handlers are exercised here; adding them alone did not advance the visible stage on this setup.

Same 300 s launch limit, separate copies of the same partial cache seed, XCL_DIRECT_DXIL=1, XCL_HEAP_WINDOWS=1, XCL_UMA_SHADOW=1, XCL_PSO_WAIT_MS=250, VKD3D_CONFIG=ignore_shared_fence. AI assistance: Codex (GPT-6.2 Astra).

Updated integration run on the same RTX 5080: 41303e41661f0dc741737f8a59d328892fdd772c + #751, same launch settings and initial cache files. The older guarded base lost the device at 119.571 s. The updated build reached its 300 s test limit, with 1,702 PresentX calls and no logged device removal. Presents resumed around 226 s (14 across the five 2 s windows ending at 226–234 s). The capture remained uniform during that burst; no HUD or 3D scene was confirmed. GPU fences were still pending during shutdown. One run, multiple integration changes, partial caches.

At 92.226 s the ExecuteIndirect guard reported that its program did not compile. I independently passed the unmodified string returned by indirect_guard::program() to Proton's d3dcompiler_47!D3DCompile (main, cs_5_0, flags 0), outside the title. Result: 0x80004005, E5005: Method 'Load3' is not defined on type 'RWByteAddressBuffer'. Substituting three scalar loads gave the same diagnostic for Load. This identifies why the guard was unavailable on this setup; the cause of the uniform output remains open. Same Codex (GPT-6.2 Astra) assistance.

… slot up once

What XCL keeps of each list (bindings, pipeline, queries, writes) was one map under one lock, taken
by most recorded calls of every recording thread; it is in 64 parts by list now. A hooked draw,
SetPipelineState, Close or fence poll looked its PC method up by name in its object's class, under
the lock of all classes: a method is at one slot in every version of its interface (tested), which
is looked up once.

A dispatch binds XCL's compute pipeline with the PC method, past the hook of a title's
SetPipelineState (which keeps a graphics pipeline's depth bias); so does the check before an
ExecuteIndirect, whose program is then no longer noted as what the title bound.

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

Anon64 commented Nov 25, 2026 •

Copy link
Copy Markdown

A run of this branch on a 12 GB card: it reaches the world here too, slower.

Setup: RTX 3060 12 GB (581.80, wave32), Ryzen (24 cores / 32 threads), 64 GB RAM, Windows 11 26200. Head 41303e4, release. XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_UMA_SHADOW=1 XCL_NETWORK=0, A pressed every 4 s.

Caches: xcl shaders <pack> --precompile --only cs --pipelines with your XCL_PRECOMPILE_SLICE=i/12 in 12 processes: all 2,689 compute pipelines built, 0 errors, 0 refused, in 23 min (slowest slice 1,373 s); the NVIDIA cache grew 8.1 GB. Then, in the title:

  • Run 1 (300 s): all 231 huge compute builds came from the driver cache (driver blob supplied, 50 s in all, none over 1 s). Presents stop at ~86 s, and the title waits on graphics pipelines built cold: 3–4 s each, 81 in the run. No crash, no device removal, no GPU-wait timeout.
  • Run 2 (450 s, same caches plus what run 1 built): graphics builds fall from 101 in the first 100 s to 25, 7, 1, 2 in the following 100 s windows. Presents come back at ~200 s and go on until ~338 s at 1–8 per 2 s (about 2–3 fps), with up to 3,205 draws and 15,764 dispatches per 2 s. Then presents stop with nothing logged: no wait timeout, no crash, hardly any builds. Peak commit 39.3 GB, no device removal.

On main this card stops at a GPU wait chain (q0 / q1 waiting on q2, see #1123). With this branch no GPU-wait timeout was logged in either run, so the per-queue copy-back fences (1225bb9, 5e3c657) look like they matter here.

Also noticed: some flicker in the intro sequence that the user of this machine did not see on main. I'd guess the XCL_WATCH_HOT part ("a write to a block that was idle reaches video memory up to about 20 ms late"), but I haven't run with XCL_WATCH_HOT=0 yet.

Written with Claude Code (Claude Opus 5.5) from runs on this machine.

Update, two more runs on the same caches:

theaustinayers and others added 3 commits November 25, 2026 00:54
…f the uploads)

- An upload on the title's direct queue waits for what went up on XCL's own queue before it, not
  after it. One on XCL's own queue that an older one, still waiting on a direct queue, can land over
  goes up again behind that one (`texture_upload::sent`, `take_again`): with parts going up, nothing
  sent them again before.
- A texture with a reported page goes up with all its written pages, those outside the blocks the
  look took too (they stay reported). What its pages held at an upload of all of it is remembered, so
  a page written with the same bytes leaves alone what the GPU wrote there.
- The wait for upload buffers polls: giving a wait up left its event registered after it was closed.
  Lists and buffers the GPU may still run stay when the queue's fence cannot say so.
- The driver's refusal of a program or root signature of XCL's own is what its user gets, not a
  program that does nothing (the scatter falls back to copies, the indirect check says so).
- The debug-layer test of an upload's states goes through these uploads, for all and for part of a
  texture.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… the uploads)

- The page hashes are of the bytes an upload read, taken as it reads them: pages read along with a
  changed one, and pages a title writes on between the comparison and the upload, were kept as what
  they had been compared as, and the PC texture could stay at zeros or half-drawn bytes. A first
  upload leaves them known too, so a page written with the same bytes is nothing to send.
- The textures of a batch that could not be uploaded (no memory for its buffer) go up again after
  100 ms instead of at their next write; buffers over 64 MiB are not rounded up to a power of two.
- A render target or UAV the CPU writes too goes up as a whole, as before: the GPU's writes to one
  are not all seen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An unbuffered read arrives by DMA: the write watch reports at most that its pages were locked,
before the bytes are there, and a look in between left the bytes out of video memory (sparse
windows) and of textures until something else wrote there. ReadFile's range is noted when it
returns finished, an overlapped one's at the first look that finds its OVERLAPPED done.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
theaustinayers and others added 4 commits November 25, 2026 01:05
# Conflicts:
#	crates/xcl/src/gpu/texture.rs
#	crates/xcl/src/hle/d3d12x/title_textures.rs
- The bytes an upload reads are hashed before they are detiled: in the window that stays committed
  they are the title's own, and a write in between was kept as sent.
- A texture over the video memory of one it supersedes comes behind that one's unfinished uploads.
- Resolves into a texture are noted as GPU writes, like copies.
- A texture whose blocks the look took anyway is not asked about again; what goes up of a batch is
  counted in whole blocks.
- GPU tests: the order of a texture's uploads on two queues, both ways; a program of XCL's own that
  the driver refuses.

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

Copy link
Copy Markdown

Tested a fix for the Proton ExecuteIndirect guard compilation failure on 41303e41661f0dc741737f8a59d328892fdd772c: keep D3DCompile as the first choice, then use XCL's DXC compiler with cs_6_0 if it returns no bytecode. The HLSL stays identical.

On RTX 5080 (620.73.04), Arch Linux / Proton Experimental, the existing draw-argument GPU test failed at expect("checked") on the unmodified head. With the patch both an_execute_indirect_with_garbage_counts_draws_nothing and an_execute_indirect_with_garbage_counts_runs_no_groups passed (no skips, DXC 1.9.2609.5). The first reads back the guarded draw arguments. The second executes indirect dispatches and verifies how many groups ran.

Matched 300 s retail replay with #751 and the same partial cache seed and settings as the previous report: the guard compilation warning disappeared, 1,748 PresentX calls, exit 0. The capture still showed loading artwork followed by a uniform screen. No out-of-range count was reported in this run. No full-suite or native Windows run.

Patch against this integration head
diff --git a/crates/xcl/src/hle/d3d12x/indirect_guard.rs b/crates/xcl/src/hle/d3d12x/indirect_guard.rs
index d76321e..57e8777 100644
--- a/crates/xcl/src/hle/d3d12x/indirect_guard.rs
+++ b/crates/xcl/src/hle/d3d12x/indirect_guard.rs
@@ -210,11 +210,17 @@ unsafe fn guard_of(list: &ID3D12GraphicsCommandList) -> Option<Arc<Guard>> {
     }
 }
 
-unsafe fn make(dev: &ID3D12Device) -> Result<Guard, String> {
-    let cs = real::compile(&program(), "cs_5_0");
-    if cs.is_empty() {
-        return Err("its program does not compile".into());
+fn compile_compute(src: &str) -> Result<Vec<u8>, String> {
+    let cs = real::compile(src, "cs_5_0");
+    if !cs.is_empty() {
+        return Ok(cs);
     }
+    crate::gpu::recomp::dxc::compile(src, "main", "cs_6_0", &[])
+        .map_err(|e| format!("compute shader compilation failed with D3DCompile and DXC: {e}"))
+}
+
+unsafe fn make(dev: &ID3D12Device) -> Result<Guard, String> {
+    let cs = compile_compute(&program())?;
     let root = |ty, anonymous| D3D12_ROOT_PARAMETER { ParameterType: ty, Anonymous: anonymous, ShaderVisibility: D3D12_SHADER_VISIBILITY_ALL };
     let uav = |k| root(D3D12_ROOT_PARAMETER_TYPE_UAV, D3D12_ROOT_PARAMETER_0 { Descriptor: D3D12_ROOT_DESCRIPTOR { ShaderRegister: k, RegisterSpace: 0 } });
     let params = [
@@ -507,8 +513,7 @@ void main() { c.InterlockedAdd(0, 1u); }
         unsafe {
             let _one = ONE.lock().unwrap_or_else(|e| e.into_inner());
             let Some(dev) = device() else { return };
-            let cs = real::compile(src, "cs_5_0");
-            assert!(!cs.is_empty());
+            let cs = compile_compute(src).expect("compile the dispatch counter");
             let param = D3D12_ROOT_PARAMETER {
                 ParameterType: D3D12_ROOT_PARAMETER_TYPE_UAV,
                 Anonymous: D3D12_ROOT_PARAMETER_0 { Descriptor: D3D12_ROOT_DESCRIPTOR { ShaderRegister: 0, RegisterSpace: 0 } },

AI assistance: Codex (GPT-6.2 Astra) wrote the fallback, ran the builds and tests, and checked the capture.

theaustinayers and others added 3 commits November 25, 2026 01:21
A last Release signalled every queue and waited for the GPU to say it is idle, then ended the object:
130 - 190 us each on the title's thread (the driver takes ~100 us to end a texture), and a title ends
thousands when it changes places. Only a buffer can be over pages that are freed next (an imported
heap pins them), so textures and XCL's own buffers in video memory go to the thread at once: 2 - 5 us.

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

Copy link
Copy Markdown

RTX 4070 Ti 12 GB on this branch: on driver 616.56 the first world-load run blue-screened the whole PC (bugcheck 0x13A, KERNEL_MODE_HEAP_CORRUPTION); on 621.40 the same runs end in a device removal instead. With caches filled it reaches the world, which is flat grey, then the device goes at 119–135 s.

Setup: RTX 4070 Ti 12 GB (32-lane waves), Ryzen 7 7800X3D, 32 GB RAM + 64–96 GB page file, Windows 11 Pro 26200, Rust 1.100.0, release. Heads 41303e4 and f7e08e6, unchanged. XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_UMA_SHADOW=1 XCL_NETWORK=0, scripted A presses, XCL_FRAME_DUMP=90.

  • Caches: your XCL_PRECOMPILE_SLICE=i/4 (4 processes, XCL_DXC_THREADS=3) built all 2,689 compute pipelines in 21 min, 0 errors, 0 refused, free commit never under 54 GB. After the driver update all of them had to be built again (same 21 min): the old driver's blobs are not reused.
  • Driver 616.56, one run (41303e4): 444 of 450 compute builds from the cache; 2,700 frames by 127 s at 10–17 fps after the presses; at ~211 s the PC blue-screened, bugcheck 0x13A (0x12, …), no dump written. Free commit was 26 GB at the time. One occurrence, so I can't say it always happens, but anyone on a pre-620 NVIDIA driver may want to update before running this branch.
  • Driver 621.40, 5 runs:
    • First run (graphics pipelines cold): about 230 graphics builds between 90 and 375 s (~1 per second) on the loading artwork, then 0x887a0005 at 375 s.
    • Warm rerun (41303e4): 447 of 469 builds from the cache; the loading artwork fades out to a flat dark-grey frame (the in-world grey you describe), ~2.5 fps, 0x887a0005 at 173 s.
    • f7e08e6, three runs: 0x887a0005 at 127, 135 and 119 s, each just as the loading artwork fades. Local video memory before the removal: 19.4 GB with XCL_UMA_SHADOW=1; without it the peak is 14.8 GB but the removal comes at 119 s all the same. No nvlddmkm event in the System log for these removals (there is one for each 0x887a0006 hang below), and GetDeviceRemovedReason gives 0x887a0005 itself. With XCL_GPU_PROFILE=1, the op still running 0.8 s before one of them was CS 1b5466f261a70cde (8x8x1, split wave64, 160x90 groups), the slow program already listed on Newer retail title (TitleID 7952987A): reaches world loading, then the title's GPU watchdog ("GPU Loc Sig") after ListX #101 stub #505; one sample.
  • D3D12.X: a console MS in the AS slot is translated as the mesh shader it is #541 on 41303e4: its 40 AS-slot mesh pipelines are translated instead of refused, but this tree never runs a two-pass pipeline (they reach execute_indirect's PC path with the title's root signature): XCL_GPU_PROFILE shows ExecuteIndirect with a PC pipeline … RUNNING for 7774 ms, then 0x887a0006 (2 of 2 runs, before the world). With D3D12.X: execute two-pass mesh shaders on DispatchMesh and ExecuteIndirect (supersedes #724) #2092 merged on top as well, two-pass ExecuteIndirect(DispatchMesh) runs (past Olympus: reject invalid mesh branch targets #16,384) and the first run had no hang; its warm rerun hung (0x887a0006) at 128 s as the load faded, with nothing named. D3D12.X: execute two-pass mesh shaders on DispatchMesh and ExecuteIndirect (supersedes #724) #2092 does not merge cleanly on f7e08e6 (the sharded list state in bind.rs), so I have not run it there.

So on a 12 GB card this branch gets into the world, but the run ends at world load in the same way @mgrein's RTX 4070 runs in #1773 do.

Not tested: more than one run of the 616.56 crash; f7e08e6 with #541 + #2092; XCL_WATCH_HOT=0; graphics pipelines across a third warm run.

AI use: Claude Code (Claude Opus 5.5) built the trees, ran the title on this machine, read the logs and frame dumps, and wrote this report.

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.