Nvidia dev #2572

Open
github-bot wants to merge 429 commits from github-bot/gh-2572 into main AGit
Owner

@⁠bmjask on GitHub · 2026-11-25 23:18 UTC · original
theaustinayers:nvidia-dev → main · +44395 −4116 · 98 files · 429 commits · open

What is in it

Tested

  • hardware (GPU + driver, CPU), Rust version, debug / release:
  • cargo test --workspace -- --test-threads=4: N passed, N failed, N ignored (SKIPPED GPU tests: …)

Regression run

main:

PR:

Not tested

AI use

  • none / tool and model, and what it did
**@⁠bmjask** on GitHub · 2026-11-25 23:18 UTC · [original](https://github.com/xcl-dev/xcl/pull/2572) `theaustinayers:nvidia-dev` → `main` · +44395 −4116 · 98 files · 429 commits · open <!-- What changes and why, in a few sentences. "Fixes #N" / "Part of #N". Stacked: "Stacked on #N". --> **What is in it** - **Tested** - hardware (GPU + driver, CPU), Rust version, debug / release: - `cargo test --workspace -- --test-threads=4`: N passed, N failed, N ignored (SKIPPED GPU tests: …) **Regression run** <!-- Required when the PR changes crates/xcl/src outside tests: `scripts/smoke.ps1` on a real title, built from main and from this PR's head commit (no uncommitted changes); paste both blocks. Rerun the PR's after every push. Not needed for docs / tests / scripts only. --> main: PR: **Not tested** - **AI use** - none / tool and model, and what it did
A retail title's NGG transform programs (128 vertices / 128 primitives,
21 params + SV_ClipDistance0 = 352 B per vertex) all failed ms_6_6 with
"vertex plus primitive output size is greater than 32768": the split
budget divided 32768 by the stride, but DXC accounts whole chunks of 32
vertices even when fewer are declared - verts[78] at 352 B is accounted
as 96 (33792 B) and refused. Measured with dxc 1.8.2502 on this machine:
every boundary from 9 to 26 float4 rows agrees with the chunk model.

passthrough_split now floors the vertex budget to a multiple of 32
(capped at 256); the wide records go out in 7 groups of 19 triangles
instead of 5 groups of 26 that DXC refuses. Test: the wide record splits
and compiles, a 96-vertex group at 320 B compiles, a narrow record stays
whole; fails without the change (5 != 7).

Assisted-by: DSH (GPT-6.2 Astra)
The emitter picked the whole-record layout from passthrough_split == 1, but
that count is the dispatch's: a record of 80 vertices with 22 float4 rows
does not fit the mesh output budget as a whole (DXC accounts 96 vertices,
33792 B > 32768) while its single triangle's compact copies fit one group,
so the count is 1 and verts[80] was declared and refused. The declaration
now follows the vertex budget independently of the group count; the compact
form covers every record over the budget, including the one-group ones.

mesh_layout_independent_of_group_count covers the asymmetric limits (80
vertices, 1 triangle, 22 rows): compact declaration, count 1, DXC accepts.
Found in review by shdann (PR #304).

Assisted-by: DSH (GPT-6.2 Astra)
Review nits (Parakeet-Wheat): mesh_layout_independent_of_group_count ended with a block that rebuilt the same MsInterface and asserted verts[3] again; it now compiles the whole-record declaration (verts[80], accounted as 96: 33792 B) and asserts DXC refuses it. passthrough_split's doc claimed a comparison of the two forms it does not make; the doc now states what it does. Tests only plus a doc line; no behaviour change.

Assisted-by: DSH (GPT-6.2 Astra)
A retail title's minimap pipelines carry their console MS container in the AS
subobject with no MS subobject. They were refused: translated, the title had
rendered nothing from then on. That black screen was the translated mesh
shaders failing their ms_6_6 output budget, fixed by the DXC vertex-chunk
budget (#304); the slot itself was never the problem. With the budget in
place the same shaders translate and the title keeps rendering.

mesh_shader_slots moves the container to the MS slot (and it is not an AS any
more); a real AS, an MS already present, or a PC shader are left as they are.
Unit test covers all five cases.

Assisted-by: DSH (GPT-6.2 Astra)
The title creates tens of thousands of console-MS-in-AS-slot pipelines during boot and uses few. Translating each in the cached-only attempt ran on the title's thread: on RTX 3060 Ti the intro's first bright frame came ~5 s later than main (frame 1100 vs 980 at XCL_FRAME_DUMP=120), and on RX 9070 XT (wave64, the split path) Chrysana's 60 s captures stayed black throughout with 57163 pipelines queued. The attempt now defers a moved MS like a console compute pipeline (dxc::defer under pso_async::lazy): go_background hands the title a stand-in and the worker or the first bind translates. The detection log moved to a sparse counter at the build (first 5 + every 1000th); it used to fire twice per deferred pipeline (2930 lines in 120 s).

Assisted-by: DSH (GPT-6.2 Astra)
fallback_stream decided 'mesh' by an MS subobject; the retail title's moved-MS streams have none (the console MS sits in the AS subobject), so the stand-in emptied the AS and kept a plain PS: a stream with neither a VS, CS nor MS, which the driver refuses (E_INVALIDARG). go_background then returned None and dev_create_pipeline_state built every such pipeline in the title's call, so the deferral never took effect (NishantParajuli on RTX 5060 Ti, Chrysana on RX 9070 XT: black frames, ~57k pipelines queued; thehollowedone's native fixture: D3D12 message 1022, no VS/CS/MS). The stand-in of such a stream retypes the AS subobject to MS with the dummy mesh shader and uses the mesh dummy's PS, as translated_mesh_stream reads the title's stream; a real AS is emptied as before. Test the_stand_in_of_a_moved_ms_is_a_mesh_pipeline fails without the change.

Assisted-by: DSH (GPT-6.2 Astra)
The retail title's depth-only mesh pipelines use console-only formats (D16_UNORM_S8_UINT). allback_stream copied the title's formats as they were, so the driver refused the stand-in (E_INVALIDARG). go_background then returned None and dev_create_pipeline_state built every such pipeline in the title's call, so the deferral never took effect (NishantParajuli's follow-up, reproduced natively by thehollowedone). The stand-in's RENDER_TARGET_FORMATS and DEPTH_STENCIL_FORMAT now go through device_x::pc_target_format, as the real pipeline's do. Test 	he_stand_in_of_a_stream_has_the_pcs_target_formats fails without the change.

Assisted-by: DSH (GPT-6.2 Astra)
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 <[email protected]>
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 ivall/xcl#258.

Co-authored-by: Ahmet Dedeler <[email protected]>
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 #258.

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

Co-authored-by: Ahmet Dedeler <[email protected]>
Assisted-by: Claude Code (Claude Opus 4.6 ported it; Claude Opus 5.5 reviewed and fixed the import-check assertion)
A root signature with CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED or SAMPLER_HEAP_DIRECTLY_INDEXED has the
console put the 32-bit address of the bound view heap / sampler heap into user SGPRs after the
root arguments, the view heap's first. XCL left these registers 0, so the shaders read their
descriptors from address 0 on.

Measured on a retail title: 110 of 153 root signatures at its first screen have one of the flags.
All 540 of its compute shaders with such a root signature that were built (218 with the view heap
flag, 3 with the sampler heap flag, 319 with both) have exactly one user SGPR more per flag than
their arguments take; those with both load T# from the first. The pixel shaders of 49 572 pipelines with the
sampler flag have one more as well (by where their m0 comes from). The pictures of its loading screen took a wrapping sampler
instead of the clamping one they ask for: a flickering line at their top edge.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The disk cache of compute driver blobs (#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)
Console mesh shaders translated to a two-pass pair (compute + mesh/PS,
TwoPassPso) were built by CreatePipelineState but had no execution path:
DispatchMesh was not hooked on the console command list vtable, and
ExecuteIndirect did not dispatch the compute pass or bind the record
buffer (u1) before invoking the mesh pass.

Hook DispatchMesh (slot 127, newer layout slot 129) and handle TwoPassPso
in ExecuteIndirect:
- Track console mesh root-argument layout (s[8:9] spill table, inline
  arguments from s16 across 16 SGPRs) in console_list::user_data_ms.
- Create a companion DISPATCH command signature alongside non-root-changing
  DISPATCH_MESH command signatures in device_x::create_command_signature_x.
- Allocate/recycle a DEFAULT-heap UAV record buffer per command list
  (recycled on allocator reset), bind u0 (io), u1 (res), u2..u5 (UMA),
  run the compute pass -> UAV barrier -> mesh pass -> UAV barrier, and
  scale indirect DispatchMesh group counts on the GPU when
  mesh_groups_per_record > 1.

Assisted-by: Antigravity (Gemini 4 Neon)
Without IO_UMA_BASE_HI the pair picked no memory window for any access.
DispatchMesh runs at most the groups the buffer holds; ExecuteIndirect's
arguments are rewritten on the GPU with the same bound for both passes.
Both passes index records by gid.x, so the rewritten arguments put x·y·z in X.
The rewrite reads the commands through the memory window, not the title's buffer
in a guessed state, into shared scratch blocks capped at 16 MiB a recording.
CreateCommandSignature passed the console's argument type 107 to the PC,
which refuses it (debug layer 743, "Unexpected parameter type"). A UE5
title (Xbox Series build) creates its DispatchIndirectMeshCommandSignature
with this one argument and stops at E_INVALIDARG during RHI init. It now
becomes D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH_MESH, as DispatchX (105)
becomes Dispatch. A refused signature is logged with its arguments.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Each command's records start at record 0, so its mesh pass draws them before the
next command's compute pass; commands past a count buffer's count get no groups.
Keep NGG compute and passthrough mesh graphics driver blobs under independent canonical keys. Retry rejected entries under the existing cold-compile policy and validate fresh-process replay, per-pass corruption, and GPU output on synthetic inputs.

Part of #1269. Related to #1836 and #902.

Assisted-by: OpenAI Codex (GPT-6)
A black presented frame does not say whether the scene was drawn and the
composite lost, or the scene never drawn at all; nor which of the draws
that should have made it actually ran. XCL_FRAME_DUMP shows only the
presented image.

XCL_DUMP_TARGETS=<work>[,<frames>]: in the first <frames> frames (default
1) with at least <work> draws and dispatches, each render target drawn
into, and the depth buffer drawn with most, is logged with its address,
size, format and its draws split into ran (translated pipeline), stand-in
(pipeline still being built: draws nothing), PC (untranslated) and
skipped. The eight drawn into most are read back with the presented frame
and written next to it (target<k>_<n>.bmp), with how many of their
sampled texels are not zero and how many differ from the first one (a
cleared target has none that differ). The census reads by the footprint's
texel size and stops at the end of the readback buffer. The depth buffer
is not copied: XCL does not know the state the title left it in, and a
copy from DEPTH_WRITE is invalid. A frame counts as dumped once its
copies are submitted; one waiting for a present that copies is kept.

XCL_DUMP_AFTER_S=<s>: no frame is dumped until <s> seconds (fractions
too) after the first present (a title's menus are busy frames too).
Invalid values of either switch are logged once.

Off by default: every hook returns on a cached check of the switch, and
DSVs are only recorded with it set, so nothing is locked or allocated
without it.

Assisted-by: Claude Code (Claude Opus 5.5)
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 (#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 <[email protected]>
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 <[email protected]>
Claude-Session: https://claude.ai/code/session_015JSG96tVb4ZSAZ5WH4v95v
With XCL_HEAP_WINDOWS=1 the pair reads the memory windows from the shared heap, as
bind_abi's programs do; a list that set none got no heap.
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 <[email protected]>
`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 <[email protected]>
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 (#289 rereads only the
entries that are 0). Over 16 000 requests a run were written into pages
the title had since reused: its objects got garbage pointers and it
crashed about 20 s into world loading; when the old pages were freed,
the request failed with E_ACCESS_VIOLATION.

The console reads the list when it runs the request. execute() now
reads it again (through read_own, as the snapshot) and takes it when it
differs and every page in it is allocated (kernelx::physical_pages_live);
otherwise the snapshot stays, so arrays on the stack that were
overwritten since still work.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Local test only (the upstream PR is a draft, #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 <[email protected]>
When a draw's arguments find no room in unified memory (the arena's pool is used up and the
window has no free run), log once (and every power of two) the window's free bytes, largest
free run, bytes in use, pool blocks left and the blocks the pending allocators hold. Log the
title's GPU heaps that do not fit in the coherent window.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A title's GPU heaps (committed with a PAGE_GRAPHICS_* protection) go to
the coherent window, process memory the GPU reaches over the bus. On an
RTX 5090 a shader's dependent reads there are ~30x slower than from video
memory (no L2 hits, about 2.4 us each). Its store instructions whose lanes
leave gaps (per-lane dwordx2/x4, 8- and 16-byte formats) run at ~0.1 GB/s,
against ~50 GB/s for lane-contiguous ones and >1 TB/s in video memory. The
retail title of #505 keeps 4.4 GB of heaps there (1172, 2199, 563 and
596 MB), and its world passes take 0.4-2.7 s each. Keeping the heaps out
of the window was reproduced as removing the stall on an RTX 5080, an
RTX 3080 and RDNA3 / Linux (#505), but there the shaders read zeros.

With `XCL_COHERENT_HEAPS=sparse` every such heap, with `sparse:N` those of
at least N MB, goes to the sparse windows instead: video memory, with the
CPU's writes uploaded before each submission, like the title's other
graphics memory. A heap that goes there is not counted in the coherent
window's size for the next run (`note_coherent_need`). Off by default: it
costs a second copy in video memory and the write-watch scan of it, and it
needs the asynchronous copies back of the commit below. Without them, the
copies back of the title's lists' writes into these heaps wait for the
submitting thread.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The watchdog's first three time-outs log, for every GPU wait not yet met, which queue waits for
which value of which cell or title fence, and which submitted signal (queue and its place among
that queue's calls) will meet it; a wait for a value nothing has signalled yet says so. Used to
find the loop all five queues of a title were in.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Every 1024 ExecuteCommandLists, the log says how long one took on average: the wait for the
refresh lock, the refresh itself (look for CPU writes, state lock wait, chunk scan, upload and
the rest, from the existing counters), the PC ExecuteCommandLists and everything XCL does after
it (signals, copies back), and the submits a second. A few relaxed adds a submit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A retail title keeps 65,000 textures in step with its memory. Every submit went through all of
them for the ones whose memory changed, and every change of a page mapping in a GPU view
re-checked the source of each (with a VirtualQuery): 2-9 ms a submit. Now the textures are
indexed by the 1 MiB pieces of their source and the waiting ones are kept in a set, so a submit
looks at those the dirty pages touch; a mapping change re-checks only the textures in the changed
ranges (kernelx keeps the ranges of the last 4,096 changes).

The looks for CPU writes join hot blocks up to 64 MiB apart (XCL_WATCH_GAP_MB), keep a block hot for
1.5 s (XCL_WATCH_HOT_MS), and the walk thread makes fewer, larger calls.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A submit's scan (64-byte chunk hashes of 4 KiB pages) took up to 1.6 ms and the copies into the
ring up to 2 ms of one thread in a heavy scene. From 256 pages on the scan is cut into pieces of
64 pages, from 512 KiB on the copies into about 16 pieces, and the submitting thread shares them
with XCL_COPY_THREADS (4) worker threads that wait between jobs. The results keep the address
order, and the thread does not go on before every piece is done.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
title_textures::refresh runs on the title's thread before each of its
submits and uploaded the CPU's writes to its textures on XCL's own queue,
then waited on the CPU until the GPU had run them (texture::upload_batch).
While a retail title streams its world with video memory past the card,
those waits are long: thread dumps show its submit thread blocked in
fence::wait under refresh, presents drop to a few per 20 s, and the title's
watchdog ends it on the loading screen.

When the submitting queue is a DIRECT queue on the texture's device, the
upload list now runs on that queue, ahead of the title's lists, so the GPU
orders the copies before the work that samples them, with no cross-queue
wait. A fence on that queue retires each batch's allocator, list and staging
buffers at later submits; over 512 MB in flight the oldest batches are waited
for, and a batch whose wait fails or times out stays in flight. Compute and
copy queues, and a queue of another device, keep the upload queue and its
wait. texture::submit_batch is upload_batch without the wait.
A title's loads write gigabytes of its memory with XCL's own copies (DirectStorage), and the looks
for CPU writes found those pages through the write watch: each written 2 MiB block stayed hot for
1.5 s and every look walked it, which is most of what a look costs while a title loads. Now the
DirectStorage writers tell the next look their ranges (`note_known_write`) and clear the write
watch for the pages inside them; the pages at the ends stay watched. The next submit takes the
ranges as dirty pages, also when it skips its look. `XCL_DS_KNOWN_WRITES=0`: as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
From a review of the local changes:
- The fence cells the title reads (`fence_x`) are stored after the copies back a value covers have
  landed (a value the title waits for promises the memory behind it), read and stored one refresh
  at a time.
- A copy back (and a stored immediate) lands 64-byte chunk by chunk, never over a chunk the CPU
  wrote since it was last sent: those bytes are newer and go up with the next look.
- `settle_readbacks_within` waits for the state's lock up to a bound; GetCompletedValue no longer
  spins 2 ms per copy back.
- Memory the title commits, and the memory of a texture it places, is looked at for a while
  (`mark_hot`): a write made right after the commit was seen up to 20 ms late.
- A copy back that finds no readback buffer still signals its queue's fence; at most 32 finished
  readback buffers are kept; `pagelog::counts` takes no blocking lock in the exception filter.

Loading:
- The watched ranges are made of 16 MiB blocks of the textures' sources, not from all textures (tens
  of thousands of them, each submit while a title loads).
- A DirectStorage destination in a sparse window is written without a VirtualQuery (a query there
  walks the whole committed heap: 3-5 ms a request, with a 2 GB heap). A part the title gave back
  fails the write (`write_title`).

The unit test of #1993 waits for the per-queue fences now. `submit_cost` also counts ranges,
re-checks and texture uploads.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The counts come from memory the GPU wrote. Where that is not what the title meant (a wait that was
released early, memory another resource used before) they can be anything, and a dispatch of
billions of groups holds the GPU for seconds or until Windows resets the driver: in a retail
title's world the culling passes (wave64 split in halves, RTX 5090) ran for 1.4 to 30 s in 4 of 8
runs. Measured with this: six ExecuteIndirects within 1 ms with counts like 0xff000000 x 0xe3 x
0xff7f0000, not run, and no program ran longer than 0.5 s in that run.

A program of XCL's own reads the counts first (through the memory window the shaders write),
hands them to the ExecuteIndirect in a buffer of XCL's own, 0 groups where they are out of range,
and records them for the CPU: the log names the program, the counts and the address of the first
64 out of range, and the GPU profile shows the counts of each ExecuteIndirect. It also counts how
often the title's buffer showed other counts than the window. XCL_INDIRECT_GUARD=0 turns it off,
XCL_INDIRECT_MAX_GROUPS is the limit (4 Mi groups).

Test: an_execute_indirect_with_garbage_counts_runs_no_groups (GPU).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A buffer a title places in a sparse window is a reserved resource over the window's tiles, mapped
once. A tile decommitted and flushed was unmapped from the window only; memory committed there
again got another tile in the window while the buffer kept the old one: shaders write the window,
an ExecuteIndirect or a copy reads the buffer. The tile is kept mapped in the window while a buffer
uses it (its video memory was kept already) and comes back with the next commit.

A buffer's release looks its tiles up by their address instead of searching all mapped tiles.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
XCL_SYNC_TRACE=1 keeps the last 1500 sync events (each list's waits and writes, what became of
them, submits) and logs them at the first three cycle breaks and before the watchdog's first two
releases. The wait edges are logged before the release too: after it they are gone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
On the newer console command-list layout (real::QUEUE_SHIFTED), titles reset pooled lists through slot #139 Reset(allocator, initial_pso, flags), which real.rs routes to list_x::reset_x.

title_list's wrapper vtable only overrode slots 0, 1, 2, 9, and 10, leaving slot #139 as a raw forwarder to F_BACKING. Once a mid-list Wait64 split switched F_BACKING to a continuation segment, #139 reset only that continuation segment and never ran title_list::reset: F_PRIMARY stayed bound to the previous recording/allocator, F_BACKING was never restored to F_PRIMARY, and extra_active kept accumulating split segments across frames.

On pre-#897 main that caused D3D12 device removal (0x887a0001 / debug-layer id 541) as soon as the old allocator was reused; even with #897/#907 allocator pooling, stale primary/prior segments continue to be resubmitted and extra_active grows until MAX_EXTRA_SEGMENTS.

The wrapper's #139 is now a guard::make_layout_split of its own: a title on the newer layout goes to a four-argument adapter that runs wrapper reset, while a title on the older layout and the runtime take the generated forwarder. The forwarder's tail jump keeps the caller's return address and arguments, which the backing list's own layout guard at #139 needs to tell a title from the runtime; calling the backing slot from Rust would hide it and send an older-layout title to the PC method.

Tests: one covers the forwarder and the newer-layout reset on fake lists; one calls the slot from a caller in a registered mapped image, with the backing slot behind a layout guard as real.rs installs it and a test-local layout flag (flag clear: the older handler with the title's arguments; flag set: the primary is reset and the split segment reclaimed).

Co-Authored-By: Antigravity <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit b3a969b72c)
`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 <[email protected]>
(cherry picked from commit b67c8f0cb5)
Two bugs in title_list segment and wrapper lifecycle:
- When a title_list split onto an extra PC segment and later returned
  that segment to `spares` via Reset or KickoffX, `alloc_pool::forget_list`
  was never called on the retired segment. The segment stayed in its
  backing allocator's `users` set indefinitely, preventing that backing
  allocator from being reused and leaking new PC allocators on every Reset.
- In `title_list::release`, after `f(pc)` freed the primary PC list,
  `WRAPPER_OF.remove(&pc)` and `bind::forget(pc)` ran unconditionally.
  If another thread created a new command list that reused the freed `pc`
  address in the window after `f(pc)`, the old wrapper's cleanup detached
  the new wrapper and wiped the new list's bind state.

Call `alloc_pool::forget_list(list)` inside `list_x::clear_segment_state`
(covering both `title_list::reset` and `KickoffX`) and before releasing
spare segments; in `title_list::release`, only remove `WRAPPER_OF` entries
still mapped to `this` and skip redundant `bind::forget(pc)` when `pc` was
adopted (already cleaned up inside `real::cl_release`).

Assisted-by: OpenCode (Gemini 4 Neon)
(cherry picked from commit d827520e3d4741137e4b569fde77e415024cb186)
A title's allocator Reset while the GPU still runs what was recorded on
it puts that PC allocator aside (alloc_pool, #897) and returns S_OK.
real::alloc_reset took the S_OK as "the GPU is done" and freed every
unified-memory block that ended recordings on the title's allocator had
used: root argument tables, io and AllocateUploadMemory blocks. Coherent
blocks go back on the pool's LIFO stack, so the next translated draw can
take one and write its arguments over those a submitted draw has not
read yet; sparse ones are decommitted. #897 counted 240 such swaps in
60 s of a retail title's world.

The blocks were also held under the title's allocator, which since #897
stands for PC allocators that change, so no one Reset could tell whether
the GPU was done with all of them.

A recording's blocks are now held for the PC allocator it is on (the one
alloc_pool's reset_list hands to the PC Reset), and alloc_pool gives a
PC allocator's blocks back at the title's Reset once the GPU has passed
every submit on it, whether it is in use, was reset or was put aside. A
PC allocator made here that is released gives its blocks back with it.

The device test through the Reset hook finds the blocks freed at the
swap on the old code (run on Wine's D3D12 over MoltenVK; no Windows
machine here).

Fixes #1358.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 790185635d)
Found and fixed by @WebIdentity1 in #2092.
The same rule as for Write64 cells (the covered waits of would_signal_close_cycle) in
break_cycles_before_title_signal: a wait that an earlier submitted signal of the title's fence
satisfies does not wait on the new one. Counting it released a cell's GPU wait on the CPU in every
pipelined frame that has such a pair, before the work it waits for had run.

Test: a_title_fence_wait_an_earlier_signal_covers_is_no_cycle.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
As for dispatches: an indirect draw whose vertex or instance count was garbage held the 3D engine
for 8 s in a retail title's world (RTX 5090) and ended in a driver error (nvlddmkm 153). The guard
reads the arguments of signatures of one Draw or DrawIndexed too, and hands zeros on where a count
or the product is beyond what a frame draws (2^28 vertices, 2^24 instances). XCL_INDIRECT_GUARD=dispatch
checks dispatches only.

Test: an_execute_indirect_with_garbage_counts_draws_nothing (GPU: the arguments the draw would get,
copied out).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
`readable` asked the working set for up to 16 pages and VirtualQuery for more. VirtualQuery sizes
the whole committed region behind an address by walking it: in a title's 2 GB heap 20-30 ms a call
(measured: 29 ms at the start of a 2.2 GB block, 2.8 ms with 300 MB behind, 50 us for 4096 pages
from the working set). Each submit checks every texture of more than 64 KiB that was written: 30-50 ms
of a frame in a retail title's world.

The working set is asked in batches of 512 pages. In a range of more than 16 pages a page that is
not resident is read by the kernel (one byte), as the caller's reads would: committed, or not
readable. Short ranges (a title's pointer that may be garbage) are answered as before: such a page is
not touched, VirtualQuery answers.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
From a review: the program of a count out of range is known without XCL_GPU_PROFILE, and forgotten
with its pipeline; what was found is logged from the GPU wait watchdog too (nothing is recorded any
more when the GPU stands); a record says that it is there before it is logged; a count of 0 beside
garbage is no garbage (it runs nothing); the title's address is logged; the title's buffer is read
for the comparison only with XCL_INDIRECT_GUARD=compare; the ring holds 256 Ki slots; the tests
reuse a slot that holds good counts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Conflicts:
- the translator's version is one of its own (its output differs from main's: globallycoherent
  windows only where a program needs them, #1850);
- compute and graphics driver blobs reach the disk cache also when the store in memory is full
  (main's read_pso_cached_blob and graphics blobs, our return of the blob);
- sparse: our copies back with main's lock_state and wait notes;
- title textures: our uploads on the title's queue in main's batches (256 textures, 32 MiB);
- DirectStorage: a page list is read again at execution (#1405) through main's read_own (#509);
- list_x / bind: our diagnostics and the ExecuteIndirect guard kept.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The copy of the frame to XCL's window is a submit on the title's queue that reads none of the title's
memory: it took a full look for CPU writes (one of three a frame, 6.6 ms in a retail title's world).

submit_cost also counts the textures looked at, unchanged and uploaded, their bytes, and the time
comparing, detiling and submitting.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	crates/xcl/src/hle/d3d12x/title_textures.rs
FlushGpuCacheRangeX and FlushShaderCacheRangeX of the newer list layout were answered with nothing.
They are how a title orders a pass behind the one that wrote what it reads: a retail title calls them
thousands of times a minute, and its compute passes (the ones that write indirect arguments and the
ones that read them) had no order there. FlushPipelineX (#67, newer layout #69) as well; at #69 a
newer-layout title's call ran Write32BitValueBottomOfPipeX with the flags as the address.

The PC has no ranges of caches: a UAV barrier for all resources, on direct and compute lists.

Test: cache_flushes_are_uav_barriers.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
- 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 <[email protected]>
- 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 <[email protected]>
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 <[email protected]>
# 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 <[email protected]>
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 <[email protected]>
How many of a look's pages the looks before it had found too, in how many
runs they lie, how many of the scanned pages changed, and how long before
its submit the youngest list was closed: the figures that say whether a
look ahead of the submit, or leaving always written pages out of the
write watch, would pay.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A title starting on a Series S profile maps 4.3 GB of physical pages in
small pieces (MapTitlePhysicalPages -> sparse::committed), and each new
tile cost one UpdateTileMappings + signal (~0.4 ms). Its loading thread
was held ~25 s with nothing presented and its stall watchdog ended it.

New tiles now get their pool tile in `mapped` at once and their mapping
call is queued (`pending`); `flush_pending` sends them, one call per
window, before the title's next submit, before XCL's own copies and
readbacks on the windows, or past 4,096 tiles. A tile decommitted
before the flush is skipped.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit b52f7cb672)
(cherry picked from commit f03d411812)
XMemMapPhysicalPagesScatter takes each unmapped page home on its own: one
VirtualAlloc, one VirtualQuery and, in a sparse window, one
UpdateTileMappings and one Signal per 64 KiB page. A retail game unmaps
4136 and then 6720 pages in two calls while it loads, and the homes of
each call are one run of neighbours: 2.7-3.2 s in those two calls, the
larger part in the tile mappings.

The parts of a call that only unmap (1024 pages, 64 MiB, at a time) now
commit their homes ahead, a run of neighbouring pages per VirtualAlloc and
per sparse::committed. Homes that are committed already, or cannot be,
still go page by page, and a call that fails part way gives back the homes
no page went to. The two calls take 0.4-0.5 s.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 3b54c24f57)
On top of "new sparse tiles are mapped together before the next submit":
work already on the GPU can reach memory the title commits now without
another submit, when it waits for a fence the CPU signals or a value the
CPU writes. The mappings put off are sent before a title's CPU Signal,
and by a thread 2 ms after the first of them when nothing else sends
them. A tile kept for a placed buffer before its mapping was sent keeps
it pending, as a parked one does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Two threads that both found no device made one each and opened the
memory windows for it: GPU work on the one with window addresses of the
other read zeros or hung the GPU (four driver resets in two minutes of
unit test runs; tests call `real::init` directly next to others that go
through `backend`). A title comes in through `backend`, which asks once.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The runs of mapped tiles were sorted out of all of them again for the
first look behind each commit (a retail title has 150,000 mapped), under
the state's lock. They are kept with the tiles now, as ranges. The
pieces to clear are an ordered set: a decommit takes out its tiles' and
does not go over all of them, which grew with the square of the pages
while a title loads and submits nothing; neighbours go up as one copy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A look's time goes up with the pages it takes, ~0.5 us each with the
title's threads running, and a retail title's world had ~8,000 a look:
5 ms on the thread that submits. With XCL_LOOK_AHEAD a thread takes the
written pages of the hot blocks every so many milliseconds; the next
submit takes those with what its own look finds, and one whose lists
were closed before such a round began needs no look. What is uploaded,
and when, stays as it was. Ranges that come out the same stay the same
object, so the hot blocks are kept.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
XCL_ACTIVITY logs every 2 s how many placed textures and buffers, page
mapping calls, memory calls and pipelines the title's threads made and
the milliseconds XCL took for them: where the time of a loading screen
goes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The lock goes to the first to ask once it is free: a thread that takes it
again and again (a title mapping its memory a page at a time) is back
before a waiting one has woken. Measured with 0.4 ms holds and no gap:
171 ms median and 1.8 s at worst for the waiting thread; with the rule
0.14 and 0.4 ms. Also: XCL_TEST_WARP for the test device.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A look for CPU writes between a page's copy and its `sparse::committed`
took the written pages of a tile that has no video memory yet: they were
reset and dropped, and nothing reported them again, so the GPU read zeros
there until the CPU wrote the page once more. With a mapping call's pages
told in runs that gap was the rest of the call. Pages with data are told
first, the run stays for fresh ones; a page moved between addresses the
same.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
`copy_readable` fell back to splitting the range at every failed
ReadProcessMemory: for memory that is only reserved that is two calls a
page. A retail title makes its textures before it maps their memory, and
13.6 GB of them went up at 0.5 GB/s while its world loaded (27 s of its
submitting thread). The regions are asked for once each, as
`read_committed` did; both share the code now.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
What independent reviewers confirmed in the commits since 0ba3b8c:
- the flag that says mappings wait went before they were sent: a CPU
  signal of another thread saw nothing to do and let waiting work run
  ahead of them. It goes after the flush, and a signal asks each time;
- a queue's Signal (and SignalX) sends what waits, as a fence's does;
- lists that go out after a wait on the CPU inside a submit see what the
  title committed meanwhile mapped and cleared;
- a heap made with the state locked: what waits is sent first;
- the walk gets the watched ranges at every submit, and a submit goes
  without a look of its own only when the walk has found no written
  block since the last look began.
Tests: two GPU tests skip where the device cannot run them (the software
device is removed by copies into a reserved buffer of 3 GiB, and a device
without sparse windows puts nothing off).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Conflicts: bind.rs State keeps both the allocator's alloc_pool note and
the new heaps field; bind_abi keeps the tree's window-0 lookup and its
shadowed-memory refusal and reads the heaps with the layout and
arguments; SetDescriptorHeaps both marks the heaps changed (the shared
view heap is bound again) and records their console addresses.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Conflict: NEWER_LIST_SLOTS keeps the tree's (69, 67) and adds the PR's
(129, 126): 23 pairs. The older slot it names gets its handler from the
two-pass merge that follows, which settles the pair.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The branch carries #304's budget commits, which the tree has already
(merged under other hashes, with a later doc of the measured range).

Conflicts: passthrough_max_vertices keeps the tree's later doc (the
whole measured range); the recompiler tests keep #1984's edge-flag
test next to #304's; translated_mesh_stream keeps the tree's deferral
of every console mesh pipeline in the cached-only attempt (it covers
the moved MS the PR defers, and the attempt's result is not used when
it misses) and adds the PR's sparse log of moved shaders after it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The mesh pass of a two-pass (MS / GS) pipeline had no driver blob on disk:
every run compiled it in the driver again. #1942 keeps both passes under
keys of the stream's contents (pointers replaced by what they point to),
the static samplers, the window count and the adapter and driver.

Conflicts with the graphics blob cache resolved: the graphics cache and
remember_compute_blob stay as they were; the two-pass passes use #1942's
build_two_pass_pso (its compute pass key replaces the DXIL-only name, so
compute-pass files of earlier runs are compiled once more); its blob
reader is the existing read_pso_cached_blob; the gate keeps the commit
headroom of the program's size. driver_compile is left to the tests.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Supersedes #724; its commits are kept with their authors.

Conflicts:
- bind.rs State keeps the tree's heap_bound and #1803's heaps next to
  the record buffers and scratch; reset clears the heaps and holds the
  record buffers for the old allocator; forget takes the state out of
  the sharded map (bind::STATES) and holds its buffers. HashMap is
  imported again for the PR's maps.
- console_list.rs Layout keeps #1803's heaps and the PR's inline_ms;
  with_heaps and user_data_ms both stay.
- device_x.rs keeps #1887's log of a refused signature and the PR's
  companion Dispatch signature; the CreateCommandSignature doc is back
  above its function (the merge had put it above indirect_arg_bytes).
- real.rs console slots keep the tree's #131 / #132 FlushCacheRange and
  the PR's DispatchMesh at #127.
- list_x.rs: the PR's bound_heaps test helper removes the list from
  its own part of the sharded recording map.

DispatchMesh slot: #1984 mapped the newer layout's #129 to the older
#126, this PR to #127, where it hooks DispatchMesh. Kept #127: it is
the shift of two slots the other methods have, and #1984's own reading
of the newer layout (#126 / #127 the shading-rate methods, the older
#124 / #125) puts its #128 at the older #126. #1984's test is rewritten
for (129, 127) and checks that the older slot runs bind::dispatch_mesh.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
#1803 gives compute and graphics stages whose root signature has
CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED / SAMPLER_HEAP_DIRECTLY_INDEXED the
32-bit addresses of the view heap and the sampler heap set, in the user
SGPRs after their arguments. The two-pass mesh path left them 0: its io
blocks are made by two_pass_io, not bind_abi.

Decoding the root-layout table of every stage in a retail title's shader
pack (testers' report on the two-pass PRs) found the mesh stages' root
arguments from s16 exactly as user_data_ms packs them, and all but 23
mesh stages taking the heap addresses right after them (view heap, then
sampler heap): s23 / s24 for the most common layout of three tables, a
root view and two constants, its code loading a V# from s23 + index * 32.
With #1803 and the addresses in the two-pass compute pass, a tester logged
s23 / s24 holding the heap bases in 10 000 of 10 000 binds.

two_pass_io now appends them with console_list::with_heaps after the
compute pass's user_data_ms and after the pixel shader's user_data_gfx;
bind_two_pass_stage reads the list's heaps with its layout and arguments.
Test: two_pass_heap_addresses_follow_the_arguments (the mesh layout's
s23 / s24, either heap alone, none without the flags, the pixel shader's
after its arguments from s8); it fails without the change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A retail title reserves 24 GiB of 64 KiB pages twice: a CPU view that
holds the bytes and a GPU-only view of the same pages, and gives the GPU
only addresses of the second. With 4 windows that view is outside every
window and each shader read of it is 0. The 16-window layout
(XCL_HEAP_WINDOWS=1, XCL_UMA_WINDOWS=16) had room for it but did not use
it, and it was not safe as it stood:

- Windows 4..15 were neither reserved nor given memory, yet shaders count
  their addresses as in range and their heap slots aliased window 0's
  buffer: whatever Windows placed there read window 0, and GPU writes
  there landed in it (descriptor heaps).
- The window address table had 8 places, so uma_va_of returned None for
  windows 8..15 and their addresses went to the PC raw.
- The coherent windows could grow to 13 (uma_coherent.txt only grows),
  over every window a GPU view needs.

The layout with 16 windows is now: sparse windows 0..2 as before (C and
the physical-page homes stay there: sparse_reserve / sparse_alloc stop at
the last sparse window), the coherent window(s), at most 7, then 6 view
windows (a kind of their own: reserved PAGE_NOACCESS, not write-watched,
never committed), the rest empty. The whole 64 GiB is reserved, the
coherent windows' uncommitted tails too. Uma::view_reserve hands out
window-aligned ranges of the view windows, view_release gives them back.
contains / is_sparse / is_committed stay false there (the CPU cannot
touch a GPU view); window_of and real::uma_va_of work, and
is_title_address is true for a reserved view range.

sparse::init makes the view windows' tiled buffers as for the sparse
windows (nothing mapped), so they get heap views; a window without memory
gets a null raw UAV instead of window 0's. uma_window_buffer refuses view
windows: the memory operations' readback would touch G on the CPU.
If 16 windows were asked for and cannot be reserved, the fallback to 4
is now an error that names what is lost.

Layouts of 4 and 8 windows are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A GPU-view reservation (64 KiB pages, PAGE_NOACCESS |
PAGE_GRAPHICS_NOACCESS, no address) whose CPU view of the same size is
waiting for it now goes to Uma::view_reserve when the layout has view
windows (16), and is paired with mirrors::reserved there; without room,
or with 4 windows, it takes the path it took before. The CPU view's path
is unchanged: plain write-watched memory outside the windows.

VirtualFree of a GPU view in the view windows tells sparse first
(sparse::decommitted, so mirrored tiles can go), decommits what the
title may have committed there, then unpairs (mirrors::released) and
gives the range back. A commit at a GPU view address and physical pages
mapped there stay plain pages, never the sparse commit path, with a
warning once: the CPU cannot touch G.

mirrors: a pair that forms or goes is now a new GPU-view generation with
its range in the log, so readers of GPU views look at it again; and
released runs before the address can be handed out again (sparse
release, the UMA free path, plain graphics reservations), where it ran
after.

A test of its own process sets XCL_HEAP_WINDOWS=1 and XCL_UMA_WINDOWS=16
before the first uma::get() and reserves the two 24 GiB views through
VirtualAlloc: G lands at a view window's start, mirrors::source(G + x) is
C + x, C is outside the aperture, a release frees the range for the next
GPU view. No device needed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The switch form reaches the windows through the 4 root UAVs. With 16
windows and the heap form off (its views could not be made) or a thread
in the switch form, pso::mem_windows still said 16: the HLSL path then
refused every shader and DXIL quietly made it 4. It now says at most
MAX_WINDOWS whenever the windows do not come from the descriptor heap.

With that, the refusal of the switch-form retry for more than 4 windows
goes: a pipeline the driver refuses with heap windows is built in the
switch form again, reaching windows 0..3 (bound to u2..u5 already);
addresses in the other windows read 0 in that pipeline only.

xcl shaders: --windows defaults to the run's count
(uma::configured_runtime_windows) and is checked with
recomp::valid_window_count, so a precompile for a 16-window run has its
cache keys.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Conflict in bind.rs (execute_indirect's PC branch): both the GPU profile's
timer of the call and the diagnostic's note of it are kept.
The diagnostic notes each draw with how it went (ran, a stand-in, a PC
pipeline, skipped). DispatchMesh and the ExecuteIndirect of a mesh
signature that run as two passes were not noted, so a frame whose
geometry is drawn by translated mesh pipelines listed its targets with
no draws. The two passes count as the one draw they stand for.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
A retail title reserves its memory twice for the same physical pages: a
CPU view that holds the bytes and a GPU view with no CPU access, and it
gives the GPU only addresses in the GPU view. Once the GPU view lies in
a sparse window, its tiles need video memory filled from the CPU view
and kept in step with it, and nothing may touch the view's own
addresses on the CPU (they fault).

- TileEntry.src: the CPU address a tile's bytes are read from and land
  at (0: its own). The upload scan, the ring copies (cpu_span cuts a run
  where the CPU bytes break), copy_back/land_page, store_imm,
  chunk_clean, sync_sent_range and readback_now go there. A copy back
  recorded while the tile showed another CPU tile is left out.
- map_mirror(va, len): queues the window tiles from any thread (no
  STATE, no VirtualQuery). The next submit maps up to 4096 of them over
  kernelx::mirrors::source, with the CPU tile's holes from one batched
  working-set query and VirtualQuery once per region (a call per tile
  grew with the square of a committed range), and fills them whole.
- before_execute (now State::before_execute_on): CPU pages written go
  to every tile over them; a written page that was a hole is asked
  about again (lazily committed pages); pages are sorted and deduped by
  window address.
- source_decommitted (to be called before Windows decommits CPU pages),
  forget_mirrors, decommit/commit of the view's own tiles, place_buffer
  over a GPU view, mapped_ranges with the CPU tiles (never the view),
  cpu_of for callers outside.
- XCL_MIRROR_MB (default 4096) caps the video memory of such tiles; the
  timing line counts them.

Nothing calls map_mirror yet and the GPU views are not in a sparse
window yet, so this changes nothing in a run. Tests: CPU-side ones on a
state of their own with the view reserved with no access (a touch
faults the test), plus GPU ones, all run on the software adapter.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The two-pass bind (#2092) came from a base before the committed window
could be a copy in video memory (Uma::shadowed): it took window 0 and the
others from uma_window_vas, under its lock at every stage, and bound a
null root descriptor when shadowed memory had no buffer in window 0,
which bind_abi refuses. Both now take it from first_window (the lock-free
uma_window_va and the same refusal), and the two-pass stages bind the
other windows from uma_window_va like bind_abi.

Test: binds_refuse_shadowed_memory_without_window_0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
inherit_for_split (a deferred mid-list split: the next list records into
another allocator) gives that list a fresh arena and holds its previous
recording's unified memory for the previous allocator, as reset does.
The two-pass record buffer and argument scratch that #2092 added to the
list state were only handled in reset and forget, so a split list kept
its previous recording's record buffer, which the GPU may still read
while the new recording's compute pass writes it, and its scratch budget.

They now go to the old allocator (hold_res_until_reset) and the scratch
counts start again, as in reset.

Test: a_split_holds_the_previous_record_buffers_for_their_allocator
(buffers of a software device, no GPU work); fails without the change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
#2092 notes a DispatchMesh command signature with its companion Dispatch
signature by address and never forgets it. A signature the title makes
later at a freed one's address (a plain Dispatch or draw signature, or a
root-changing one) kept the old entry, and an ExecuteIndirect with it and
a two-pass pipeline bound went down the two-pass path with the old
companion, stride and offset. Every creation now forgets the address
first, as note_signature_dispatches already does for the Dispatch kind;
a mesh dispatch signature is noted again after it.

Test: a_signature_at_a_freed_mesh_signatures_address_has_no_companion.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A translated graphics pipeline's driver blob was kept on disk under a hash
of its description and DXIL alone. That is not all the PC pipeline is made
against: the driver refuses a blob of another adapter or driver, so two
adapters sharing the cache (a GPU and the software one the tests use)
overwrote each other's files and each compiled again, and a change of the
memory windows in the ABI root signature was found only by the driver's
refusal. The file is now named after graphics_file_hash: the key in
memory, the adapter and driver (driver_identity, from the two-pass cache)
and the window count. Without the adapter's identity nothing is kept.

The cache steps move into graphics_pso_through_cache, so the software
device can run the path production uses. The keep threshold is the
two-pass one (XCL_PSO_DISK_CACHE_MIN_MS, default 250 ms), now
keep_threshold.

Measured on the software adapter (tests): a pipeline made twice is
compiled once and made from the kept blob the second time; a damaged file
is dropped and replaced; a blob refused with D3D12_ERROR_ADAPTER_NOT_FOUND,
D3D12_ERROR_DRIVER_VERSION_MISMATCH or E_INVALIDARG is dropped and the
pipeline compiled; the file hash is fixed for fixed inputs and pointers
never enter the key.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A title gives the GPU addresses in its GPU view on many paths: buffer
views made by address, constant buffer views, root views, vertex and
index buffers, memory operations, waits. Each of them has to ask for the
view window's tiles before the GPU work that uses the address
(sparse::map_mirror) and must not do anything for other addresses.
view_want::want(path, va, len) is that call; it counts calls and bytes
by path, and the activity log prints what was asked for every 2 s
("GPU view (2 s): ..."), so a run shows which paths a title uses.

No caller yet: nothing changes.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The diagnostic was written against one map of all lists. Here the lists
are kept in parts with a lock each (list_x::recording), so its lookup
did not compile after the merge.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
uma_window_buffer answers None for a view window, because the callers it
has read their range back to the CPU at its own address, and a GPU view
has no CPU memory. uma_window_buffer_gpu answers for view windows too:
for a caller that gives the range to the GPU only, or lands what it
reads back at the CPU view (view_want::cpu), and that has asked for the
tiles. No caller yet.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
A retail title gives the GPU only addresses in a GPU view of its memory
(PAGE_NOACCESS on the CPU; with the 16-window layout it lies in the view
windows). The device's views and placed buffers took such an address as
memory nobody has: a constant buffer view was left empty, a buffer placed
there became a committed resource of its own that stayed zero (so its GPU
address, the buffer views of it, indirect arguments, copies and vertex
buffers read zeros), and a view made by address carried the address but
never asked for the tiles behind it, so the shader read zeros there too.

Each now asks for the tiles of exactly the range it covers
(view_want::want): views by address (device #70 / #71, the range
buffer_words_at computes), constant buffer views, views of buffer
resources, the acceleration-structure view (from the root on; its size is
not known) and a Map read of a buffer in the view. A constant buffer view
and an acceleration-structure view in a view window carry the address. A
buffer placed in a GPU view goes over the view window's tiles through
sparse::place_buffer, as one in a sparse window does, and may run on into
the next view windows; when that is refused it is a resource of its own
as before, logged once. A Map read of such a buffer reads back what the
GPU wrote into its CPU view, and its release does not wait as one over
CPU pages does.

Without the 16-window layout no address is in a view window and nothing
changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A retail title showed no frame for 34 s in one run and 156 s in another
while its world loaded: its draws waited for pipelines that were built one
after another, each 4 - 7 s of translation and DXC per stage (nothing
logged) and 3 - 8 s in the driver. The logs could not say where that time
went, nor how many of the title's pipelines were built before they were
needed.

- The driver compile start line of a graphics pipeline now says how long
  ago its build started and how that time went: VS and PS translation and
  DXC compile (DXC's waits for memory included), the wait for the huge
  pipeline gate (slot / commit), and the rest.
- A line of its own every 2 s while it changes: lazy pipelines made
  (graphics among them), built, built before their first use, built with
  a huge program, and the time binds waited for pipelines in those 2 s.
- A bind's wait for a pipeline being built is a call of its own in
  api_cost (the XCL_ACTIVITY "calls" line), and the first wait for a
  pipeline that passes 1 s is logged with the thread and whether the
  pipeline is graphics or compute.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A retail title gives the GPU only addresses in a GPU view of its memory,
which with 16 windows lies in the view windows; a tile there gets video
memory only when an address in it is asked for (view_want). Nothing
asked yet: root CBV / SRV / UAV addresses read zeros, and a two-pass
mesh ExecuteIndirect refused arguments in a view window because
uma_window_buffer has no buffer for one.

Each bind on XCL's ABI (bind_abi, the two-pass mesh stages, the console
lists' dispatches) asks for the tiles of its root views that lie in a
view window: 64 KiB each, as a root view has no size and nothing looks
a buffer up by address. The view windows' range is taken once, so any
other address costs one compare, and a layout without view windows one
compare a bind. The two-pass arguments and count, which only the GPU
reads, ask for their range and take the view window's buffer; the
indirect guard asks for the arguments it reads through the window; a
rect list in a view is expanded from its CPU view.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
With 16 windows an index or vertex buffer, a memory operation, a wait
or a copy destination can lie in a GPU view of the title's memory. The
PC got the console address of such a buffer when its window had no PC
address (no PC address: the device hangs), memory operations there were
"not in unified memory - not done", a wait read the view the CPU cannot
touch and passed at once, and a write and a wait naming the two views of
one value kept two sync cells.

Index and vertex buffers ask for their tiles and go to the PC at the
view window's address, or as none, never as the console address; the
CPU-side buffer mirrors never take a view address. Copies, fills,
immediates, timestamps and predication ask for their ranges and run on
the view window's buffer; what they and GPU copies into a buffer placed
in a view write is read back to the CPU view, where sparse lands it.
Waits read their value at the CPU view, and the sync cells are kept by
that address. Without view windows every address stays as it was.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The tiles of a GPU view in the view windows show the pages of its CPU
view: a submit fills them from those pages and scans them for changes
with the sparse state's lock held. Nothing told sparse when the title,
or XCL for it, decommitted or released such pages, so that read could
run on memory Windows had just taken away (the submit thread's copy
faulted that way once on a sparse window's pages).

- VirtualFree of a paired CPU view (plain write-watched memory, a sparse
  window's or unified memory's) calls sparse::source_decommitted for the
  range, the whole view on a release, before Windows does it; a decommit
  through VirtualFreeEx of a graphics reservation now takes that path.
- release_at, where a physical page leaves an address (unmapped, or
  moved to another), does the same for that page.
- mirrors::released, when a pair goes, has sparse forget the tiles over
  either view once its own lock is dropped (both addresses may be handed
  out again).

A count of pairs keeps it to one atomic load while nothing is paired;
sparse itself returns after one more while no tile shows a CPU view.

Tests: the title's decommit, VirtualFreeEx decommit and release of a CPU
view are told while the pages are still committed, memory of no pair is
not, and the release forgets both views; a page mapped lazily into a CPU
view and written is found by the look (how sparse clears its hole), and
its move and unmap are told before the decommit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A retail title gives DirectStorage addresses in the GPU view of its
memory, which the CPU cannot touch: with the GPU view in the view
windows (XCL_UMA_WINDOWS=16) such a request failed with
E_ACCESS_VIOLATION. Its bytes are now written at the CPU view behind
the address, and that is the range noted as a known write, so the
look hands those pages to the tiles that show them; a memory source in
a GPU view is read there too. A range that runs past its view is
refused. Without view windows no address is a view address and nothing
changes. Requests into a GPU view are counted in the log.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A bottom-of-pipe write the CPU does for the GPU into a GPU view of the
title's memory in a view window was refused (the CPU cannot touch the
view: writable said no). It is now checked and made at the CPU view
behind the address, whose writes reach the view's tiles like any CPU
write. Other addresses, and every address without view windows, are
written where they are, as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
source_decommitted marked the pages of a CPU view as holes in the tiles
shown over it and dropped the state's lock; the caller's VirtualFree came
after, with no lock. A submit that took the lock in between still had a
page in its write-watch list, asked Windows again (still committed),
cleared the hole and scanned the page while VirtualFree landed (access
violation on the submit thread), or kept it committed in the tile for
good (later copies back, immediates and chunk checks touched it). A tile
asked for in that window was filled from such pages the same way. The
ANY_MIRRORS gate was check-then-act: a decommit that saw no mirror while
the first one was being linked was missed entirely.

A leaf lock (Sources) now holds a copy of the CPU runs that tiles show
(changed with src_runs) and the page ranges whose decommit is under way.
source_decommit / source_release bracket the caller's OS call: the range
is listed, the state is told only when tiles show the range, the OS call
runs with no XCL lock, then the range is unlisted (a release forgets the
tiles first). Submits link a tile before they ask Windows about its CPU
tile, and take listed pages as holes (holes_now, in map_mirrors,
mirror_writes and buffer_tiles), so through the one lock either the
decommitter sees the link or the submit sees the range. A tile is looked
up again once linked, so a forget_mirrors that found nothing linked and a
link after it cannot miss each other; the leaf's runs replace ANY_MIRRORS.
source_decommitted and forget_mirrors keep their signatures.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A CPU view can lie in a sparse window itself: kernelx puts some of a
title's 64 KiB-page reservations there and pairs them with their GPU
view. Its decommits reach sparse through decommitted -> decommit_range,
which only marked the entries keyed by the decommitted addresses (the
view's own tiles). The tiles over that memory, keyed by their GPU-view
addresses, kept the pages as committed, so the next copy back, immediate,
chunk check or scan through them touched decommitted memory.

decommit_range now also runs source_decommitted_in for the range when
any tile shows CPU memory. decommit(a, n, os) brackets the caller's
VirtualFree for window addresses as source_decommit does outside them:
the pages are held as being freed until Windows is done, so a submit
that asks Windows in between does not take them as committed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A retail title creates its ~2 700 pipelines in its first 6 s. With lazy
pipelines each got a stand-in and was built only at its first bind, or
ahead of it when an earlier run had used its shaders. Pipelines new to
the run were bound up to ~140 s after they were made, and each such draw
waited 7 - 15 s for translation, DXC and the driver; the title records
about one draw between two of them, so 14 pipelines meant 156 s without
a frame.

The lowest-priority preload workers now keep a backlog of every lazy
graphics pipeline: those of earlier runs first (as before), then all
others are translated and compiled by DXC (no driver memory kept, and the
disk caches hold them for the next run), then built by the driver one by
one. The title gets the same pipeline, only earlier.

- A pipeline a bind wants is not taken from the backlog: the workers
  build it, and a bind's wait still raises a backlog worker building it.
- A huge driver compile of a pipeline nobody has used yet waits behind
  any other build waiting for a slot (big_compile_turn): one a bind gave
  up waiting for goes first. Gate size and commit headroom are unchanged.
- Pipelines of no earlier run wait in the backlog while less than 8 GB
  of commit is free; at most XCL_PSO_AHEAD (default 4096) of them are
  built by the driver ahead (each keeps ~400 KB there); XCL_PSO_AHEAD=0
  turns it off. Compute pipelines, and pipelines with no shader key, are
  still built at their first use.
- The pipeline line counts pipelines translated ahead and the backlog.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Draws wait for a pipeline still being built until it is there: on a cold
cache a logo and UI text drawn once and kept were missing when they did
not. A retail title's world draws waited 7 - 15 s each for pipelines
built one after another, and no frame came for 156 s; while a bind waits,
kernelx stretches the title's long sleeps too.

XCL_GFX_PSO_WAIT_MS=<ms> (unset: wait as before) bounds the wait of a
draw for a graphics pipeline: after it the draw goes on with the stand-in
(it draws nothing), and the later draws of that pipeline do not wait
again until it is built - what XCL_PSO_WAIT_MS does for every pipeline.
Compute pipelines are still waited for without a limit: a skipped
dispatch would corrupt data for later work. It is decided in pso_async,
which knows the kind of the pipeline: the binds are unchanged.

A bind's wait marked the build wanted for good, so a build nobody waited
for any more still skipped the huge-pipeline gate and ran at a normal
priority: with time-outs, many big driver compiles could run at once.
The wanted mark is now a count of waiting binds; one that runs out of its
budget leaves it, and the build goes back behind the gate and to the
lowest priority on a preload worker. Having been used, it still goes
before the builds ahead of first use.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Vertex and index buffers and root views are asked for at every bind, on
the thread that records the list, and a title binds the same ones for
draw after draw. Each ask walked every 64 KiB tile of the range through
a shared set (sparse::map_mirror). A thread now remembers its last 8
ranges with the generation of the GPU views they were asked in, and a
view that goes or comes empties that memory (its tiles are forgotten
with it). The counters keep every call; the bytes count when a range is
new to its thread.

Acceleration-structure views get a path of their own in the counters.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
A copy back recorded its tile's CPU address and landed if the tile still
had that address; an immediate compared nothing. When a page of the CPU
view behind a tile was decommitted and committed again (or the view was
released and paired anew at the same address) before the copy landed,
the submit re-validated the page with sent = None, and land_page wrote
the GPU's old bytes into the new memory's zero chunks (or over chunks
already sent). An immediate recorded before a repoint was stored into the
new CPU view. Finished readbacks were also drained only after
map_mirrors / mirror_writes, so a page that stopped being a hole in that
submit took what the GPU had in it.

TileEntry gets a generation: new for each tile over a CPU view, and again
whenever a page of it becomes a hole. Copies back and immediates record
it and land only into an entry with the same one. Tiles of the window's
own keep generation 0, so their landings behave exactly as before. The
finished readbacks are now drained before the tiles change at a submit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
source_going told sparse before Windows decommitted pages of a paired
CPU view. That left a gap: a submit that took sparse's lock between the
notice and the VirtualFree asked Windows about the page again (still
committed), took it back and read it while it went (review of the
mirrored tiles; sparse::source_decommit has the sequence).

The four places now hand their Windows call to sparse::source_decommit /
source_release, which list the range before, tell the state when tiles
show it, run the call with no lock held and unlist it after: the sparse
window path and the plain path of VirtualFree, a block of a committed
window that is freed (nothing goes in Windows there, the tiles do), and
release_at for a physical page that leaves its address. On the plain
path the part of the CPU view is looked up before a release unpairs the
views.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
buffer_tiles ignored new_mirror's result. At XCL_MIRROR_MB a GPU-view tile
of a placed buffer was refused, left out of the buffer's tile list, and
the buffer's reserved resource kept a NULL tile there for good, while a
later CPU write gave the window tile its own video memory: the two views
of one address disagreed. new_mirror also checked the cap before taking a
tile back from parked / kept, so a tile kept mapped for a placed buffer
was refused after its CPU view was committed and written again, and
stayed mapped in the window and the buffer with the old bytes while the
new ones never went up.

new_mirror takes a force flag that skips the cap (the tile still counts),
passed by buffer_tiles, and takes a parked or kept tile back before the
cap is looked at: that memory is held already.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A tile refused at XCL_MIRROR_MB stayed linked and in MIRROR_ASKED, so
asking again did nothing, and map_mirrors skipped linked tiles: the only
retry was mirror_writes, on a later CPU write to its CPU tile. Data the
title wrote once before the link (meshes, tables) never reached the GPU,
even after decommits and releases brought the room back. A tile for
which take_tile found no video memory was not even recorded, so a short
spell of VRAM pressure zeroed it for good. And while at the cap, every
submit that wrote a refused tile's CPU tile asked Windows about it again
under the state's lock, only to refuse it again.

new_mirror now records take_tile failures in `refused` too (counted once,
and for a second after one no other tile tries to make a heap unless a
tile is at hand). map_mirrors ends with retry_refused: when there is room,
up to MIRROR_ASKS_MAX refused tiles still linked and without memory get
one batched hole query and video memory (a fill of their CPU view); those
with no committed page leave `refused` for the write path. mirror_writes
skips refused tiles while there is no room or memory for them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
map_mirrors took up to 4096 asked tiles a submit and gave each video
memory at once, so a burst of asks filled up to 256 MiB at the next
submit: every committed page hashed and pushed through the 64 MiB
staging ring (waiting on the GPU for ring room) on the title's
submitting thread with the state's lock held, while its loading threads'
commits and decommits waited for that lock.

Asked tiles are now linked as before (their CPU tiles are watched from
then on) and queued in `later`; map_mirrors fills from the front of that
queue until XCL_MIRROR_FILL_MB of committed pages (16 MB by default) went
this submit, counting the pages a tile's CPU tile has committed, not
tiles. The rest wait for the next submits in their order: new asks are
taken in only once the queue is empty, and refused tiles go through the
same queue when there is room again, so a burst is not overtaken by
later asks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
XCL_GFX_PSO_WAIT_MS gave every pipeline its own wait. The first frames of
a title's world bind hundreds of pipelines never used before, one draw
after another on one thread. On a cold cache a retail title's thread
waited the whole 500 ms for more than 500 of them in a row: no frame from
92 s to 232 s, although every one of those pipelines was being built
meanwhile ("binds waited 2001 ms for pipelines being built (4 waits in
2 s)" for two minutes).

The budget is now what a thread may wait in a second in all
(gfx_wait_left: it fills again at the budget a second, to the budget at
most). It is spent on the first pipelines and on any that is built within
milliseconds (one made from a kept blob); after that the thread goes on,
and the rest draw once they are built. Compute pipelines are waited for
as before.

Test: the_graphics_budget_is_a_threads_for_a_second.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
A device removal was only looked for after a submit and at a present. A
title whose threads all wait (for pipelines being built, for a fence)
does neither, so the report of the faulting address was never written:
a retail title's device was lost by a shader's access to an unmapped
address while its threads waited for pipelines, and the log ended
without a word about it. With XCL_DRED a thread now asks every 100 ms.

What the report names at an address had no names: the memory windows'
buffers (with their number and whether they hold GPU views), the pools
of the sparse tiles, a title's buffer placed over tiles (with its
address and size) and the two-pass record and argument buffers now have.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The compute pass of a console mesh program writes each thread's position,
parameters and primitive into the group's record: slot = the thread's
index, with room for max_vertices vertices and max_primitives primitives.
Nothing checked the index. A thread past either limit that still exports
(a group can have more threads than the record has slots; the console's
hardware drops an export past the room the program asked for) wrote into
the next record, and past the last record of the buffer into whatever
follows it. The record buffer is a root UAV, so that is a store to an
unmapped address.

A retail title's first frames with mesh programs lost the device that
way on an NVIDIA RTX 5090: five "Graphics SM Warp Exception ... MMU
Fault" (shader units touching unmapped memory at once) seconds after its
first two-pass mesh draws ran, with the GPU nearly idle before, so no
time-out. Two reviewers of the two-pass path named this store as the one
shader access there that nothing bounds; it is not shown that it was the
access that faulted.

Both translators now store only when the thread's index is below the
limit of the part it writes: the direct DXIL one (kernel::mesh_init /
Lw::mesh_export, which the compute pass uses) and the HLSL one.

Test: gpu_mesh_mode_exports_stay_inside_the_record (128 threads export
with room for 64 vertices and 32 primitives; the buffer has room behind
the record, so the test faults no device without the bound either). Its
HLSL half runs without a GPU.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
XCL_DRED turns on the page-fault report and the breadcrumbs; the
breadcrumbs put a marker around every operation of every list and made a
title stall in its first seconds. XCL_DRED=pagefault asks for the
faulting address and what was (or had been) there only. The log says
which of the two is on.

An address just past the end of a buffer has no allocation the report
could name. The first two-pass record and argument buffers therefore
log their GPU address ranges when they are made.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The report of a device removal lists the allocations at the faulting
address, and those freed there lately, by name. A title's resources have
none, so the list said "type 34" and nothing else. With XCL_DRED set,
what the PC device makes for the title is named after what it is when XCL
takes it over (adopt): a buffer with its size and flags, a texture with
its dimension, size, mips, format, samples and flags, a heap with its
size, type and flags. More telling names given later replace it. Nothing
is named without the switch.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Translated shaders take a texture's index in the shared shader-visible
heap from a T# they read from memory and accept it when it is below
2^21 - 1. The heap was made at MaxViewDescriptorHeapSize (1 000 000 on an
RTX 5090, also the fallback when the query fails), so an index between
that and 2^21 passed the shaders' guard and read a descriptor past the
heap's end: memory the GPU has not mapped. Since the shaders read real
descriptor data from the title's memory, stale or garbage T#s reach that
path.

The heap is now tried with 2^21 descriptors first (resource binding tier
3 hardware takes more than the query says) and made at the queried size
only when that fails; a heap below 2^21 is logged as a warning that names
the uncovered index range. D3D12 leaves a new heap's descriptors
undefined, and only descriptors 0..MEM_HEAP_BASE were null views: every
descriptor past them now gets a null view (even SRV, odd UAV, as a
console slot's pair), copied from a CPU-only heap of 4096 once at
creation (2^21 copies, 64 MiB at a 32-byte increment; the time is in the
creation's log line). A range released by an unregistered heap gets null
views again before it can be handed out, since its views may name
resources that are gone. The heap is made and filled without GLOBAL
held: the adopted device's descriptor hooks look up the console heaps.

Cost: once at the first view heap (the fill), one copy per released
page range; nothing per draw or bind. The heap takes 2^21 instead of
1 000 000 descriptors of video memory.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Four ways a draw reached the GPU with a pipeline and a root signature or
draw kind that do not belong together:

- DispatchMesh and ExecuteIndirect resolved the pipeline with
  resolve_wait and then again in two_pass_of. With a wait budget the
  first can give the stand-in and the build can finish before the
  second: the two passes were recorded with the stand-in as the mesh
  pass's pipeline under the two-pass root signature. The draw now
  decides once (draw_pipeline): the two-pass entry of exactly what
  resolve_wait gave (real::two_pass_entry, no second resolve), else the
  stand-in of a pipeline being built or built since (skipped, as a
  pending one was), else the rest as before.
- ExecuteIndirect with a built two-pass pipeline and a signature that is
  not a noted DispatchMesh one (one that changes root arguments, or
  whose companion Dispatch could not be made) fell through to the PC
  call under the title's root signature, with the pass-through mesh
  pipeline on the list reading root views that signature lacks. Skipped
  and counted, warned the first 4 times.
- A Draw whose pipeline resolves to a two-pass one (a console VS+GS)
  took the PC branch: a Draw on a mesh pipeline. Skipped, warned once.
- The PC branches bound the title's root signature only when one was
  set; without one the PC call ran under whatever a translated draw left
  (XCL's ABI or the two-pass root signature). Such a draw is now skipped
  (warned the first 4 times), except on a bundle, which takes its
  caller's, and an ExecuteIndirect dispatch, which does not use it. Two
  tests set the root signature a title sets after Reset.

Cost: the same lookups as before (one TWO_PASS and one pending-pipeline
lookup per mesh draw, one TWO_PASS lookup per draw with an untranslated
pipeline); nothing on translated draws.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The 256-look line says how long a look for CPU writes takes, not
whether that time is the walk over memory nobody wrote or the pages
taken (each a page-table entry changed and flushed). The two call for
different fixes: looking at less memory, or taking fewer pages.

XCL_LOOK_STATS=2 times every write-watch call of a look on the thread
that submits and adds them up apart for the calls that returned no page
and those that returned some: time, bytes covered, pages, calls. A line
every 256 looks:

  look split (256 looks): X ms a look in N calls over G MB that found
  nothing + Y ms in M calls over H MB with P pages

It answers the study's first question: what a look's time is made of.
XCL_LOOK_STATS=1 prints what it printed before; with the switch off a
look costs one more atomic load per write-watch call.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A title keeps T#s, each with an index into the shared shader-visible view
heap, in its own memory, and its shaders read them from there. On the
console a T# of a released texture still names memory (leftover bytes,
nothing faults), so a title can sample a texture it has released (a
material table not updated yet, a sample of weight zero). On the PC the
heap slot kept the descriptor of the resource XCL destroyed: a shader
that samples it touches an unmapped address on the shader units. Nothing
cleared a slot when its resource went.

console_heap now remembers, for each index of the shared heap, the PC
resource its descriptor names (8 bytes an index, made with the first
view: 16 MiB for 2^21), and for each resource the indexes that named it
(entries may be stale; the per-index value is the truth). A view
published from CreateShaderResourceView / CreateUnorderedAccessView
(and the _at forms, which go through them) sets it, a copy between
console slots carries the source's, a null fill clears it. Right before
the PC object is destroyed - in late_release's drain before the real
Release of a held resource, and after the last Release of one that was
not held - every index that still names it gets the null view of its
kind (SRV at even, UAV at odd indexes); an index overwritten since by a
view of another resource is left alone. One lock (SLOT_WRITES) orders
the descriptor writes and the nulls, so a null never lands on a view
another thread just wrote; the copies under it go past the adopted
device's descriptor hook, which looks up the console heaps.

Cost: per view published, a lock, a descriptor copy (as before), an
atomic swap and, when the slot named another resource, a push to a
sharded map; per descriptor copy of n slots, n more slot lookups. Per
resource destroyed, one sharded-map lookup, and a copy per view it
still has. Nothing on draws or binds. Logged at the first 16 releases
that nulled any view and at powers of two.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
submit_cost's "scan" is the time from the sparse lock's work to the
uploads: building the slots of the written pages (the gather) and the
chunk scan of those pages, which is shared with the worker pool. Which
of the two it is, and whether the pool helps at all, decides whether
the scan wants a cheaper gather, more workers or workers that are
awake.

worker_pool::run now says who did a job's items (the caller, the
workers) and how long after the job was handed out the first worker
took one. With XCL_LOOK_STATS=2 the submit's gather and scan are timed
apart, and a line every 256 looks says:

  scan split (256 looks): gather A ms, scan B ms a submit; of N items a
  job the caller did C %, the first worker began after D µs (J jobs in
  S submits, W with a worker)

It answers the study's question of what the scan's time is made of and
whether the shared scan is shared. Nothing changes in what the pool or
the scan do; with the switch off a submit costs one atomic load more.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
hold_res_until_reset returned at once for allocator 0, which dropped the
recording's two-pass record and argument-scratch buffers: their last
reference went while the list that writes them through root UAVs might
not have run yet (a list XCL never saw reset, a reclaimed segment reset
onto none). A released committed buffer's GPU address is unmapped, and
the compute pass's stores and the mesh pass's loads through it fault.

They are now kept with the time they were handed over and go to the
reuse pool (or are released) once 10 s old, looked at whenever an
allocator's buffers are released. No fence or allocator says when the
GPU is done with them, so time does, far past any frame in flight. At
most 1 GiB is kept; past it the oldest go early and that is logged
(first 4 times).

Cost: one more lock at each allocator's release of two-pass buffers;
nothing per draw.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
What submit_cost calls "sparse lock" is the wait for the sparse
state's lock and all the work done under it before the scan: landing
the finished copies back, the tiles over CPU views, the mappings sent
and the unmappings. A long wait asks for less work under the lock on
other threads; a long part asks for less of that part on this one.

With XCL_LOOK_STATS=2 each step is timed, and the tiles mapped (with
the calls), the tiles unmapped and the bytes of copies back landed are
counted. A line every 1024 submits, averages a submit:

  sparse lock split (1024 submits): wait W ms, copies back L ms (B KB),
  GPU-view tiles M ms, mappings P ms (T tiles in C calls), unmappings
  U ms (V tiles), rest R ms a submit (of S ms)

It answers the study's question of what "sparse lock" is made of. With
the switch off a submit costs one atomic load more, and each map or
unmap call and copy back a relaxed add.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The ExecuteIndirect count check reads the 20 bytes of an argument record
through a raw root UAV at the window address of the title's buffer.
uma_va_of checks only that the start lies in a window. A buffer in a GPU
view may run across a view window's end, and the view windows are
separate 4 GiB resources: a record straddling the end was read past
window k's buffer, an SM load from an address nothing maps (root views
have no bounds).

The record is now read through the window only when all 20 bytes are in
it (uma_window_buffer_gpu, as make_scaled_args_buffer does); otherwise
the program reads the title's own buffer, as it does for an address that
is not in a window.

Cost: one window lookup per checked ExecuteIndirect (max 1, no count
buffer).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The title's GPU view is one range, but on the PC its windows are
separate 4 GiB buffers whose addresses are not adjacent. pc_va_in maps
only the start address: a vertex or index buffer view (or DrawIndexedX's
indices) that crosses a window's end was handed to the PC with the
title's SizeInBytes, so the input assembler could fetch past window k's
buffer into addresses no resource covers.

IASetVertexBuffers, IASetIndexBuffer and DrawIndexedX now clamp
SizeInBytes to the end of the window the address is in (warned once);
the GPU reads zeros past a view's size. A view inside one window is
unchanged.

Cost: per vertex / index buffer bind, a window lookup (arithmetic); the
title-memory lookup (a lock) only for a view that crosses a window end.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
When one thread makes every submit and every present, a frame's time
on it is its submits, its presents, its waits for the frame event and
its waits on fences. submit_cost says what the submits cost; nothing
said what the rest costs on that thread, so a frame's budget could not
be added up, nor could the calls XCL counts already (placed textures,
physical page calls, ...) be told apart from other threads'.

api_cost remembers the thread of the first title submit seen (with
XCL_LOOK_STATS=2) and counts every call on that thread apart as well.
New entries, timed with XCL_LOOK_STATS=2 only: the title's
ExecuteCommandLists as a whole (not XCL's own submits inside one or
inside a present), presents (PresentX, and the fallback's at a console
method) with their wait for the copy of the frame before apart,
WaitFrameEventX, and the copies back settled when a title thread looks
at a fence. The entry for the title's blocking fence waits is there for
the fence hook to use. With XCL_ACTIVITY, every 2 s:

  calls of the submitting thread (2 s): N ExecuteCommandLists in X ms,
  N presents in X ms, ...

It answers the study's question of where a frame's time goes on the
thread that submits outside the submit hook. The all-threads line is
unchanged with the switch off; a call XCL already counted costs one
atomic load more.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
res_release called sparse::forget_buffer, which unpins a placed buffer's
tiles, at the title's last Release, also when late_release kept the PC
object alive until the queues are past the work in flight. The kept
object still maps those tiles: sparse could hand them to another address
or retire the pool heap under them while work queued through the buffer
had yet to run. late_release's drain ends the object through the
original Release, which never told sparse. forget_buffer now runs from
res_release only for an object that is not held, and from late_release
right before the real Release of a held one. Right before, not after:
after it, another thread can make a buffer at the same address, whose
tiles this would unpin (the queues are past the work by then, and
forget_buffer takes no late_release lock and does not wait for the
sparse state's).

The same reuse made the address-keyed removals in res_release unsafe
when its Release had already ended the object (late_release off, or two
releases of the last two references at once): a resource made at the
address in between lost its UMA_BUFFERS / BUFFER_DELTA / TITLE_ADDRESS
entries and its pinned tiles. The last reference is now told by the
count after an AddRef and Release of our own (1: ours alone) on every
path, and the removals, the null views and, with late_release off, the
unpinning run while the object is alive, before the Release that ends
it. Of the two fixes the finding proposes this is the smaller: an
identity guard would need a generation in sparse's buffer table. What
is left is two threads releasing the last two references at the same
instant: both see 2, and the one whose Release ends the object cleans up
after it, as before.

Cost: none on draws or binds; per resource Release, the AddRef and
Release that late_release already made, now also with
XCL_LATE_RELEASE=0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Two things bound what a cheaper look could leave out or save.

A look takes the blocks written lately only; a write to another block
waits for the walk thread to find it. With XCL_LOOK_STATS=2 every look
counts whether the walk had made a block hot since the look before
began (a block no look had taken: written up to a walk pass ago), and
the walk times its passes over all watched memory.

XCL writes the title's memory itself: copies back landed and
immediates stored. The write watch reports those pages like the
title's, so a look takes them and the scan goes over them for nothing.
With XCL_LOOK_STATS=2 those writes keep their pages (64 Ki at most,
under the sparse state's lock they are made with) until the next look,
which counts how many it found and how many of those the scan found
unchanged.

Lines every 256 looks:

  walk staleness (256 looks): K of N looks began with a block the walk
  found that no look had taken yet; a walk pass took A ms (B ms the
  longest, P passes)
  XCL's own writes (256 looks): W pages a look written by XCL since the
  look before (copies back landed, immediates stored), F of them in the
  look, S scanned, U % of those found unchanged

They answer the study's questions of how stale the hot-block look is
and how much of a look is XCL's own writes. With the switch off a look
costs one atomic load more, a copy back landed or immediate stored one
per page.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The pipeline objects XCL owns - the compute pass of a two-pass pipeline
(Drop for TwoPassPso) and the background-built real pipeline behind a
title's stand-in (pso_release) - were released the moment the title
released its pipeline. A list recorded before that and still queued or
running binds them (the two-pass draws bind both), and D3D12 asks that a
pipeline outlives the work that runs it: the GPU would fetch shader code
of a destroyed pipeline.

late_release now takes them as well: a batch entry is a resource or a
pipeline, and a pipeline is released (its COM Release) once every known
queue has passed a fence value signalled after the hand-over, by the
same thread and drains as resources. With XCL_LATE_RELEASE=0 they go at
once, as before. Pipelines XCL releases that were never bound (a build
nobody waits for any more, a duplicate depth-bias pipeline) still go at
once; the depth-bias pipelines derived from a released base pipeline
(device_x) are not changed here.

Cost: a lock and a push per such release (a title's pipeline release);
nothing on draws or binds.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
The eight targets drawn into most are a frame's G-buffer. The passes that
turn it into the picture (lighting, the HDR chain, the composite) draw once
or twice each and rank last, so a flat picture over a drawn scene could not
be followed past the scene's targets. A third number names how many of the
ranked targets are written (default eight, 64 at most).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The memory line named the video memory in use, not what Windows lets the
process have. A retail title's world held 29 to 30.5 GB of a 32 GB card with
1 GB already moved off it, and nothing in the log said it was past the
budget. The budget is logged once, and every 2 s while the process is over
it, by how much.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
A retail title's world ended in a driver error whose cause the log did not
hold: the process was killed from outside 3 s after the driver's first event,
before the device was reported removed, and then hung half-terminated in the
driver for five and a half minutes with 27 GB held.

- a ring of the last 16 384 draws and dispatches (pipeline, kind, size,
  frame), written at each one and read only for a report;
- a thread that looks for a removed device ten times a second (it was only
  looked for with XCL_DRED set) and times ExecuteCommandLists and Present in
  the driver: one that has not returned after XCL_GPU_STALL_MS (2 000) is
  reported with the ring, and the title's other submits wait until it
  returns; one that took 250 ms and returned is logged;
- XCL_STOP_FILE=<path>: when the file appears the title ends itself through
  end_title. A file beginning with "fault" first gives the driver 12 s to
  report the device removed, with nothing more submitted.

Not run on a GPU yet: the unit tests cover the ring, the report, the stall
step and the stop file's reading.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The direct translator turned s_barrier into a plain group barrier. That
barrier waits for every hardware wave of the group, and a console wave that
has left, or that ran one barrier fewer, never arrives: on the console the
waves left go on, on NVIDIA they wait for ever and the GPU hangs. The HLSL
path has had the barrier that counts the waves still there since 0c02b87
(xcl_s_barrier); with XCL_DIRECT_DXIL=1 compute programs and the compute
pass of mesh pipelines did not get it.

A retail title has it in 216 compute programs (19 of them branch a wave
with no active lane around barriers the other waves run) and in all 36 of
its mesh programs: the first wave of a group whose vertex or primitive count
is 0, or past 128, runs a barrier the other waves branch around, then the one
they all run. Its world, the first to draw meshes in two passes, ended in a
driver time-out with no shader exception in two runs of three.

A compute or mesh program with s_barrier in a group of more than one
hardware wave is now an error of the direct translator, which sends it to the
HLSL path (XCL_SAFE_BARRIER=0: as before, in both translators).

Not run on a GPU: whether this was the cause of those time-outs is not
shown, and the HLSL compute pass of that title's mesh pipelines has not run
in its 16-window layout.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Translated shaders index the bound sampler heap with S# word 3 & 0x7FF
(SamplerDescriptorHeap in the HLSL path, SAMPLER_HEAP_MASK in direct DXIL),
so an index from 0 to 2047. A console sampler heap got as many PC samplers
as the title asked for (128 in a retail title): an S# the title builds itself
with a nonzero border color pointer in word 3 [11:0], or any index from 128
on, read past the end of the bound PC sampler heap, which D3D12 leaves
undefined.

A shader-visible console sampler heap now gets 2 048 PC samplers (the D3D12
maximum for a shader-visible sampler heap) whatever the title asked for, all
of them made as the zero sampler XCL already wrote into the title's slots
(point, wrap, mip 0). The console side does not change: the heap keeps the
title's slot count, its 16-byte increment and its indexes, and copies,
CreateSampler and the release only touch the title's slots. A CPU-only
sampler heap keeps the title's count (shaders never bind it). The cost is
up to 2 048 CreateSampler calls and 2 048 PC sampler descriptors a heap.

The PC heap's own GetDesc (not hooked) now says 2 048 for such a heap; a
console view heap's already says twice its slots.

Tested on the software adapter only (WARP): the new test
every_sampler_index_a_shader_forms_is_in_the_pc_heap checks the count for
every index a shader forms and that D3D12 makes a shader-visible sampler
heap of that size. Not run on the hardware GPU or on a title.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
view_want's per-thread memory of the ranges it asked for lately matched an
exact (va, len) among the last 8. Mesh-stage root views of a retail title
come at a new offset of tiles asked for already, draw after draw, so
12 000-74 000 of them every 2 s missed it and walked their tiles again in
sparse::map_mirror (a shard lock and a hash insert a tile) for nothing.

The memory now holds the span of 64 KiB tiles each range covers, 32 of
them, and a range is skipped only when all its tiles lie in one span
asked for while the GPU views were as they are now: it is still emptied
when kernelx::gpu_view_map_gen() changes, and a range reaching one tile
further still goes to map_mirror. What gets mapped does not change.

map_mirror returns how many tiles it queued, and the "KB new" figure of
the "GPU view (2 s)" line counts those tiles (64 KiB each) instead of the
length of every range that missed the memory: before, 0.3-35 % of it ever
became a filled tile.

Tested: cargo test --release -p xcl --lib view_want (3 passed) and
map_mirror (1 passed), on the software adapter. Not run on a GPU or a
title: the miss rate on a title is not measured.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The compute path kept a driver blob on disk only when its build took
250 ms (driver_cache::KEEP), and XCL_PSO_DISK_CACHE_MIN_MS, which the
graphics and two-pass paths read, did not reach it. A compute program
whose build takes 100 to 250 ms was compiled again in every run, at its
first bind, and a compute pipeline is waited for: often on one of the
title's threads. In a retail title's run one of its threads spent 228 ms
in the driver on a 4 KB program that no file was kept for.

driver_cache::keep (its only caller is translated_compute_pso) now keeps
a blob of a build of 20 ms or more, and XCL_PSO_DISK_CACHE_MIN_MS chooses
for it as for the others. The graphics and two-pass default stays 250 ms.
The cost is more small files in the driver folder, at most one a compute
program. Programs under 16 KB of DXIL still keep no blob
(COMPUTE_BLOB_MIN_DXIL), as before.

Tested with the unit tests only (software adapter): the new test keeps a
100 ms compute build and fails on the old threshold. Not run on a GPU or
on the title.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A wave64 program on 32-lane hardware runs as two hardware halves that
exchange ballot words and lane values. Groups of more than one console wave
do that through bounded group-shared counters; a group of exactly one
(33 to 64 threads) met at a group barrier at every exchange. Those barriers
hung NVIDIA GPUs when several such programs ran at once (#1727: device hung
and driver event 153 in 11 of 25 parallel runs of the lib tests on an
RTX 5070, none on the HLSL path, whose exchange spins by default). A retail
title's world runs such programs on several queues at once and ended in a
driver time-out with no shader exception.

A compute or mesh group of one console wave now takes the counter exchange
too (its slots and counters are made for it when the program has no LDS).
Geometry programs, which set their partner by phase, and the tests' kernel
form keep the barrier. The change is that of #1741 (hajduzsolt), which is
open and written against an older main; applied here by hand.

Not run on a GPU. The test checks the translated program: one group barrier
(the start's) and the counters' atomics for 33, 64 and 128 threads.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
A retail title's world made about 33 committed buffers of 1-32 MiB a second
for two-pass mesh draws, and let as many go, on a card that was nearly full
(the "two-pass res buffer #n" lines: #2048 at 201 s, #8192 at 384 s). Most
of them are 32 MiB, and they do not come from DispatchMesh: an
ExecuteIndirect of two-pass commands always asked for 32 MiB of records
(each with a 1 MiB argument scratch block), since a command's groups are
known on the GPU only. A DispatchMesh asked for its need, at least 4 MiB.

Each recording keeps its buffers until its PC allocator is reset; then they
went to FREE_RES, which kept 16 buffers or 256 MiB at most: eight of the
32 MiB ones. 24-27 of them were made in the world's first two seconds, so
each round of allocator resets let go of most of what the next recordings
made again. The pick from FREE_RES also took the
first buffer large enough, so a DispatchMesh of a few groups could take a
32 MiB one that the next ExecuteIndirect then made anew.

- Record buffers are a power of two from 1 MiB (the scratch block's size)
  to 128 MiB. A draw gets at least the groups it got before (a test checks
  this over record sizes, splits and group counts). An ExecuteIndirect keeps
  32 MiB of records unless a command's groups in X (65 535 / split) need
  less, which leaves its group cap as it was.
- FREE_RES keeps every buffer handed back, up to 1 GiB, and lets go of one
  no recording took for 2 s; a recording takes the smallest one that fits,
  the last handed back of that size. What it keeps is bounded by what
  recordings took in the last 2 s and by 1 GiB.

When a buffer goes back to FREE_RES does not change: when its allocator is
reset (or alloc_pool sees the GPU past its submits), or 10 s after a
recording with no known allocator. A buffer leaves FREE_RES only for a
recording or to be let go, both after that point.

The DispatchMesh floor goes from 4 MiB to 1 MiB: fewer bytes past the last
record. Every store to a record is bounded by its vertex and primitive
counts (HLSL and direct DXIL mesh and geometry paths), so a store does not
reach past the records a draw dispatched.

Tested on the software adapter only (unit tests of the sizing and of the
pool). Not run on a GPU or with the title: how many buffers a frame now
makes is not measured.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The coherent window is committed when unified memory is made, so it is
sized from what the title asked of it in an earlier run
(<data>/cache/uma_coherent.txt), and that value only grew. A retail
title's 4582 MB of GPU heaps, stored by a run that put them in the
window, made two coherent windows of 4095 + 998 MB in later runs with
XCL_COHERENT_HEAPS=sparse:16. Those runs sent every such heap to the
sparse windows and put at most 105 MB in the coherent window, but with
XCL_UMA_SHADOW=1 each window is shadowed by a video-memory heap of its
full size: about 4.6 GB of video memory and as much commit for nothing,
on a card that was full. The sparse branch returned before the need was
noted, so the stale value never came down.

uma_coherent.txt now keeps one size per XCL_COHERENT_HEAPS setting
(lines "<bytes> <setting>"; the old single number counts as the setting
that puts every heap in the window), and the window is sized from the
one of the run's setting. A heap sent to the sparse windows is noted
too, and a run that has lasted 60 s stores what it put in the window by
then even when that is less than the stored size. A run that ends
sooner only grows it, so a run cut short before it made its heaps does
not leave the next one a window too small for them. XCL_COHERENT_MB
still chooses the size.

With one coherent window instead of two, the view windows of the
16-window layout start at window 4 instead of 5. Everything that uses
them asks the layout (is_view_window, bind::view_span_of,
list_x::pc_va_in, real.rs), and the uma tests already build that layout
with a 512 MB window. Shader translation and the shader and driver
caches are keyed on the number of windows (pso::mem_windows), which
does not change.

Tested: cargo check -p xcl --tests; the uma and kernelx unit tests
(new: the_stored_coherent_need_is_the_one_of_the_heaps_setting,
coherent_heaps_routes), on the software adapter. Not run on the title
or on a hardware GPU.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
When the shared view heap is full, a page of a console view heap that is
first used gets no place there. console_heap::slot then gave its slots the
index 2k, the one they would have in a PC heap of their own, and XCL wrote
that index into the slot's T# (CreateShaderResourceView,
CreateUnorderedAccessView, copies). But that heap is CPU-only once it is
meant for the shared heap, and lists bind only the shared heap, so the
shaders read descriptor 2k of the shared heap: another heap's view, a memory
window's raw buffer UAV for k from 2 to 9 (read as a texture, which hangs
NVIDIA), or, for k of 500 000 or more in a large heap, a descriptor past the
heap's end that the translators' guard (below 2^21 - 1) lets through.

Such a slot now has index 0, the null SRV / UAV pair at 0 / 1, with no
shared descriptor and no GPU handle (nothing is copied for it, and a UAV
clear of it is skipped as before). A heap that has no shared heap at all
keeps its own PC heap and 2k. The frame-trace census takes 0 as such a
slot's own index. Every page that finds no room is counted (each try), and
the warning comes at the first and at every power of two with the count,
where it came only once before.

Nothing in the logs of the last three runs of a retail title shows the
shared heap full, so this does not explain them; that title's heaps would
need 2.56 times the shared heap if every page were placed.

Tested on the software adapter only: the new test
a_slot_whose_page_finds_no_room_names_the_null_views (a fake shared heap with
room for one page, run in a child process) fails without the change (slot
258 got index 516) and passes with it. Not run on the hardware GPU or on a
title.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
How many two-pass record buffers and argument scratch blocks were alive at
once was not logged: the analysis of a retail title's world had to work it
out from the addresses of the first 48 and the powers of two of "two-pass
res buffer #n", and could only guess their share of the 5 GB of video memory
the memory line does not name.

A two-pass buffer is now a TwoPassBuf that counts itself when it is made and
when it is dropped, wherever that happens (FREE_RES letting go of an idle
one or one past its cap, the no-allocator hold past its cap, a test). A line,
always on, at most every 2 s while the counts change:

  D3D12.X: two-pass buffers: N made, N taken again, N let go; N alive
  (N MiB), N of them kept for reuse (N MiB)

The line is left out when FREE_RES is locked on the same thread (a buffer
dropped there); the next change writes it.

No behaviour change besides the line. Tested on the software adapter only
(the bind unit tests; the line shows in their output).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A dispatch waits for its compute pipeline until it is built, and a bind
whose pipeline no worker has started builds it on its own thread, outside
the gate of huge driver compiles. A lazy compute pipeline is sent to no
worker before its first bind, so its first bind always builds it there. In
a retail title's run one of its threads spent 57 s in the driver's
compiler on one program no earlier run had used (827 KB of DXIL, no driver
blob), and another of its threads waited for that pipeline all the time:
no frame for 57 s.

XCL_CS_PSO_WAIT_MS=<ms> is a budget of compute pipelines, as
XCL_GFX_PSO_WAIT_MS is one of graphics pipelines (it goes before
XCL_PSO_WAIT_MS for them). With it a bind takes the path XCL_PSO_WAIT_MS
takes today (resolve_within): the build goes to the xcl-pso workers, where
a huge driver compile waits for its slot once no thread waits for it, the
bind's thread waits at most the budget and never builds the pipeline
itself, and past the budget the pipeline is late: its dispatches get the
stand-in until it is built. Dispatch, the console list replay and
ExecuteIndirect already skip a dispatch with a stand-in and count it
(Dispatch and the replay as a skipped dispatch, ExecuteIndirect as a
skipped draw). Each late program is logged once ("compute pipeline of
record X not built after N ms: its dispatches are skipped until it is"),
by its console program's hash, which the pipeline now carries from its
creation.

Unset or 0, a compute pipeline is waited for exactly as before: the
budget is XCL_PSO_WAIT_MS, and without that, until it is built.

What a skipped dispatch breaks: what it computes is missing or old until
the pipeline is built. When that is the count of a later ExecuteIndirect
(culling and compaction programs), indirect_guard replaces only counts out
of range; an old count in range still draws or dispatches over old data.

Tested with the unit tests only (software adapter): the choice of the
budget, a bind that waits no longer than it while a worker (not the bind's
thread) builds a lazy compute pipeline, and one log line a program. Not run
on a GPU or on the title: what skipped dispatches do to its frames is not
known.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A pool tile that flush_parked unmapped went straight to the free list,
and take_tile popped it last in, first out: the tile unmapped last was
the next one mapped, cleared and filled for another address on the
"xcl sparse queue". When the free list was empty, take_tile even flushed
the parked tiles itself and took one of them in the same submit. That
queue waits for no title queue (with the readback queue, the normal
case), so work the title submitted before the unmap and still running on
its own queues could read the new owner's zeros or bytes, or write into
its tile through the old mapping. vram.rs keeps its freed pages cooling
for 2 s (COOL) for the same reason; sparse.rs had nothing of the kind.

Freed pool tiles (flush_parked, and release_if_unused when a placed
buffer's last user goes) now go to State::cooling with the time they
were freed. take_tile takes the oldest tile freed 2 s ago or more, then
one of the free list (tiles of a pool never used), and otherwise takes
back a retired pool or makes a heap: a tile freed less than 2 s ago is
never handed out, and take_tile no longer flushes the parked tiles (they
would only start cooling). retire_free_pools counts only free and cooled
tiles, so a pool with a tile still cooling is not retired.
new_mirror's "tiles at hand" check after a failed heap counts free,
cooled and retired tiles, no longer parked ones. pool_bytes counts the
cooling tiles as not mapped.

This is a time bound, not a fence: a GPU frame longer than 2 s can still
race. It holds more video memory while a title gives back and asks for
tiles (about 2 s of freed tiles, 60 MB at the 466 tiles/s measured).

Tested on the software adapter: cargo test --release -p xcl --lib sparse
(51 passed, 0 failed, 1 ignored). New tests
a_freed_pool_tile_cools_before_it_is_used_again and
a_pool_with_a_tile_still_cooling_is_not_retired (an injected clock), and
a_tile_given_back_is_not_used_again_before_it_cooled (a state on the
software device); all three fail with COOL set to 0.
a_tile_decommitted_and_committed_again_keeps_its_video_memory, changed
here for the new rule, opens the hardware device and was not run. Not
run on a GPU or a title.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The 64 MiB pool heaps that back the 64 KiB pages of textures in title
memory (vram::Pages) only grew: bind made a heap when the pool had no
free tile, and nothing ever let one go. In two runs of a retail title
350 MB of those pools sat free, more after a streaming burst, on a card
that was full.

A pool heap all of whose tiles are free goes now. A tile is only in a
free list after COOL in the cooling queue, so such a heap has no page
in use, idle or cooling. After each placement, TilePool::take_free_heaps
takes such heaps out: their tiles are not handed out again, and their
index becomes free (TilePool::live, Pages.pools holds None there). The
next heap takes the first free index. take_batch now gives make_heap
the index to fill, so the pool and Pages.pools cannot disagree on it.
A tile of a given-back heap that came back to the pool (none should)
is dropped instead of handed out.

A heap that came free is retired first, as sparse.rs retire_free_pools
does with its pools. The next pool that is needed takes it back before
a new heap is made, so placing and freeing in turn does not make and
end a heap each time. It is let go once the page-mapping fence is past
the value it had when the heap came free and 2 s went by. Even then it
does not go at once: it goes through late_release (new: hold_heap,
Dead::Heap), in a batch sealed after it. A texture the title released
is held there and still maps pages of the heap, and work queued before
that release may still read them. A heap destroyed under that work is
a GPU page fault, where a page reused under it only gives wrong texels.
So the heap goes once every queue XCL knows of is past that work, never
before the textures held with it. If a queue never gets past, the heap
is never released, which is no worse than before.

The 'pools' figure of the memory line (page_bytes) counts the retired
heaps that are not let go yet.

Tested: cargo check -p xcl --tests; the vram and late_release unit
tests on the software adapter (new: tile_pool_gives_back_wholly_free_heaps_and_reuses_their_index,
retired_pool_heaps_go_after_the_fence_and_a_moment). The test of the
churned pool now also checks the index each new heap gets. Not run: the
tests that place textures on a hardware device
(d32s8_targets_take_their_own_size_of_video_memory,
reservable_agrees_with_the_driver and the other hardware tests), the
title, and any real D3D12 run of bind with a heap given back.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The build-ahead backlog took a lazy compute pipeline only when an earlier
run had used its shaders (used-pipelines.txt). Any other compute pipeline
was built at its first bind, which waits for it: in a retail title's run
one of its threads spent 57 s in the driver's compiler on a program the
two runs before had never used, while another of its threads waited for it.

Compute pipelines of shaders no earlier run used now go to the backlog
too, in a lane of their own. The backlog serves the known compute
pipelines first, then this lane, then the known graphics ones, then the
other graphics ones (translated first, then built) as before. The known
compute ones, which used to share a lane with the known graphics ones in
the order they were made, now all come before them. The new lane is under
the rules of every pipeline no earlier run used: built only with
XCL_PSO_AHEAD's cap not reached and 8 GB of commit free (ahead_room),
counted against that cap, on the lowest-priority preload workers, a huge
driver compile behind the gate and giving its turn to any build a bind
waited for, and one a bind wants is left to the bind's workers.

This shortens how long a new compute pipeline is waited for (or, with
XCL_CS_PSO_WAIT_MS, how long its dispatches are skipped) and fills the
driver blob folder for the next run. It cannot build all of a title's
compute programs in its menus on a first run: a retail title has ~1 600
it never used, many of them taking the driver seconds to a minute.
The cost: each pipeline built keeps ~400 KB in the driver whether it is
used or not, and the known graphics pipelines are built later than
before, so a draw is more likely to wait for one (or, with
XCL_GFX_PSO_WAIT_MS, to be skipped).

The test of known pipelines built ahead no longer says an unknown compute
pipeline is still pending before its first bind (it may now be built
ahead); it still says nobody used it before then. Tested with the unit
tests only (software adapter): the lane order, room and cap, and a lazy
compute pipeline of new shaders built with no bind when commit is free.
Not run on a GPU or on the title.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A dumped texel was read as 4 bytes at a 4-byte stride whatever its format,
and only four formats had a colour. A retail title's scene colour (RGBA16F),
its normals and velocities (R16G16), ids (R32_UINT) and masks (R8) were
written as black pictures, "format not decoded", with every other half
texel in the raw values; a one-byte target was read past its rows. The
picture stayed flat over a drawn G-buffer and the stages between could not
be looked at.

Texels are read at the size of their format and the float, 16-bit, 8-bit and
integer render-target formats get a colour (floats tone-mapped as R11G11B10
is, NaN and infinity white).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The sparse windows' timing line is written only at power-of-two submit
counts, and TILE_WORK is read only with XCL_LOOK_STATS=2, so the logs of
a run that ended in a graphics driver hang had no rate of mapping
changes in its last minute: the UpdateTileMappings calls and tiles a
second could only be inferred.

map_tiles and unmap_tiles now count their calls and tiles with relaxed
atomics, always, split by the kind of window the resource lies in
(sparse windows, view windows for GPU views; a placed buffer counts with
its window), and the activity thread logs them every 2 s:

  tile mappings (2 s): sparse windows N calls mapping N tiles, N calls
  unmapping N tiles; GPU views N calls mapping N tiles, N calls
  unmapping N tiles

The line is left out when there were no calls. The vram.rs tile-mapping
queue (textures in title memory) is not counted here.

Tested on the software adapter: cargo test --release -p xcl --lib sparse
(52 passed, 0 failed, 1 ignored), new test
the_tile_mapping_line_counts_since_the_last. The line was not seen in a
run of a title.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Nothing in the log said how full the shared view heap got: the only line
was the warning once it was full, so a run that came near the end, or how
fast pages were placed, could not be told from the log. A retail title's
heaps would need 2.56 times the heap if every page were placed.

The shared heap now counts the pages of console heaps placed in it (placing
one adds, a heap's release takes its pages off), and the first time the
descriptors in use (those below the cursor, less the released ranges; the
null views and memory windows at the start count) pass 50, 75 and 90 % of
the heap, one info line says the mark, the descriptors in use, the heap's
size and the pages placed. The full warning gives the same numbers.

The 2 s "memory:" line in host.rs is left as it is: adding the heap there is
more than a one-line change, and the marks give the same answer.

Tested on the software adapter only: shared_heap_use_and_the_marks_it_passes
(the arithmetic) and the placed-page count and marks in
a_slot_whose_page_finds_no_room_names_the_null_views. Not run on a title,
so the log lines have not been seen in a run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Nothing bounded the two-pass record buffers and argument scratch blocks
alive at once: each recording holds its own until the GPU is done with it,
and a retail title's world had about 0.8 GB of them a few seconds in, on a
card its process kept nearly full. A committed buffer made there succeeds
above the OS budget, so nothing else would have stopped them.

A two-pass buffer is now made only if the bytes of those alive (held by
recordings, waiting for their allocator, or free) stay within the cap:
1024 MiB by default, XCL_TWO_PASS_MB to choose. When they would not, the free
ones in FREE_RES are let go first, oldest first, as many as it takes (the
GPU is done with them). If that is not enough, the buffer is not made and
the draw that asked for it is skipped, as one whose record does not fit the
record buffer is today, with a warning the first 8 times and a count on the
"two-pass buffers" line. The count is reserved before the buffer is made,
so threads making them at once do not pass the cap together.

Buffers held for a recording are never let go for the cap: when they go
does not change.

Tested on the software adapter only (unit test of the reservation and of
making room). Not run with the title: whether 1 GiB skips draws in its
world is not known.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The previous commit lowered the compute keep threshold to 20 ms, but
translated_compute_pso reaches driver_cache::keep only when
keep_compute_blob returns a blob, and keep_compute_blob returned none
for a program under 16 KB of DXIL (COMPUTE_BLOB_MIN_DXIL). So the case
that commit gave as its reason, a 4 KB program a retail title's thread
spent 228 ms on in the driver, still kept no file and was compiled
again in every run; its test called keep() directly and skipped that
floor.

The 16 KB floor now applies to the in-memory store only
(compute_blob_kept): a compute build of the keep threshold or longer
gives its blob to the disk cache whatever the program's size, and a
small program's blob is not put in memory. A program of 16 KB or more
is kept exactly as before. The graphics path keeps its floor.

The blob of a small program goes through the same file and load path
as the others (the driver refuses one of another driver, adapter or
root signature, and the program is compiled as before).

Tested with the unit tests only (software adapter): the new test of
compute_blob_kept says a 4 KB program built in 228 ms goes to disk
and not to memory. Not run on a GPU or on the title.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The previous commit wrote one line "<bytes> <setting>" per
XCL_COHERENT_HEAPS setting into <data>/cache/uma_coherent.txt. Every
build of a title shares that folder, and builds from before that commit
read the file with trim().parse::<usize>(): on the new text they got 0
and made a 512 MB coherent window with XCL_COHERENT_HEAPS unset, too
small for a retail title's 4.4 GB of GPU heaps, which then go to plain
memory where its shaders read zeros. They then wrote a bare number over
the file and dropped the other settings' sizes, so the two formats kept
overwriting each other, and a main run after a run of this build (as
the smoke comparison does) started with the small window.

uma_coherent.txt now stays one number, the size for the setting that
puts every heap in the window, read and written as before. The other
settings keep theirs in uma_coherent_<setting>.txt (':' as '_'), which
earlier builds never open. A uma_coherent.txt in the per-line format
reads as none here too and is written over with a number at the run's
first GPU heap.

Tested: cargo check -p xcl --tests; cargo test --release -p xcl --lib
coherent (7 passed, on the software adapter), with the changed test
the_stored_coherent_need_is_the_one_of_the_heaps_setting. Not run on
the title or on a hardware GPU.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Since freed pool tiles cool for 2 s before reuse, a pool can only be
retired once its last tile has cooled. retire_free_pools was still called
only right after flush_parked() freed tiles, and the tiles that flush
freed were stamped with its own instant, so they could never complete a
pool there. When the title stopped giving tiles back after a level unload
or forget_mirrors, nothing called retire_free_pools again: the 64 MB heaps
stayed (and retired heaps were not dropped) until some later give-back.

A submit now also tries retire_free_pools when no tile was flushed but a
tile in cooling has cooled or a retired heap waits to be dropped, at most
once per COOL after the last try (retire_due, retire_tried), so a submit
does not count the cooling queue every frame. A pool goes at most about
2 x COOL after its last tile was freed. The other call sites (the
PARKED_MAX flushes while decommitting) are unchanged. Retiring later than
the flush uses a fence value at least as new as the one the flush signalled
after its unmap, so the heap is not dropped earlier than before.

Tested through the software adapter only (no hardware GPU):
a_submit_with_nothing_freed_retires_pools_once_tiles_cooled (pure, with
an injected clock) and a_pool_goes_once_its_last_tile_cooled_with_nothing_parked
(state on WARP: the pool's last tile is freed at a submit, then a submit
COOL later with nothing parked retires it; it fails without the change).
cargo test --release -p xcl --lib -- --test-threads=2: 1221 passed,
0 failed, 23 ignored, 52 tests that open the hardware GPU not run. Not run
on a GPU or a title.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
When a new two-pass buffer would take the buffers alive past
XCL_TWO_PASS_MB, TwoPassBuf::make let the freed ones in FREE_RES go,
oldest first, until they came to the bytes over the cap. It did so also
when all of them came to less: the whole pool was let go, the second
reserve still failed and the draw was skipped anyway. The recordings
after it, which would have taken those buffers again and drawn, then
found the pool empty, asked make() for new ones and were refused too.
At the cap that skipped more draws than needed and sent a burst of
resource destructions to the driver when the card is fullest.

FreePool::take_room now gives nothing and keeps the pool when all it
holds is less than asked, and make() works out the bytes over the cap
with FREE_RES locked, so the free ones are in the load it compares. One
attempt still (a buffer another thread reserves in between can make it
fail after the free ones went, as before).

Verified: the two_pass unit tests on the software adapter (take_room
of more than the pool holds gives None and keeps it). Not run: a title,
and the tests that open the hardware GPU.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The lane of compute pipelines no earlier run used, added two commits
ago, came before the known graphics pipelines with no bound: every
preload worker took from it while it held anything, and pipelines made
later joined it ahead of all queued known graphics ones. A retail title
makes ~1 600 compute pipelines it never used, some taking the driver a
minute, and there are 2 to 4 preload workers, with one huge driver
compile at a time behind the gate: all workers could sit on that lane
(one compiling, the others parked at the gate) for the whole session,
and no known graphics pipeline, not even one whose driver blob loads in
milliseconds, would be built ahead. Each would then be built at its
first draw on the title's thread. That commit's message said they are
built "later than before"; they could be starved.

Backlog::next now hands out one pipeline of that lane at a time
(compute_out, cleared by Backlog::built when the worker's build is over
or a bind took the job): while a worker builds one, the other workers
take the known graphics pipelines and the rest in the order as before.
The known compute pipelines still come first, and the lane is still
under ahead_room, ahead_cap and the gate.

Left out: when nothing else is queued the other workers stay idle
rather than build more new compute pipelines; the lane drains at one
worker's speed. A known huge graphics build can still wait at the gate
while the lane's build holds the only huge slot (XCL_HUGE_PSO_CONCURRENCY
default 1), as any two huge builds ahead of their use do.

Tested with the unit tests only (software adapter): the new test takes
pipelines from the backlog without finishing them and gets the known
graphics ones while a new compute one is out, and the next new compute
one only after it is built; the lane order test still passes. Not run
on a GPU or on the title.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Since the per-setting sizes, a run that had lasted 60 s stored what it
had put in the coherent window by then, also when that was less, with
every XCL_COHERENT_HEAPS setting. With the default one (every GPU heap
in the window) the size used to only grow. A run that stays in the menu,
or a fixed-length smoke run that loads no level, has asked for about
1 GB of a full run's 4.5 GB by then: stored, it makes the next full
run's window about 1.5 GB, and the heaps past it go to plain memory,
where a retail title's shaders read zeros.

The stale size of the incident only needed the per-setting split, so
lowering is kept for the settings that send heaps to the sparse windows
(sparse, sparse:N), where a size measured with more in the window cost
video memory for nothing, and there it comes down by half at most per
run, so one short run cannot take a full run's size away at once. The
default setting only grows the stored size again.

Tested: cargo test --release -p xcl --lib coherent (8 passed, on the
software adapter), new test
only_the_sparse_heaps_settings_lower_the_stored_coherent_need. Not run
on the title or on a hardware GPU.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
With XCL_LAZY_PSO=0, go_background sent a compute pipeline to the
workers with pso_async::submit, which gave it no console program
(record 0), although go_background had computed it for the lazy path.
resolve_within writes the "compute pipeline of record X not built
after N ms" line only for a known record, so with XCL_CS_PSO_WAIT_MS
set a late pipeline on that path fell back to the generic line, which
is written for the first 16 and then at powers of two: most late
programs were not logged at all.

The non-lazy path now passes the record (pso_async::submit_with).
Nothing but the log line reads it.

Tested with the unit tests only (software adapter): the new test says
a pipeline sent to the workers when made carries its record. Not run on
a GPU or on the title.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review of d4624b7: its test covered only pc_samplers() and that D3D12 makes a
2 048-sampler shader-visible heap. Sizing the PC heap with the title's count
again, or filling only the title's slots, passed every test; the second leaves
indexes 128 to 2047 unwritten sampler descriptors, which D3D12 leaves
undefined, the hazard d4624b7 removes.

The PC heap's description moves into pc_descriptor_heap_desc and the zero
sampler fill into zero_samplers, which now fills every sampler the PC heap
holds (its own GetDesc, called from XCL, so the PC's) instead of a count passed
beside it. No behaviour change.

The new test a_shader_visible_sampler_heap_has_the_zero_sampler_at_every_index
makes a shader-visible sampler heap of 128 slots through device #14 on a WARP
device adopted as a title's, and checks that its PC heap holds 2 048 samplers
and that the descriptor bytes of every one, 2047 included, are those of slot 0.
Checked that it fails with the PC heap sized at the title's 128 ("the PC heap":
128, not 2048) and with the fill stopped at 128 ("PC sampler 128": zero bytes).

Tested on the software adapter only (WARP). Not run on the hardware GPU or on a
title.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
At the title's last Release of an allocator, alloc_pool::forget handed
back (console_list::allocator_reset) only what the PC allocators made
for it held, never what the allocator itself held. So the two-pass
buffers in ALLOC_RES for it, and the unified-memory blocks in PENDING
for it, went back only if a later allocator got the same address and
was reset. Before the two-pass cap that was a leak; with the cap
(XCL_TWO_PASS_MB, 1 GiB by default) the buffers stay counted alive, and
a title that destroys and makes allocators again (level changes) could
reach the cap and lose its two-pass draws for the rest of the session.

forget now hands back what the allocator itself held when its backing
is free: no list records on it and every submit of one is passed by the
GPU (the fences `executed` set) - the same test a Reset of it passes
before allocator_reset runs. It is taken before the loop, since the
allocator may be both its own stand-in and put aside, and its backing
goes at the first. Still left as before: an allocator a list still
records on at its Release, or whose submits the GPU has not passed,
keeps what it held (its backing is no longer tracked, so nothing says
when the GPU is done with it); the next commit logs those bytes so a
cap held by them can be seen.

Test: a_released_allocator_gives_back_its_two_pass_buffers (WARP
buffers, synthetic allocators): the released allocator's buffer goes
to FREE_RES, that of one a list still records on stays in ALLOC_RES.
It fails with the hand-back disabled. The d3d12x unit tests pass on the
software adapter; the tests that open the hardware GPU and a title run
were not run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The two-pass stats line said how many bytes are alive and how many of
them are kept for reuse, but not where the rest wait. Bytes held in
ALLOC_RES for an allocator that is never reset again (one released
while a list still recorded on it or its submits were in flight, which
alloc_pool::forget still leaves), or in UNKNOWN_RES, count against
XCL_TWO_PASS_MB; the line now gives both, so a cap held by them can be
told from one held by recordings.

The locks are only tried, as FREE_RES already is: a buffer can be let
go with ALLOC_RES locked on the same thread. Logging only; no test.
Built and the two_pass unit tests run on the software adapter.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review of d4624b7: the PC heap behind a shader-visible console sampler heap
now holds 2 048 samplers, and descriptor heap #8 GetDesc was not hooked, so a
title asking its 128-slot sampler heap for its description read 2 048. A title
that sizes an allocator or a loop from that count makes samplers or copies at
console handles past its 128 16-byte slots: console_heap::slot finds none
there, dev_create_sampler_x hands the handle to the PC CreateSampler as it is,
and the driver writes a sampler descriptor at that address in the title's
memory. A view heap already read twice its slots, and one whose views are in
the shared heap read no shader-visible flag. Whether the retail title calls
GetDesc on these heaps was not checked (no trace taken).

Device #14 now keeps the description each console CBV/SRV/UAV and sampler heap
was made with (the title's type, 4 included, count, flags and node mask) until
the heap's last Release, and #8 answers it to calls from the title's images,
returned through the hidden pointer called the C++ way or the C way
(this_first, as device #25 / #26). Other heaps, and every call from XCL itself
(the split slot: list_x::pc_heaps reads the PC flags), get the PC
description as before.

New test a_console_heap_describes_itself_as_the_title_made_it, on a WARP device
adopted as a title's: a shader-visible sampler heap of 128 made through device
#14 answers [1, 128, 1, 0] both ways while XCL's own GetDesc says 2 048; a view
heap answers the PC description until it is known as a console heap of type 4
and 64 slots, then that; both are forgotten when released; #8 is in the
descriptor heap's console slots. Checked that it fails with the hook answering
the PC description ("the sampler heap": [1, 2048, 1, 1]). The view heap's
recording at creation is not covered (making a view heap through #14 makes the
process-wide shared heap).

Tested on the software adapter only (WARP). Not run on the hardware GPU or on a
title.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
A thread remembers the tiles it asked for in GPU views so that draw after
draw does not ask again, and forgot them only when a view's mappings
changed. A tile given back when the title decommits its source, or dropped
because its source was not there yet, leaves the set of asked tiles without
that: the thread still remembered asking, did not ask again when the title
committed and bound the memory again, and the tile stayed unmapped. A mesh
read zeros for its vertices, and a retail title's mesh programs take a count
of 0 as an empty group. The title gives back about 470 tiles a second while
its world streams in. The exact-range memory before had the same hole for a
range bound again at the same address; remembering whole tile spans widened
it.

The asks forgotten are counted (sparse::mirror_asks_forgotten) and a
thread's memory is emptied when the count changes, as when the views change.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Twelve files conflicted. Where both sides had solved the same problem the
upstream implementation is taken and the local one removed, with what the
local one covered beyond it kept on top:

- the shared view heap is 1 000 000 descriptors and the shaders' T# index
  guard is tied to it (19bef42) instead of the heap tried at 2^21; the null
  fill of the whole heap and its build outside the lock stay
- empty 64 MiB page-pool heaps are reclaimed by upstream's sweep with its
  fences and warm spare (5a515f0) instead of the local retire list; the
  check that a heap has no live tile and the hand-over to late_release stay
- wanted huge driver compiles are hard-capped (ae00ec7) instead of going on
  without a slot; build-ahead still gives its turn to a wanted build
- a newer-layout #139 Reset reaches the wrapper's Reset through reset_x
  (78fba7b) instead of the local slot_139
- a Draw on a two-pass pipeline is skipped by upstream's guard (a7b478b);
  the local ExecuteIndirect path that runs a noted DispatchMesh signature
  as two passes stays, as does the skip without a graphics root signature
- write_u64_now checks through upstream's u64_writable_now

Both kept: the shared sampler heap (71639e0) with the local 2 048 PC
samplers and names bookkeeping, XCL_PSO_IMAGE_SKIP (5f4d32f) beside
XCL_CS_PSO_WAIT_MS, the image_load-after-store read (ec356bc) beside the
coherent-memory gating.

Software adapter: cargo test --release -p xcl --lib -- --test-threads=4:
1319 passed, 0 failed, 23 ignored; the 55 tests that open the hardware GPU
were not run.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
ensure_view_heap binds the shared sampler heap in the same call as the
shared view heap when there is one (71639e0). The test of the two-pass
binds, which runs only with XCL_HEAP_WINDOWS=1 on a hardware device, still
expected the view heap alone and would fail as soon as a test before it had
made the sampler heap. It now expects what the bind sets, as upstream's
unbinding_all_heaps_lets_the_shared_heap_be_bound_again does.

Type-checked only: the test opens the hardware device and was not run.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The stream recheck fingerprints a texture that is not fully write-watched
when it is uploaded, and re-queues it at later frame milestones when its
memory no longer matches that fingerprint. It assumed every upload sends
the whole texture, so the fingerprint equals what the PC texture holds.
Here an upload can be partial: a Due with whole == false sends only the
written pages it knows of, or nothing when texture_upload::changed finds
them unchanged. seed_stream_recheck seeded every Due, so after an
unwatched write followed by a partial upload of other pages the baseline
already held the unwatched bytes, the milestone recheck matched it, and
the texture kept the old contents on the GPU.

Only a whole Due now sets the baseline. A partial one leaves the entry
alone, its schedule too: moving the schedule on every partial upload would
keep a texture written every few frames from ever reaching a milestone.
A partial Due that turns into a full upload (Parts on a render target, or
XCL_TEXTURE_PARTS=0) does not reseed either; its milestone then sees the
old baseline and queues one extra whole upload.

The new test seeds with a whole upload, writes an unwatched byte, runs a
partial Due through the seeding and checks that the milestone queues the
texture; it fails without the change. Both stream recheck tests now take
TEST_LOCK, since a recheck in one checks the other's STREAM_RECHECK entry.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A split segment moved to the spares (title_list::reset, KickoffX) went
through alloc_pool::forget_list to drop its allocator pin. forget_list
also removes the list's last submit and recording count, which
alloc_pool::in_flight reads: pop_spare then handed out a PC list the GPU
was still running, the title recorded into it and submitted it again
(debug layer id 553; NVIDIA removes the device), and note_resubmits had
nothing left to report it with. It happens with a stand-in moved to the
spares while its submit runs, a segment still queued behind a queue Wait
after the primary is done, and the segments KickoffX has just submitted.

clear_segment_state now calls alloc_pool::unpin_list, which removes only
the allocator pin (of_list and the backing's users). forget_list, which
removes everything, stays for the paths where the PC list is destroyed
(on_release, title_list::release) and its address can come back.

Tests: the reset-while-the-last-submit-runs test resets and submits once
more while the queue is held, so a stand-in still in flight is in the
spares and must not be used; a new test splits a list, KickoffX submits
it, and the next split must not get the segment just submitted. Both
fail without the change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
in_flight and note_resubmits read the fence of a list's last submit
through the fence's own vtable. alloc_pool makes that fence on the
queue's device, so it can carry XCL's GetCompletedValue hook for the
title, which tries the sparse state's lock to land copies back. These
are XCL's own queries, made with alloc_pool's lock held (and in
pop_spare with title_list's segments lock too, once per spare); the same
hook cost about 2 ms per query in Backing::idle until that moved to
real::fence_completed. Both now use real::fence_completed as well.

The value read is the same, so no test tells the two apart; the existing
alloc_pool and list_x tests of in_flight and note_resubmits still pass.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
When a PC resource is destroyed, resource_gone makes its views in the
shared shader-visible heap null views and records those indexes as
naming nothing. The title's own PC heap, the CPU-only mirror views are
made in and copied from, keeps the destroyed resource's descriptor. A
later copy of that console slot (CopyDescriptorsSimple from a CPU-only
heap, a stale material table) copied the mirror's dead descriptor into
the destination's place in the shared heap and recorded it as naming
nothing, so no later destroy would ever null it: a shader sampling it
touches unmapped memory, the fault resource_gone exists to prevent.

A claimed index is now recorded as GONE instead of 0. names_of hands
that to publish_range, which writes the null view of its kind over a
GONE source's copy in the shared heap and records the destination as
GONE too, so a copy of that copy is nulled the same way. The check is
made where the copy is published, under SLOT_WRITES, and nothing is
written into the title's mirror, so a view the title makes in that slot
meanwhile is not overwritten. The lock order at SLOT_WRITES is kept:
the null views' source (GLOBAL) is taken before SLOT_WRITES, as in
resource_gone.

The new WARP test (in a child process, the shared heap being the
process's) makes an SRV of a texture in a CPU-only console heap, ends
the texture, copies the slot into a shader-visible heap and again from
there: the shared descriptors of both copies must be the null view and
named GONE. Without the publish_range change the first copy holds the
texture's view.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The lane of giant driver compiles (4 MiB of DXIL or more) has one slot,
for wanted builds too (the hard cap from upstream), and the backlog
builds pipelines ahead of their first use on its lowest-priority workers.
Together a giant build ahead could take the free slot, and a giant build
a bind waits for then stood behind it for that whole compile (minutes),
because a slot is never given back before the compile ends.

A build ahead of its pipeline's first use now takes no slot in that lane:
it waits there, holding none, until its pipeline is used (a bind wants it
and it takes the wanted slot, or a bind gave up on it and it waits like
any unwanted build). It does not spin: it sleeps on the lane's condvar
with the same 50 ms re-check as every waiter. So that a pipeline the title
never uses cannot hold up the backlog, the waiting build's backlog worker
gives back the lane of new compute pipelines and a new worker starts in
its place (pso_async::build_parks); the waiting thread ends after its
build. The BIG lane is unchanged: it keeps a wanted slot free beside the
one an unwanted build can take.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
With XCL_PSO_IMAGE_SKIP=1 a bind does not wait for a big compute program
that writes only images; resolve_spared sent its build to the normal
worker queue. Those builds are unwanted, so each one, after translation
and DXC, waits in big_compile_turn for the single unwanted slot of huge
driver compiles. A world start binds hundreds of such programs: with more
of them queued than there are workers, every worker sat in that wait, and
with a wait budget (XCL_CS_PSO_WAIT_MS or XCL_PSO_WAIT_MS) a build a bind
waits for, which only the workers build then, stood in the queue behind
them until the bind's budget ran out.

Their builds now go to the build-ahead backlog, in the lane of new compute
pipelines (Backlog::spared): handed out one at a time with that lane,
before its pipelines, and also short of commit or past XCL_PSO_AHEAD,
since these pipelines are used. The normal workers stay free for builds a
bind waits for. Without the backlog (XCL_PSO_PRELOAD=0) the build goes to
the normal workers as before, and with XCL_PSO_IMAGE_SKIP unset no
pipeline is spared, so nothing changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Several comments still described an older rule, that a build a bind
waits for goes on at once without a slot of huge driver compiles. Since
the hard cap on wanted builds, a wanted build skips only the wait for
free commit and takes one of the slots kept for wanted builds, up to
their cap. The comments of driver_compile, build_is_wanted,
Pending::unwant, cs_wait_budget and the backlog now say so, and the
backlog's also says that a build ahead takes no giant slot.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Since only a whole upload seeds the stream recheck baseline, a partial
upload of an unwatched texture that has no recheck entry (it retired
after its last milestone, was pruned while its range was watched, or
was never seeded) did nothing. Writes to its unwatched pages after that
upload went unnoticed until something else made the texture pending.
Before, the partial upload re-created the entry, with a fingerprint of
memory the GPU never got.

Such a partial upload now inserts an entry without a baseline
(last_fp: None). Its first milestone always queues the texture, and the
whole upload that follows sets the real baseline. An existing entry is
still left alone by a partial upload, so its baseline and schedule stay
those of the last whole upload.

The cost is at most one extra whole upload per partial upload of a
texture without an entry, four frames later.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A giant driver compile of a pipeline nobody has used yet waits for that
first use and takes no slot (real::huge_compile_turn). On a backlog
worker, build_parks gives back the lane of new compute pipelines and
starts a worker in its place, and the waiting thread ends after its build
without giving the lane back again. Nothing tested that part. If it
regresses, the lane of new compute pipelines, and the spared lane that
shares its turn, stops for good behind a pipeline the title may never
use.

The new test runs on the global backlog. A lazy compute pipeline with a
key no run used is built on a backlog worker, and its job calls
huge_compile_turn for the giant lane. The test checks four things:
- the next new compute pipeline is built while the giant one waits, and
  another worker has taken the waiting one's place;
- once a bind waits for the giant one (resolve_wait_for), it goes
  through the giant slot and is built;
- the waiting thread then ends, leaving as many backlog workers as
  before (counted by thread name);
- while another new compute build holds the lane, the end of the giant
  build does not give the lane back a second time.

With build_parks made a no-op, the test fails on the first check. With
the parked thread calling Backlog::built again, it fails on the last.
huge_compile_turn, SlotGuard and GIANT_DRIVER_COMPILE become pub(super)
so the test can reach them. No behaviour changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
The direct translator now refuses a compute or mesh program with
s_barrier in a thread group of several 32-lane hardware waves, so that
the HLSL path's bounded barrier takes it. A program the HLSL path could
not translate completely would then lose its dispatches or draws
altogether, and nothing checked that for a title's real programs in the
layout its runs use (16 memory windows from the descriptor heap, split
wave64).

XCL_SAMPLE_BARRIER=<folder of dumped shaders> (ignored test, as the other
tests on a title's data): for every such program it checks that the
direct translator refuses it for the barrier and nothing else, that the
HLSL translation is complete and has the bounded barrier, and that DXC
compiles it.

Measured on a retail title's 216 compute and 36 mesh-pass programs with
the barrier (software adapter, XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1):
252 refused for the barrier, 252 complete on the HLSL path, 252 compiled.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
XCL_SAFE_BARRIER=0 changes what both translators emit (the HLSL path's
plain group barrier instead of xcl_s_barrier) and, since the direct
translator leaves a compute or mesh program with s_barrier in a group of
several hardware waves to the HLSL path, which translator takes such a
program. It is neither part of the translated cache's identity nor in
cache_allowed's list, while XCL_WAVE64_SPIN and XCL_X64_ALL_MASKS are.
One diagnostic run with XCL_SAFE_BARRIER=0 therefore stored DXIL with
plain group barriers in multi-wave compute and mesh-pass programs, and
every later default run loaded it from disk first; the other way round,
the switch had no effect on programs a default run had already cached.

It is now in the list: while it is set, compute and mesh programs are
translated without the disk cache, as with the other switches that
change the translated code. The cache test checks it for compute, mesh,
vertex and pixel stages.

Tested (software adapter, through the agent wrapper):
  cargo test --release -p xcl --lib -- --test-threads=4 gpu::recomp::
    370 passed, 0 failed, 18 ignored
  ... gpu::dxil::   150 passed, 0 failed, 3 ignored
  ... barrier       6 passed, 0 failed, 1 ignored
Not run: the 55 tests that open the hardware GPU themselves (the wrapper
skips them on this machine); no GPU run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The watch held every later submit of every thread once an
ExecuteCommandLists or Present had not returned for XCL_GPU_STALL_MS,
with no time limit. A call that only waits for GPU progress which
depends on a submit the gate then parks (a cross-queue fence, a Write64
wait bridged to a queue Wait) never returns, so a slow moment became a
permanent stop. The stop file was read on the same thread, after the
device poll: had GetDeviceRemovedReason not returned in a driver error,
the stop would never have been taken and the process would have been
killed from outside with GPU work in flight.

- A long call is logged when it passes the limit (with the ring), every
  5 s while it lasts, and when it returns, with the real length of the
  stall (its start is kept on its own; the old line computed it from
  the time last said, which every 5 s overwrote). The decision is a pure
  step function (watch_step) with tests, among them a 13 s stall.
- Command lists are held only while a stop for a driver error is being
  handled (HOLD, set by the stop file's fault path). The wait takes the
  flag, and returns at once on a thread that is itself inside a timed
  call (it would wait on itself).
- The stop file is read on its own thread (xcl-stop-file), also with
  XCL_GPU_WATCH=0, which calls nothing in the driver before the title
  ends. It is read as bytes: a file that is still empty is ignored (10
  polls in a row: end), a UTF-8 BOM is stripped, UTF-16 LE is decoded.
  On a fault it waits 12 s for the watch thread's device poll, and
  says when that poll itself has not returned (a heartbeat).
- The 65th thread that asks for a slot is logged once.

Tested on the software adapter, through the agent wrapper:
  test --release -p xcl --lib -- --test-threads=4 watch::
    9 passed, 0 failed, 0 ignored
  test --release -p xcl --lib -- --test-threads=4 hle::d3d12x::
    344 passed, 0 failed, 1 ignored
Not run: the 55 tests that open the hardware GPU themselves, and no
title or driver hang (the stall and stop paths are covered by their
pure functions and the hold test only).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
On 32-lane hardware the direct translator runs the ES phase of a
geometry pass in both hardware halves of the console wave with
Partner::Present (translate_on_this_thread sets it per phase), so every
ballot and lane read meets the other half at a plain group barrier.
That is the pattern of #1727 (NVIDIA GPUs hung with the direct
translator's exchanges at group barriers), which the previous commits
removed for compute and mesh programs; the HLSL geometry path exchanges
through the bounded spin by default (x64_spin: XCL_WAVE64_SPIN unset).

kernel::translate_geometry now refuses the split form when the program
has an ES phase and the safe barrier is wanted (XCL_SAFE_BARRIER=0: as
before). Its only runtime caller, pso::console_geometry, logs the
refusal through direct_fallback and translates the pass on the HLSL
path; the shader cook does not translate geometry passes, and the
direct coverage sweep counts the refusal as a fallback reason. The GS
alone (no partner half) and the native wave64 form stay direct.

Tests: a new one checks the refusal (ES+GS and ES alone, 1, 4 and 16
heap memory windows) and that the native form and the GS alone still
translate; it returns early under XCL_SAFE_BARRIER=0. The tests that
sent split geometry through the direct translator (geometry_forms_validate,
gpu_geometry_direct_records, geometry_mode_validates,
gpu_geometry_wave32_prefix_count_over_a_mask) take the HLSL path's
container on exactly that refusal, check its translation is complete and
compile it with DXC, as tests.rs's direct_or does for compute and mesh.

Tested (software adapter, through the agent wrapper):
  cargo test --release -p xcl --lib -- --test-threads=4 gpu::dxil::
    151 passed, 0 failed, 3 ignored
  ... gpu::recomp::  370 passed, 0 failed, 18 ignored
  ... barrier        6 passed, 0 failed, 1 ignored
Not run: the 55 tests that open the hardware GPU themselves (the wrapper
skips them on this machine); gpu_geometry_direct_records skipped (no
mesh shaders on the software adapter); no GPU run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The report of the last draws and dispatches had three gaps:

- It named a pipeline through pso_async::resolve, which notes a use
  and sends a lazy pipeline not yet built to the workers: a stall or
  removal report could start a pipeline build on a driver that hangs.
  pso_async::peek returns the real pipeline behind the handle (or the
  handle) with no side effect, and the report uses it.
- Graphics pipelines are in real::pso_shaders only while profiling, so
  every draw line said "no console shader known". With XCL_DRED the
  pipeline's DRED label (its console shaders) names it now.
- A DispatchMesh with a PC pipeline (a translated pass-through mesh
  pipeline) went to the driver without a note, so those draws were
  missing from the ring. It is noted now (kind 8, "DispatchMesh").

The ring is written when a draw is recorded on a list, not when it is
submitted: the report says "recorded last" where it said "in flight".

Tested on the software adapter, through the agent wrapper:
  test --release -p xcl --lib -- --test-threads=4 watch::
    9 passed, 0 failed, 0 ignored
  test --release -p xcl --lib -- --test-threads=4 hle::d3d12x::
    345 passed, 0 failed, 1 ignored (a_peek_changes_nothing is new)
Not run: the 55 tests that open the hardware GPU themselves, and no
title (the DRED label and the mesh note are not covered by a run).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Three corrections to the forgotten-ask count of c9fe50e (sparse.rs):

- take_asks counted every ask it left out (no pair for the tile, a tile
  with its own memory, no window index). An address a title binds at
  every draw is left out at every submit: every thread's memory of its
  asks was emptied at every submit, the threads asked again and the next
  submit counted again, a steady loop that defeated the memory. That
  branch removes the tile from the asked set uncounted again, as before
  c9fe50e; a pair made later already changes the views' generation.
- forget_mirrors took the tiles out of the asked set first and out of
  the queue after. An ask on another thread in between inserted the tile
  as new and queued it, and the queue's retain then deleted it: the tile
  stayed asked for, in no queue, with no count after it, and was never
  mapped (the GPU read zeros there). The queue goes first now: an ask in
  between finds the tile still asked for, or stays queued, and the count
  after it has the thread ask again.
- forget_mirrors_in dropped asks a submit had taken (their CPU view
  forgotten) and left them in the asked set: asked for again, they were
  not queued. Each ask it drops is forgotten (and counted) now.

Tests: an_ask_left_out_is_not_counted_and_may_be_asked_for_again,
a_tile_asked_for_while_it_is_forgotten_is_not_lost (a test hook runs an
ask between the two steps of the forget) and
an_ask_dropped_by_a_forget_may_be_asked_for_again. They count on a
thread-local copy of the count, since every test shares the global one.
All three fail with the old code and pass with this.

Tested on the software adapter (WARP) through the agent cargo wrapper:
cargo test --release -p xcl --lib -- --test-threads=4 <filter>
  sparse: 61 passed, 0 failed, 1 ignored (2 SKIPPED: no GPU)
  view_want: 3 passed; mirror: 7 passed; targets::: 7 passed;
  frame_dump: 1 passed; dumped_texels: 1 passed; 0 failed in each.
Not run: the 55 tests that open the hardware GPU themselves (the
wrapper skips them), and no run on a title.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The guard script ends a run that stays over the video memory budget
for 10 s, counting the over-budget lines. XCL wrote a line it matches
only while over the budget, and the budget once, so the guard's counter
never went back to 0 when the process dropped under the budget again:
five over-budget samples spread over a whole run ended it.

The activity thread's "memory: ..." line (every 2 s) now ends with
"; video memory budget N MB" when the budget is known, so the guard can
decide on every memory line. The rest of that line is unchanged (other
tools read its beginning); the over-budget warning stays as it was, and
the one-time budget line is gone.

Tested on the software adapter, through the agent wrapper:
  test --release -p xcl --lib -- --test-threads=4 watch::
    9 passed, 0 failed, 0 ignored
  test --release -p xcl --lib -- --test-threads=4 hle::d3d12x::
    345 passed, 0 failed, 1 ignored
Not run: the 55 tests that open the hardware GPU themselves; the
activity thread's line has no test (logging only) and no title was run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
mapped_frame_dump_distinguishes_dark_bright_and_undecoded_content wrote
its third frame as R32_FLOAT and expected "format not decoded"; since
337c309 texel_rgb gives R32_FLOAT a colour, so the bytes [31, 0, 0, 255]
decoded (about -1.7e38, tone-mapped white) and the test failed. The
agent runner skips it as one that opens a device itself (it creates a
WARP device), so the failure was not seen.

It uses R9G9B9E5_SHAREDEXP now: no arm of texel_rgb or rgb takes it, it
is no render-target format (so a dump is not about to decode it), and its
texel is 4 bytes (texel_bytes' default), the footprint the test fills
(8 x 8 texels, 256-byte rows). The test asserts that texel_rgb does not
decode it, and keeps "undecoded is different from dark".

Type-checked only: cargo check -p xcl --tests (no new warnings). The test
itself was NOT run: the agent wrapper skips it with the tests that open a
device themselves, and no GPU may be used here; it is left to a run with
the hardware tests.
Run on the software adapter (WARP) with the other changes of the branch:
cargo test --release -p xcl --lib -- --test-threads=4 <filter>
  frame_dump: 1 passed (reports_without_frame_dumps_remain_readable);
  dumped_texels: 1 passed; 0 failed. 55 hardware tests not run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
When the 2 s wait for a frame or target dump copy timed out, present_now
logged the fence error's text, "present: frame dump copy: GPU fence still
pending after 2000 ms". A guard script outside the process reads "GPU
fence still pending" as the graphics card having stopped answering and
blocks every later run. A dump copy queued behind a long backlog of the
title's work on its queue is not that.

A timeout now logs a warning without that text: "present: frame dump
copy: not finished after <ms> ms – this dump is skipped". Every other
error is logged as before. The path is otherwise unchanged: the dump is
not written, its readback buffers and copy source stay with the
presenter and go to the ring slot at the next present
(prepare_pipelined_slot), and only a removed device disables it.

Logging only; no test. Checked: cargo check -p xcl --tests (no new
warnings). Run on the software adapter (WARP):
cargo test --release -p xcl --lib -- --test-threads=4 <filter>
  frame_dump: 1 passed; dumped_texels: 1 passed; targets::: 8 passed;
  0 failed. 55 hardware tests not run; the timeout path itself was not
  run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
XCL_DUMP_TARGETS copies up to 64 render targets at one present, each
into a readback buffer of its own. At 2560x1440 RGBA32F that is about
3.8 GB of readback memory at once, on a card that may already be full.

to_dump keeps the targets, in the order they are dumped, until their
readback bytes (width x height x texel_bytes) pass 1 GiB; the rest are
left out, and one line says how many of how many and which. A first
target larger than that is still dumped. The decision is a pure helper
(dumped_within, with readback_bytes) beside to_dump.

Test: targets::tests::a_target_dump_stops_at_a_gib_of_readback (18 of 64
RGBA32F targets at 2560x1440, everything under the cap, exactly 1 GiB,
the order kept, a first target over the cap).

Run on the software adapter (WARP) through the agent cargo wrapper:
cargo test --release -p xcl --lib -- --test-threads=4 <filter>
  sparse: 61 passed, 1 ignored; view_want: 3 passed; mirror: 7 passed;
  targets::: 8 passed; frame_dump: 1 passed; dumped_texels: 1 passed;
  0 failed in each.
cargo test --release -p xcl --lib -- --test-threads=4
  1335 passed; 0 failed; 24 ignored; 177 of the passed printed
  SKIPPED on WARP (no GPU features there).
Not run: 55 tests that open the hardware GPU themselves (the wrapper
skips them), among them the frame dump test changed two commits back;
no run on a title.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The tests of the previous barrier changes passed whatever form the
exchange took:

- split_wave64_dead_scc_skips_exchange_barrier counted every
  dx.op.barrier, the spin exchange's two groupshared fences included, so
  it passed whether one console wave met at a group barrier or spun, and
  its comment still spoke of two group barriers. It now counts the group
  barrier with sync (mode 9, GROUP_SYNC: only the start's in both
  programs) and the exchange's fences (mode 8, TGSM_FENCE: +2 with live
  SCC) apart.
- a_single_split_wave_of_a_compute_group_exchanges_without_a_group_barrier
  now also checks mesh entries of 48 and 64 threads (one console wave:
  they must not keep Partner::Present), that the counters are zeroed
  before the start's group barrier, the spin storage of its own without
  LDS (4 slot words, 2 counters), and with LDS the HLSL layout: thread
  counter at word 8191, counters at 8189/8190, slots from 8185, the
  program's LDS clamped to 8184.
- a_group_barrier_of_several_hardware_waves_is_left_to_the_hlsl_path
  returns early under XCL_SAFE_BARRIER=0, as recomp/tests.rs does, so the
  suite does not fail with that switch.
- The HLSL path had no synthetic Mode::Mesh test with heap memory
  windows: gpu_mesh_mode_exports_stay_inside_the_record's program (128
  threads, s_barrier between two console waves) is now also translated
  split with HEAP_WINDOWS | 16, checked complete, with the bounded
  barrier, and compiled by DXC (cs_6_6), before its GPU part.

Tested (software adapter, through the agent wrapper):
  cargo test --release -p xcl --lib -- --test-threads=4 gpu::dxil::
    151 passed, 0 failed, 3 ignored
  ... gpu::recomp::  370 passed, 0 failed, 18 ignored
  ... barrier        6 passed, 0 failed, 1 ignored
Not run: the 55 tests that open the hardware GPU themselves (the wrapper
skips them on this machine); the GPU parts of the dead-SCC and mesh
export tests skipped (no 32-lane GPU / no wave64); no GPU run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Since one split console wave of a compute or mesh group exchanges by
counters (Partner::Spin), several comments were wrong: the lanes module
said the two halves always meet at a group barrier, and VAR_XK /
VAR_XDEAD, Partner::Spin, exchange_spin and DxilIr::split tied the spin
exchange to groups of several console waves. They now say that compute
and mesh groups spin however many console waves they have, and that only
the ES phase of a geometry pass (direct only with XCL_SAFE_BARRIER=0)
and the tests' kernel form meet at a group barrier.

XCL_WAVE64_SPIN=0 still forces group barriers for one wave64 group in
the HLSL path only; the direct translator always spins for one split
wave of a compute or mesh group. x64_spin's comment says so. (Changing
emit.rs changes the HLSL translation cache's source identity: cached
translations are made again once.)

No code changes. Tested (software adapter, through the agent wrapper):
  cargo test --release -p xcl --lib -- --test-threads=4 gpu::dxil::
    151 passed, 0 failed, 3 ignored
  ... gpu::recomp::  370 passed, 0 failed, 18 ignored
  ... barrier        6 passed, 0 failed, 1 ignored
Not run: the 55 tests that open the hardware GPU themselves (the wrapper
skips them on this machine); no GPU run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The fault path of XCL_STOP_FILE says how long the watch thread's check of
the device has not returned when the device was not reported removed in
12 s. It counted from when the 12 s wait began, so a check that was
already stuck before the stop was asked was reported too short (12000 ms
for one stuck for 17 s). The heartbeat is now the time the last poll
returned (now_ms, set when the watch thread starts as well), and the
line gives now minus that. The text of the line is unchanged.

The comment at watch::start in real.rs still said the watch thread takes
the stop; that is the xcl-stop-file thread now, from device creation on.

Tested (software adapter, agentcargo.ps1 -Key w5pipes):
- 'test','--release','-p','xcl','--lib','--','--test-threads=4','watch::':
  9 passed, 0 failed, 0 ignored
- same with filter 'hle::d3d12x::': 345 passed, 0 failed, 1 ignored
Not run: the 55 tests that open the hardware GPU (skipped by the
wrapper), any title run. The stop thread's 12 s path has no unit test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
to_dump wrote its line per target, with " → targetK" for each target to
copy, before it applied the 1 GiB readback cap; the warning after it
then named some of those same targets as left out. The log contradicted
itself. The cap is now decided as each target is listed: a target past
it is logged "(not dumped: targetK is past the readback cap)" and is not
copied, and the one warning line still gives how many of how many were
left out and which. dumped_within is asked with the sizes so far; it
depends only on the targets before, so a target cut stays cut and the
targets kept are the same as before.

Test: targets::tests::a_target_dump_stops_at_a_gib_of_readback also
checks that asking with 1..64 targets keeps min(n, 18).

A correction to e0a1b4a ("a frame dump copy that is not done in 2 s is
a warning"): its body gives "targets::: 8 passed", but that run was made
on the branch's full working tree with b850d2e's test in it; at e0a1b4a
targets.rs has 7 tests. The intermediate commits f85ef6b and e0a1b4a
were not built or tested on their own.

Run on the software adapter (WARP) through the agent cargo wrapper:
cargo check -p xcl --tests: no new warnings.
cargo test --release -p xcl --lib -- --test-threads=4 <filter>
  targets::: 8 passed; frame_dump: 1 passed; dumped_texels: 1 passed;
  sparse: 61 passed, 1 ignored; view_want: 3 passed; mirror: 7 passed;
  0 failed in each.
cargo test --release -p xcl --lib -- --test-threads=4
  1335 passed; 0 failed; 24 ignored.
Not run: 55 tests that open the hardware GPU themselves (the wrapper
skips them); no run on a title, so the cap's log lines were not seen at
run time.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
From the review of c9fe50e, 337c309 and 0a8cd59:

- an ask for a GPU-view tile that a submit leaves out (no pair, own memory,
  no window) is dropped without the count that empties every thread's
  memory of its asks: an address left out at every submit emptied them at
  every submit;
- forget_mirrors drops the queued asks before the asked set's tiles, and
  forget_mirrors_in counts the asks it drops: a tile asked for while it
  was being forgotten stayed asked for, in no queue, and was never mapped;
- the frame dump test's undecoded frame uses a format no dump decodes
  (R32_FLOAT is decoded since 337c309, so the test had been failing
  unseen: the software-adapter runner skipped it);
- a dump copy that is not finished after 2 s is a warning of its own, not
  the fence's text (a guard outside reads that as a stopped GPU);
- one present's target dump reads back 1 GiB at most.

Software adapter, whole library suite on the branch: 1335 passed, 0 failed,
24 ignored; 55 tests that open the hardware GPU not run.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
a_held_submit_goes_on_when_the_hold_ends_and_at_once_inside_a_timed_call
checked the hold only by seeing nothing arrive within 300 ms. A thread
scheduled more than 300 ms late would have passed that check with no
hold at all. The thread now sends once before it calls wait_while; the
test waits for that, then asserts that the second send does not come
while the flag is set, and does come once it is cleared.

Tested (software adapter, agentcargo.ps1 -Key w5pipes):
- 'test','--release','-p','xcl','--lib','--','--test-threads=4','watch::':
  9 passed, 0 failed, 0 ignored
- same with filter 'hle::d3d12x::': 345 passed, 0 failed, 1 ignored
Not run: the 55 tests that open the hardware GPU (skipped by the
wrapper).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Since 685cf9c the direct translator leaves a split geometry pass with an
ES phase to the HLSL path while the safe barrier is wanted, so on a
32-lane GPU every ES+GS pass now goes through
recomp::translate_geometry(.., split, mem_windows()), which in a
title's layout is HEAP_WINDOWS | 16. No test translated HLSL split
geometry with those windows (only 1 or 4 plain windows); an incomplete
translation there fails the whole PSO in translated_gs_pso.

geometry_forms_validate now also sends ES+GS and ES alone with
HEAP_WINDOWS | 16 through direct_or_hlsl in both forms: the native form
validates through the direct translator, the split form takes the HLSL
container on exactly the refusal, asserts the translation is complete
and compiles it with DXC (cs_6_6).

With the safe barrier wanted (the default), the direct split ES+GS form
is now validated only by runs with XCL_SAFE_BARRIER=0.

Tested (software adapter, release, agentcargo.ps1 wrapper):
  cargo test --release -p xcl --lib -- --test-threads=4 gpu::dxil::
    151 passed, 0 failed, 3 ignored
  cargo test --release -p xcl --lib -- --test-threads=4 gpu::recomp::
    370 passed, 0 failed, 18 ignored
  cargo test --release -p xcl --lib -- --test-threads=4 barrier
    6 passed, 0 failed, 1 ignored
Not run: the 55 tests that open the hardware GPU themselves; nothing
ran on a GPU (gpu_geometry_direct_records is SKIPPED: no mesh shaders).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
a_single_split_wave_of_a_compute_group_exchanges_without_a_group_barrier
found the first address of a counter before the start's group barrier
and then accepted any `store i32 0,` after it, so a zero stored to some
other word in between satisfied it. It now takes the value the
counter's getelementptr defines (@xcl_xc without LDS; with LDS the
address built from the `add .., 8189` index into @xcl_lds) and asserts
`store i32 0, i32 addrspace(3)* %N` through exactly that value before
the barrier, for the compute and the 48 / 64 thread mesh cases.

Tested (software adapter, release, agentcargo.ps1 wrapper):
  cargo test --release -p xcl --lib -- --test-threads=4 gpu::dxil::
    151 passed, 0 failed, 3 ignored
  cargo test --release -p xcl --lib -- --test-threads=4 gpu::recomp::
    370 passed, 0 failed, 18 ignored
  cargo test --release -p xcl --lib -- --test-threads=4 barrier
    6 passed, 0 failed, 1 ignored
Not run: the 55 tests that open the hardware GPU themselves; nothing
ran on a GPU.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
docs/wave64-on-wave32.md still said that one console wave per group
(most compute, ES+GS) meets at GroupMemoryBarrierWithGroupSync and that
`XCL_WAVE64_SPIN=1` forces the counters everywhere. Spinning is the
default in the HLSL path (=0 is the switch), the direct translator
spins for one split wave of a compute or mesh group whatever the
variable says (1be95b1), and it leaves split geometry with an ES phase
to the HLSL path while the safe barrier is wanted (685cf9c). The group
barrier is now used only in the tests' kernel form, with
XCL_WAVE64_SPIN=0 in the HLSL path and in the direct ES phase with
XCL_SAFE_BARRIER=0. The doc says so, and that =0 affects the HLSL path
only.

The comment of DxilIr::split (recomp/lower_dxil.rs) said the spin meet
is for a compute group "of one console wave or more"; a group of 32
threads has no partner and no exchange, so it now says "more than 32
threads". Comments and docs only.

Tested (software adapter, release, agentcargo.ps1 wrapper):
  cargo test --release -p xcl --lib -- --test-threads=4 gpu::dxil::
    151 passed, 0 failed, 3 ignored
  cargo test --release -p xcl --lib -- --test-threads=4 gpu::recomp::
    370 passed, 0 failed, 18 ignored
  cargo test --release -p xcl --lib -- --test-threads=4 barrier
    6 passed, 0 failed, 1 ignored
Not run: the 55 tests that open the hardware GPU themselves; nothing
ran on a GPU.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
From the review of fb55e49 and 1be95b1:

- XCL_SAFE_BARRIER changes what both translators emit and which of them
  takes a compute or mesh program, and was not part of the translated
  cache: one diagnostic run with it at 0 stored DXIL with plain group
  barriers that every later run loaded. The cache is not used while it is
  set;
- the direct translator leaves a split wave64 geometry pass with an ES
  phase to the HLSL path: its exchanges met at plain group barriers, the
  pattern of #1727, while the HLSL path's exchange spins;
- the tests of the split exchange count the group barriers with sync and
  the spin's fences apart, cover mesh groups of 48 and 64 threads and the
  LDS layout, and a mesh pass with 16 heap windows on the HLSL path;
- comments say which exchanges still meet at a group barrier.

Software adapter, whole library suite on the branch: see the branch's last
commit; the tests that open the hardware GPU were not run.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
From the review of fb9e302 and e271679:

- a call into the driver that has not returned for 2 s parked every later
  submit of every thread with no time limit: a call that only waited for
  GPU progress which depended on a parked submit then never returned. The
  watch now only logs such a call (when it passes the limit, every 5 s,
  and when it has returned, with its real length); the title's command
  lists are held only while a stop for a driver error is being handled;
- the stop file is read on a thread of its own that calls nothing in the
  driver before the title ends, as bytes (empty, BOM, UTF-16 tolerated);
- the report names pipelines without starting a build and uses the DRED
  labels for graphics pipelines; pass-through DispatchMesh draws are in
  the ring; its lines say "recorded last";
- the memory line carries the video memory budget, so a reader can tell a
  report within the budget from one past it.

Software adapter, whole library suite on the branch: see the branch's last
commit; the tests that open the hardware GPU were not run.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
A lane may run 65 536 loop passes before LOOP_GUARD ends its loops, so
that console code looping on a count XCL gave it wrong does not keep the
GPU busy for minutes. That bound is per lane: the work it allows grows
with the dispatch, and a large dispatch outlasts the 2 s Windows waits
before it removes the device.

WindNew:CS_AdvectFromParentStep (a542b07e605c8fd7, 4 x 4 x 4 threads) is
dispatched as 16 x 16 x 16 groups and loops while a counter differs from
a count in title memory. Run alone on an RTX 3060 Ti with synthetic
inputs, the translated program takes 1.0 ms with a count of 0, 6.7 ms
with 64, 25 ms with 256 – and with a count that never comes 111 ms when
the loop is ended after 256 passes and 485 ms after 1024 (0.47 ms a
pass), which is 31 s for 65 536. That is the dispatch left open when the
device was removed (#1452).

A compute dispatch whose group counts are known now passes its share of
2^28 loop passes for one group in a free io slot (IO_LOOP_BUDGET), and
in a compute program every entry of a loop has its own count of passes:
that share among the group's threads, between 1024 and 65 536 a lane.
Up to 4096 lanes nothing changes; at 16 x 16 x 16 groups of 64 threads
one entry of a loop ends after 1024 passes. The lane's budget of 65 536
for all its loops stays, so loops inside one another are not cut to one
loop's share: only a loop that runs away on its own is ended early. A
slot of 0 (an indirect dispatch, the test runner) leaves 65 536, and
programs without a loop, other stages and the direct translator emit
what they did.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
(cherry picked from commit 4bad50562d)

Conflicts resolved in: crates/xcl/src/hle/d3d12x/bind.rs (bind_abi takes
the PR's groups argument and keeps the tree's heap_bound check; the
indirect path keeps skip_named_cs and indirect_guard::check and passes
None; translated_dispatch keeps skip_named_cs and the gpu_profile span
and passes Some([x, y, z])).
The direct DXIL translator's compute programs are to count each entry of
a loop against the dispatch's share, as the HLSL path does since the
previous commit. An inner loop's count has to start afresh each time the
loop is entered, and the translator lowers blocks one by one with no
idea of which loop holds which: Cfg only knows the loop headers.

cfg::loop_parents gives, for each loop header of the (reducible) Cfg, the
header of the loop directly around it, or none. A loop is its header and
every block that reaches one of its back edges (an edge into the header
from a block at or after it in the reverse post-order) without passing
the header; the loop around it is the smallest other loop that holds its
header. Nothing calls it yet.

Tested (software adapter, the tests are CFG-only):
  agentcargo.ps1 ... 'test','--release','-p','xcl','--lib','--',
  '--test-threads=4','loop_parents': 5 passed, 0 failed, 0 ignored
  (one loop, two in a row, a loop in a loop, three deep, two back edges
  to one header, an inner loop entered from two blocks, a loop whose
  header is the entry block).
Not run: the 54 tests that open the hardware GPU themselves.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The previous commits made the HLSL path's compute loops end an entry
after the dispatch's share of passes for a thread (IO_LOOP_BUDGET), so
that a large dispatch whose loop count never comes does not outlast the
time Windows gives the GPU before it resets the driver. Compute programs
run through the direct DXIL translator here, and it kept only the lane's
budget of 65 536 passes for all its loops, which a retail title's program
dispatched as 16 x 16 x 16 groups turns into about 31 s of GPU time.

The plain form of a compute program with a loop now loads the slot once
in the entry block and makes cap = slot == 0 ? 65 536 : clamp(slot /
threads per group, DISPATCH_LOOP_PASSES_MIN, 65 536), the HLSL path's
xcl_cap. Each loop header b has a variable VAR_LOOP_PASSES + b (1 << 30
and up: above the temporaries and the reload variables), set to cap at
the entry; a loop's head, before the lane's budget, leaves to the
program's end when its count is 0, else counts it down, and sets the
counts of the loops directly inside it (cfg::loop_parents) back to cap.
In a reducible CFG every path that enters a loop passes the head of the
loop around it, so that is a fresh count on every entry. A loop that
runs out ends the lane's program, where the HLSL path goes on after the
loop; both only end a loop that ran away. The lane's budget stays as it
was. Programs without a loop and every other entry emit what they did;
the compact form and the per-lane form keep the lane's budget alone.

Tested (software adapter):
  agentcargo.ps1 ... 'test','--release','-p','xcl','--lib','--',
  '--test-threads=4','direct_compute_loops_count_each_entry': 1 passed
  (ran: one load of the slot and two decrements for one loop; for the
  loop entered three times one count set at the entry and the inner one
  set back on the outer head's path – the test fails with the reset
  taken out; a loop-free compute program and a kernel with the loop have
  neither; wave32 and split wave64)
  ... 'gpu::dxil::': 158 passed, 0 failed, 3 ignored
  ... 'gpu::recomp::': 373 passed, 0 failed, 18 ignored
Not run: gpu_direct_compute_loop_passes_follow_the_dispatch (65 536,
5000, 1024 and 65 536 passes for the four shares, three entries of 1024
under a share of 1024, a 1025th pass ending the program, wave32 and split
wave64) printed SKIPPED (no wave32 on the software adapter); and the 54
tests that open the hardware GPU themselves.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A switch to compare with the loop bound of before: with
XCL_DISPATCH_LOOP_BUDGET=0 (read once, recomp::dispatch_loop_budget_wanted)
a direct dispatch (bind.rs) and a dispatch of a console command list
(console_list.rs) leave IO_LOOP_BUDGET at 0, the value an indirect
dispatch already passes. Both translators then give every loop of a
compute program the lane's 65 536 passes, as before the dispatch's share
(the translated code is the same: only the slot changes). The README's
list of switches says so.

Tested (software adapter, the whole library suite on this commit):
  agentcargo.ps1 ... 'test','--release','-p','xcl','--lib','--',
  '--test-threads=4': 1350 passed, 0 failed, 24 ignored; 179 GPU tests
  of those passed printed SKIPPED (no wave32 / wave64 on the software
  adapter), among them gpu_compute_loop_passes_follow_the_dispatch and
  gpu_direct_compute_loop_passes_follow_the_dispatch
  ... 'hle::d3d12x::': 350 passed, 0 failed, 1 ignored
Not run: the 54 tests that open the hardware GPU themselves; the switch
itself on a title (it changes only what the runtime writes to the slot).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
dispatch_loop_budget_wanted only decides what a dispatch writes to
IO_LOOP_BUDGET, but it sat in gpu/recomp/mod.rs, which build.rs hashes
into XCL_TRANSLATOR_SOURCE_ID; the direct translator's cache identity is
built on that ID too. So any later edit of the switch, even of its doc
comment, would throw away every translated shader of both translators
while no translated code changed. It now lives in hle/d3d12x/bind.rs
(pub(super)), beside bind_abi, its one caller there, and
console_list.rs calls it through super::bind. Behaviour is unchanged.
This commit itself changes recomp/mod.rs once more (the removal), so
the translator source ID changes with it, as it already did in this
series (the picked upstream commit edits mod.rs and emit.rs; the direct
translator's commit d9a247b changes XCL_DIRECT_DXIL_SOURCE_ID, which
its message did not say): every cached translation of both translators
is made again once.

Tested on the software adapter, release, the tree with all of this
series' follow-up commits (agentcargo.ps1 -Key w5pages):
  'test','--release','-p','xcl','--lib','--','--test-threads=4',
  'hle::d3d12x::': 350 passed, 0 failed, 1 ignored
  ... the whole library suite: 1352 passed, 0 failed, 24 ignored;
  179 GPU tests of those passed printed SKIPPED (no wave32 / wave64)
Not run: the 54 tests that open the hardware GPU themselves; the switch
on a title.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The switch's line said every loop of a translated compute program ends
an entry after its dispatch's share. Not so for an ExecuteIndirect
dispatch (its group counts are in a GPU buffer: the slot stays 0), for
the direct translator's compact form (20 000 instructions and more) and
for XCL_PER_LANE, which keep only the thread's 65 536 passes; and the
direct translator ends the thread's program where the HLSL path only
ends the loop. Someone comparing with XCL_DISPATCH_LOOP_BUDGET=0 could
take a runaway loop on one of those paths for a bug in the bound.

Docs only; no test. Not run: anything on the hardware GPU.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
loop_parents_of_a_loop_with_two_back_edges only half guarded what it is
named for: the inner loop lay on the path of the back edge that comes
first in the header's preds, so a body built from that edge alone
(find instead of filter) still held it and the test passed; its comment
also named the wrong edge. Now each of the two back edges (3 -> 1,
5 -> 1) has an inner loop of its own (2, 4), so dropping either edge
leaves one inner loop outermost. Checked: with the body taken from the
first back edge only, the test fails (and passes again without).

loop_parents_of_a_split_loop adds the one shape make_reducible actually
splits (a loop entered in the middle): loop_parents on the final graph
gives the single loop at 3, with no parent.

cfg.rs is hashed into XCL_DIRECT_DXIL_SOURCE_ID with its tests, so this
commit makes the direct translator's cache entries again once.

Tested on the software adapter, release (agentcargo.ps1 -Key w5pages):
  'test','--release','-p','xcl','--lib','--','--test-threads=4','loop':
  42 passed, 0 failed, 0 ignored (all six loop_parents_* tests ran)
  ... 'gpu::dxil::': 159 passed, 0 failed, 3 ignored
  ... the whole library suite: 1352 passed, 0 failed, 24 ignored;
  179 GPU tests of those passed printed SKIPPED (no wave32 / wave64)
Not run: the 54 tests that open the hardware GPU themselves.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
direct_compute_loops_count_each_entry is the only test of the direct
translator's per-entry loop counts that runs off the hardware (the GPU
test prints SKIPPED there). It counted the slot's load, the decrements
and the count phis, but never that a count of 0 leaves the loop: a
check that branched the wrong way would still pass it. Now, for the
one loop and for both loops of the nested program, the count phi feeds
an icmp eq ..., 0 whose br i1 takes the block that returns.

Checked: with the count's branch inverted (cond_br(none, cont, end))
the test fails at the new assertion, and passes again without. (Taking
the branch out altogether already failed the old test: the count is
then dead and leaves the module with the cap's computation, so
loop_counts finds no extractvalue of the load.)

Tested on the software adapter, release (agentcargo.ps1 -Key w5pages):
  'test','--release','-p','xcl','--lib','--','--test-threads=4',
  'gpu::dxil::': 159 passed, 0 failed, 3 ignored;
  direct_compute_loops_count_each_entry ran (no SKIPPED), wave32 and
  split wave64; gpu_direct_compute_loop_passes_follow_the_dispatch
  printed SKIPPED (no wave32)
  ... the whole library suite: 1352 passed, 0 failed, 24 ignored;
  179 GPU tests of those passed printed SKIPPED (no wave32 / wave64)
Not run: the 54 tests that open the hardware GPU themselves.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
No test that runs without a GPU compiled the HLSL path's new loop
counts (xcl_gb, xcl_cap, uint xcl_n<k> = xcl_cap;):
gpu_compute_loop_passes_follow_the_dispatch returns before its DXC
compile when no GPU is ready. compute_loop_counts_compile compiles
endless_loop_program and endless_loop_entered_three_times as compute
programs, wave32 and wave64, with cs_6_6 whenever DXC is there
(SKIPPED "no DXC" otherwise, as the file's other DXC checks gate).

Tested on the software adapter, release (agentcargo.ps1 -Key w5pages):
  'test','--release','-p','xcl','--lib','--','--test-threads=4',
  'gpu::recomp::': 374 passed, 0 failed, 18 ignored;
  compute_loop_counts_compile ran (no SKIPPED)
  ... the whole library suite: 1352 passed, 0 failed, 24 ignored;
  179 GPU tests of those passed printed SKIPPED (no wave32 / wave64)
Not run: the 54 tests that open the hardware GPU themselves.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Upstream pull request #2291 (its commit cherry-picked, author kept) gives
every entry of a loop in a compute program its own count of passes: the
dispatch's share of 2^28 passes for a thread group among the group's
threads, between 1024 and 65 536. The lane's budget of 65 536 for all its
loops is per lane, so the GPU time it allows grows with the dispatch: a
retail title's program of 4 x 4 x 4 threads dispatched as 16 x 16 x 16
groups with a loop count that never comes was measured upstream at about
31 s on a mid-range GPU, past the time Windows gives a GPU before it
resets the driver.

That commit covers the HLSL path. Compute programs here run through the
direct DXIL translator, so its plain form gets the same bound: the loop
directly around each loop of the CFG (cfg::loop_parents), a count for
each loop set at the program's entry and set back at the head of the loop
around it, from the same io slot. A loop that runs out ends the thread's
program there. ExecuteIndirect dispatches, the compact form and the
per-lane form keep the lane's budget alone.
XCL_DISPATCH_LOOP_BUDGET=0 leaves the slot empty: as before.

Software adapter, whole library suite on the branch: 1352 passed, 0
failed, 24 ignored; 54 tests that open the hardware GPU not run; the GPU
tests of the bound (gpu_direct_compute_loop_passes_follow_the_dispatch,
gpu_compute_loop_passes_follow_the_dispatch) printed SKIPPED there and
have not run on this tree.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Conflicts:
- gpu/recomp/runner.rs (dispatch_with): every memory window u2..u5 is
  bound to mem as before, and the chain's scratch buffer is made after
  them; record_dispatch_chain or Dispatch runs as upstream has it.
- hle/d3d12x/bind.rs, execute_indirect: upstream's switch to the whole
  pipeline of a split program runs after bind_abi, before the ei_work
  RAN note; when the whole pipeline cannot be built the dispatch is
  noted SKIPPED in ei_work as well as counted.
- hle/d3d12x/bind.rs, translated_dispatch: named programs are still
  skipped, bind_abi still gets the group counts (the loop budget's io
  slot), and one gpu_profile span (one watch ring note) is around the
  whole dispatch_chain::dispatch; the span is closed before its error
  is returned.
- hle/d3d12x/console_list.rs: the same span around
  dispatch_chain::dispatch, closed before an error is returned.
- hle/d3d12x/pso_async.rs, submit_as: the lanes of the backlog
  (push(p, known), ahead_cap) are kept; a sent pipeline goes to the
  workers through upstream's enqueue.
- hle/d3d12x/pso_async.rs, resolve_spared: send_spared is kept (the
  spared lane of the backlog).
- hle/d3d12x/real.rs, forget_pso: dispatch_chain::forget is added
  before the sharded TRANSLATED_COMPUTE.remove.
- hle/d3d12x/real.rs, compute pipeline creation: upstream's
  compute_container returns (hr, time, reused) and the caller finishes
  the pipeline. The huge-program refusal log, the DRED label,
  PSO_USER_SGPRS (in its sharded form), PSO_SHADERS and the GPU
  profile's note_compute are in the caller, and the chain path records
  the same PSO_USER_SGPRS, PSO_SHADERS and profile note for its first
  piece.
- hle/d3d12x/title_list.rs: both sides' tests are kept.

Changed after the textual merge:
- pso_async.rs send_spared: its fallback without a backlog sent an
  Arc<Pending> to the worker queue, which now takes closures; it goes
  through enqueue.
- real.rs: upstream's chain path wrote PSO_USER_SGPRS through the old
  Mutex<Option<HashMap>> form; it uses the sharded map's insert.

Tested (software adapter, release; the tests that open the hardware
GPU themselves are not run by the test wrapper):
- check -p xcl --tests: builds, no new warnings
- test --lib gpu::dxil::     168 passed, 0 failed, 3 ignored
- test --lib gpu::recomp::   374 passed, 0 failed, 18 ignored
- test --lib hle::d3d12x::   352 passed, 0 failed, 1 ignored
- test --lib dispatch_chain  8 passed, 0 failed; 7 of them printed
  SKIPPED (no wave32 GPU / no wave64) before their GPU part
- test --lib title_list      5 passed, 0 failed
- test --lib (whole library) 1363 passed, 0 failed, 24 ignored;
  186 tests printed SKIPPED
Not run: the 54 tests that open the hardware GPU themselves, every
GPU part of the dispatch chain tests, a retail title, smoke runs.

Not settled here: a single split wave64 compute group sets up the
spin exchange's xcl_xc counters (and uses group-shared atomics when it
exchanges), which split_compute refuses, so such a program is never
split and stays whole. The wave64 cases of
dispatch_chain_wave64_live_loops_and_exchange,
dispatch_chain_oversized_loop_matches_whole and
dispatch_chain_divergent_forward_edges_3d expect a chain and would
fail on a GPU with wave32 support.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
After the merge of upstream's dispatch chains, a single split wave64 of a
compute group (64 threads, two hardware wave32 halves) meets its other half
through group-shared counters its entry zeroes (Partner::Spin, #1741), and the
exchange's running number (VAR_XK) counts from the program's start. A later
piece of a chain is a new dispatch: its prefix zeroes the counters again, so
its first exchange waits for a count they never reach, stalls for 2^20 polls
and then reads 0 for the other half. split_compute refused every such program
only by accident (the xcl_xc global, the atomics and the TGSM fences), and
upstream's wave64 chain tests still expected a chain: on a GPU with wave32
they panic at chain.expect(...).

- kernel.rs finish_dispatch: a program with a split thread id and the spin
  exchange is not given to split_compute at all; it is built whole as before
  (optimize + finish_optimized, the same output as try_finish), with a log
  line when it is above XCL_DIRECT_SPLIT_INSTRUCTIONS saying why.
- split.rs tests: compare() and dispatch_chain_divergent_forward_edges_3d now
  build and check the program on the CPU before the wave32 skip. At 64 threads
  they assert that split_compute keeps the program whole and run only the
  whole program on the GPU; at 32 threads they still require a chain of at
  least 3 pieces and compare it with the whole one. On the merged tree the
  64-thread case fails on the software adapter this way (chain None where the
  test expected a chain). compare()'s loop blocks register their edges with
  the translator's SSA (lw.block / lw.br / lw.cond_br): the spin exchange
  reads VAR_XK / VAR_XDEAD through it, and with raw blocks the 64-thread whole
  program failed validation (a PHI with no entries).
- kernel.rs test a_split_wave64_compute_program_stays_whole: a 64-thread
  split program with exchanges before and after 40 cuttable blocks goes
  through finish_dispatch with a piece limit and comes out whole and valid.

Tested (agentcargo wrapper, software adapter, release):
  test --release -p xcl --lib -- --test-threads=4 gpu::dxil::
  169 passed, 0 failed, 3 ignored. The CPU halves of the chain tests ran;
  their GPU halves printed SKIPPED (no wave32 GPU): dispatch_chain_wave32_live_loops,
  dispatch_chain_wave64_live_loops_and_exchange, dispatch_chain_oversized_loop_matches_whole,
  dispatch_chain_divergent_forward_edges_3d, dispatch_chain_payload_*.
Not run: the 54 tests that open the hardware GPU themselves (the wrapper skips
them); no GPU run of the whole 64-thread fixtures.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
build_pieces (upstream's dispatch chains) sent up to compile_threads()-1
helper jobs to queue(), the workers that build what a bind waits for, from
whatever thread called it. When the caller is a backlog worker building a
compute pipeline ahead of its first use (the "new compute, one at a time"
lane, or a spared image-only build), those helpers ran its piece driver
compiles at normal priority on the bind workers, and a pipeline a bind then
sent with enqueue waited behind the pieces of one nobody uses yet. That is
what the backlog lanes exist to prevent, and it also broke the lane's one at
a time rule.

A backlog worker's build that nobody waits for (Demand: preload_thread set,
no waiters) now drains every piece on its own thread. A build a title's
thread waits for, a bind worker's build and a title thread's own build fan
out as before.

Test: pso_async::used_tests::a_build_ahead_keeps_its_pieces_on_its_own_thread
(six 20 ms pieces under a backlog build nobody waits for all run on the
caller). Without the change it fails: [0, 0, 0, 0, 0, 1].

Tested (agentcargo wrapper, software adapter, release):
  test --release -p xcl --lib -- --test-threads=4 pso_async
  30 passed, 0 failed, 0 ignored.
Not run: the 54 tests that open the hardware GPU themselves; no title run.
Not changed: helpers still lose JOB_START / JOB_HUGE / PRELOAD_STEP, and a
title thread's own build gives its helpers no "wanted" status (review notes).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
build_pieces collects one result per piece from a channel. When a piece job
panicked on a helper (a bind worker of queue()), that worker thread died
without sending its result; the caller's own drain still holds a Sender, so
recv().iter().take(count) never ended: a title thread building the program
hung for ever and the pool lost a worker for good. On the caller's thread the
panic went up through the whole build.

Each piece now runs under catch_unwind; a panic gives 0 (a failed piece), so
dispatch_chain::build gets every result, sees the failure and the program is
built whole as for any other failed piece.

Test: pso_async::used_tests::a_piece_that_panics_fails_and_the_others_are_built
(eight pieces, every second one panics, on the caller or on helpers: the
results are [1, 0, 3, 0, 5, 0, 7, 0]).

Tested (agentcargo wrapper, software adapter, release):
  test --release -p xcl --lib -- --test-threads=4 pso_async
  31 passed, 0 failed, 0 ignored.
Not run: the 54 tests that open the hardware GPU themselves; no title run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Upstream's chain set its tail pieces (record_dispatch_chain), the whole form
of a split program in a Dispatch fallback, and the whole form before an
ExecuteIndirect with list.SetPipelineState on the title's list. On a list XCL
adopted that call reaches XCL's own hook (cl_set_pipeline_state), which this
branch keeps for the title's calls: bind_abi binds a dispatch's compute
pipeline past it with list_x::set_compute_pipeline. Through the hook each
piece:
- became list_x's bound pipeline, so a Wait64 mid-list split or KickoffX
  started the next segment with the last tail piece as its first pipeline;
- pushed a DRED marker (XCL_DRED=1) with no label (only the first piece is
  labelled), so a fault in piece 2..n or in the whole form was reported as
  "a stand-in, or not translated" instead of the program.

record_dispatch_chain now takes the setter. dispatch_chain::dispatch binds
pieces and the whole form past the hook on an adopted list, and with the
plain call on a list XCL did not adopt; execute_indirect binds the whole form
with list_x::set_compute_pipeline. The test runner keeps the plain call.
With the hook out of the way the tail pieces need no DRED labels: the marker
of the title's own SetPipelineState names the program for the whole chain.

No test fails without this: seeing it needs an adopted list with a chain of
real pipelines recorded on it, and the software adapter cannot create the
pieces (WaveSize 32).

Tested (agentcargo wrapper, software adapter, release):
  test --release -p xcl --lib -- --test-threads=4 dispatch_chain
  8 passed, 0 failed, 0 ignored (the GPU halves printed SKIPPED, no wave32 GPU).
  test --release -p xcl --lib -- --test-threads=4 hle::d3d12x::
  354 passed, 0 failed, 1 ignored.
Not run: the 54 tests that open the hardware GPU themselves; no title run,
no DRED run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A split compute program's whole (unsplit) form is built on first need in the
calling thread: the first ExecuteIndirect of the program, a Dispatch in a
bundle, one with no backing allocator, or one whose scratch is too large or
cannot be made. That is a driver compile of a program above
XCL_DIRECT_SPLIT_INSTRUCTIONS, the size class splitting exists for, on one of
the title's threads, outside pso_async: no Held, so title_held() stayed false
and kernelx Sleep and the frame clock counted the seconds against the title.

Chain::whole now runs its build (and the wait for another thread's build of
the same form) inside pso_async::pc_call(), the guard every other long PC call
of the title uses, so the title is held while it lasts.

Left as it was: the whole form is still built synchronously and outside the
compute pipeline wait budget (XCL_CS_PSO_WAIT_MS); building it on the PSO
workers when the chain is built and skipping the ExecuteIndirect while it
builds is a larger change.

No test fails without this: it needs a chain of real pipelines, which the
software adapter cannot create (WaveSize 32).

Tested (agentcargo wrapper, software adapter, release):
  test --release -p xcl --lib -- --test-threads=4 dispatch_chain
  8 passed, 0 failed, 0 ignored (the GPU halves printed SKIPPED, no wave32 GPU).
Not run: the 54 tests that open the hardware GPU themselves; no title run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
translated_compute_pso_once logs a huge compute program the driver refuses
(record, DXIL size, driver cache name, HRESULT, time in the driver), because
note_translation_error alone does not reach the log. Upstream's chain builds
its pieces and the whole form through compute_container directly, so a
refused huge piece or whole form left no such line: a refused whole form
before an ExecuteIndirect logged only "ExecuteIndirect whole compute PSO:
whole compute pipeline".

PipelineBuilder::pipeline now logs the same warning for a program of
huge_pso_bytes() or more. Logging only: no test.

Tested (agentcargo wrapper, software adapter, release):
  test --release -p xcl --lib -- --test-threads=4 dispatch_chain
  8 passed, 0 failed, 0 ignored (the GPU halves printed SKIPPED, no wave32 GPU).
Not run: the 54 tests that open the hardware GPU themselves; no title run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Every chained Dispatch of upstream's split programs creates its own committed
scratch buffer (DEFAULT heap, zero-filled), of groups x dwords_per_group x 4
bytes, and keeps it until its allocator is reset or released. dwords_per_group
is the stride (1 + the words of every value live across any cut) times the
group's threads, so a 16x16x16 grid of 32-thread groups takes stride x 512 KiB;
at stride 100 that is 50 MB for one dispatch, and the only limit was 4 GiB per
dispatch. Fifty such dispatches a frame with three frames in flight would hold
about 7.5 GB.

The bytes every not yet released chained dispatch holds are now counted
(SCRATCH_HELD: taken before the buffer is made, given back when it cannot be
made and when its Recording is dropped at the allocator's Reset or Release).
A dispatch that would take them past XCL_DIRECT_SPLIT_SCRATCH_MB (default
1024 MiB) runs the whole program instead, as one whose scratch could not be
made, with a log line (the first four, then powers of two). The periodic
"compute split" line also gives the MiB held. README: the variable.

Left as it was: one buffer per dispatch, zero-filled, made on the title's
thread. Keeping one buffer per recording, grown to the largest size asked,
needs a key per recording (two recordings on one allocator may run at once)
and is a larger change.

Test: dispatch_chain::tests::scratch_is_taken_up_to_its_cap (the budget takes
what fits, refuses what would pass the cap without taking anything, takes
again what was given back, and does not overflow).

Tested (agentcargo wrapper, software adapter, release):
  test --release -p xcl --lib -- --test-threads=4 dispatch_chain
  9 passed, 0 failed, 0 ignored (the GPU halves printed SKIPPED, no wave32 GPU).
Not run: the 54 tests that open the hardware GPU themselves; no title run, so
the default cap was not measured against a title's real use.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The xcl-split-counts thread starts in every run and logged "compute split: 0
programs split, ..." every 10 s, also in runs that split nothing. Each line
also takes the log lock from a thread end_title suspends with the others.
log_counts now writes its line only when a count (or the scratch held) has
changed since the last one. Logging only: no test.

Tested (agentcargo wrapper, software adapter, release):
  test --release -p xcl --lib -- --test-threads=4 dispatch_chain
  9 passed, 0 failed, 0 ignored (the GPU halves printed SKIPPED, no wave32 GPU).
Not run: the 54 tests that open the hardware GPU themselves; no title run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
class_for asks an adopted object for its most derived interface and
releases the result with the Release of the object it asked. Without the
debug layer both are the same object. With it (XCL_D3D12_DEBUG=1)
QueryInterface gives another object, and the first object's Release on it
read a null pointer in D3D12Core 1.5 s into a retail title's start: the
debug layer could not be used on that title at all.

The result is released through the vtable it has itself.

Tested: a retail title with XCL_D3D12_DEBUG=1 on an NVIDIA RTX 5090
(driver 621.14): before, an access violation in D3D12Core at 1.46 s; after,
442 s with the layer's messages in the log. No unit test: the path needs
the debug layer's wrapping objects.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
On the PC a command list must not be executed again before its previous
execution is done (debug layer id 553). A console lets a title do it, and
a retail title submits the same recording again about once a second in
its world. XCL only noted it (note_resubmits). In a run on an NVIDIA RTX
5090 that had done it 128 times the device was removed with shader memory
faults (nvlddmkm: "Graphics SM Warp Exception: MMU Fault", 0x887a0006)
2 min 40 s into the world, with DRED inside an ExecuteIndirect of a small
compute program that reads nothing by an address of its own. A run of the
same build with the debug layer on, which slows the submits enough that
no list was ever submitted again while still on the GPU, ended after
442 s without a fault. That is one run each: the link is not proven.

A submit now waits for the previous submits of its lists that the GPU has
not finished, 2 s at most for all of them (XCL_RESUBMIT_WAIT_MS; 0: as
before), polling XCL's own fence of that submit; past the limit the lists
go as they are, logged.

Tested: cargo test --release -p xcl --lib alloc_pool on the software
adapter: 8 passed, 0 failed (new: a_resubmit_waits_for_the_previous_submit:
the limit ends a wait for a submit that never finishes, no limit means no
wait, a submit that finishes ends the wait). Not run on a title yet.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The PC takes at most 65 535 thread groups a dimension in a Dispatch; with
more its behaviour is not defined (the debug layer's warning id 1296). A
retail title dispatches 82 606 x 1 x 1 groups in its world every frame,
which reached the PC call as it was. The first eight such dispatches are
logged with the console compute program, so that the program is known
before such a dispatch is run in parts.

No behaviour change. Not tested beyond the build.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Upstream's 13 commits are merged with the fork's dispatch path (the skip
of named programs, the loop budget's io slot, one profile span and one
ring note for a whole chain), its backlog lanes and its sharded maps.

A single split wave64 of a compute group exchanges through counters in
group-shared memory here; each piece of a chain would zero them again
while the exchange's running number counts from the program's start, so
such programs are kept whole, explicitly. Chains apply to programs of
32 threads a group. Pieces of a build ahead stay on its own worker, a
piece whose build panics fails instead of hanging its caller, the pieces
and the whole form are bound past the list hook, and the scratch chained
dispatches hold together is capped (XCL_DIRECT_SPLIT_SCRATCH_MB).

Software adapter, whole library suite on the branch: 1367 passed, 0
failed, 24 ignored; 54 tests that open the hardware GPU not run. The
chain tests' GPU parts printed SKIPPED there.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
XCL_TRACE_FRAME logs one line for each distinct (VS, PS, render target)
drawn, 160 at most. A busy frame of a retail title fills those with its
first passes within a second, and the passes looked for (the ones that
draw into its lighting target) never got a line.
XCL_TRACE_FORMATS=26,29 (DXGI format numbers) leaves out the draws into
targets of other formats.

Diagnostic only. Tested on a retail title on an NVIDIA RTX 5090: with
XCL_TRACE_FORMATS=26 the trace listed 61 kinds, 35 of them the
stencil-tested passes into the 2560x1440 lighting target.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
A title's menus fill XCL_TRACE_FRAME's list of draw kinds long before its
world draws, so the kinds looked for (the geometry pass into the colour
target) never got a line.

- XCL_TRACE_AFTER_S=<seconds>: no kind is listed before that time of the
  run; each kind listed then also gets its root arguments, and the view
  heaps are counted once at that point.
- XCL_TRACE_SLOTS=<n>: the first n slots of each table instead of 4, all
  eight words of their image descriptors, the image they describe, the
  slot's own index in the shared heap and the resource the T#'s index
  names there (console_heap::named_by_index): a T# the title copied as
  memory carries its source slot's index.
- XCL_TRACE_PROBES=<n>: n texture probes instead of 4; a probe reads every
  level of the first slice, not level 0 only (a streamed texture has only
  its small levels at first).
- XCL_DUMP_SHADERS=ps,<hash>: the dump of only those stages or shaders.

Diagnostics only, all behind their switches. Tested: the dump list's test
(software adapter: 4 passed with the trace tests). On a retail title
(NVIDIA RTX 5090) the trace with XCL_TRACE_SLOTS=8 printed the image and
index of the UI draws' slots. NOT exercised in a run: the probe of every
level and the kinds after XCL_TRACE_AFTER_S (the four runs ended before
the world: three in the driver with frame dumps every 120 presents on,
one in a texture upload that read a page the title had just unmapped).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Twelve files conflicted. What was decided where the two sides did the
same job:

- Split dispatches: upstream's slabs and bounded scratch (e9ddf17,
  0829441) replace the fork's XCL_DIRECT_SPLIT_SCRATCH_MB cap; the fork
  keeps binding each piece past the list hook, one profile span and one
  ring note a chain, the skip of named programs and the loop budget slot.
  A single split wave64 with a counter exchange still stays whole;
  upstream's 64-thread slab case of
  dispatch_chain_divergent_forward_edges_3d is the assertion that it does.
- DirectStorage: upstream's page lists at execution (bb27ed6) with the
  fork's log line.
- Stand-ins (625a0f3): the fork's stands_in is the resolver's
  gave_standin. The shared driver pipeline now goes through the fork's
  late release when its last shell goes (a queued list may still bind it),
  and an ExecuteIndirect of a shell whose compute build failed is skipped
  again (the registered pipeline is the shell, the resolved one the shared
  driver pipeline).
- XCL_TEXTURE_LEVEL_PAGES=1 (3ea5edc): a level that is zero when its pages
  are decided and written before the copy reads it lost its texels and
  kept their hashes; such an item's hashes are forgotten.
- a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier
  (254a058) counts the fork's exchange form: one group sync, the two
  fences of one counter exchange, and no barrier of another mode.

Known and left: upstream widened the compact form (040e46d, e964ad2); a
compact compute program has only the lane budget for its loops, not the
per-entry bound of a large dispatch.

Tested on the merged tree. Software adapter, whole library suite: 1388
passed, 0 failed, 24 ignored; 55 tests that open the hardware GPU not
run there. NVIDIA RTX 5090 (driver 621.14), whole library suite with
XCL_DIRECT_DXIL=1 before the last review fixes: 1435 passed, 4 failed
(gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3, which fail the same
way before the merge), 27 ignored, no driver error.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Console programs keep constant tables after s_endpgm and read them
PC-relative (s_getpc_b64 + s_load_dword* / global_load_dword*). The
translation gave s_getpc_b64 the program offset with high dword 0, so in
a title these loads read memory window 0 at a low offset: zeros. 676 of
the 26503 shader records of a retail title use this, among them all
postfx_aces LUT bakes, whose 64-cube output LUT came out as one constant
texel, so the presented image was flat.

The data blocks after the program (xbox::Fssm::rodata, the new
Options::rodata) now go with the translation:

- HLSL: emit.rs embeds them as `static const uint xcl_rodata[]`, and
  s_load and FLAT / GLOBAL dword loads go through xcl_gload*, which take
  the dwords at a code address inside a block from the table. With
  several memory windows s_getpc_b64's high dword is CODE_ADDRESS_HI
  (0xC0DE, above any user-space address), so a code address is told from
  the title's memory at the same low dword; with one window it is the
  program's offset as before.
- Direct DXIL: the same, as an internal constant array of the module
  (Lw::rodata_loads in lower_window.rs); with windows s_buffer_load reads
  it too. kernel::translate_entry_rodata carries the data. The per-lane
  form (XCL_PER_LANE) has no table and leaves such programs to the
  per-instruction form. TRANSLATOR_VERSION 9 -> 10.
- pso.rs passes the data on the compute, VS / PS and mesh paths (HLSL
  and direct), and `xcl shaders` (precompile, direct sweep) does too.

Not covered: byte / short global loads, MUBUF buffer_load, the legacy
GS path and the per-lane form still read memory at such addresses.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 980eb78bd71077d43056e1d78387d5cce21d1989)
DXC workers otherwise contend on the process heap during parallel cache fills. Give each thread-local compiler a serialized private heap through DxcCreateInstance2, with a compatibility fallback, and add a read-only wrapper for filling the DXIL cache.

Measured on this machine: 19.3-19.5 effective compiler cores with private heaps versus about 2.3 with the shared process heap.

Part of #156.

Assisted-by: Codex (GPT-5)
(cherry picked from commit 760f742b42)
The console runs up to 2^32 - 1 thread groups a dimension; D3D12 takes
65 535, and past that a dispatch is undefined. On an NVIDIA RTX 5060 Ti a
retail game's world loading hung the GPU (DXGI_ERROR_DEVICE_HUNG,
0x887A0006) about 100 s in, every run: the only unfinished work was an
ExecuteIndirect of one loop-free compute program (found with the dispatch
markers of #1323), and its arguments, written by an earlier dispatch, were
72 512 x 1 x 1 and 75 072 x 1 x 1 groups.

A dispatch of more than 65 535 groups in X with 1 in Y now runs as
65 535 x ceil(n / 65 535) groups. The console's count goes into a new io
word (IO_GROUP_LIMIT, in the trap-temp range like IO_UMA_BASE_HI; 0 when
not folded), and every translated compute program takes
gid.x + gid.y * 65 535 as its group in X when the word is set, its Y as 0,
and returns at once in the groups at or past the count. A dispatch that
cannot be folded (two dimensions past the limit) is clamped and logged.

- Dispatch and console-recorded dispatches: the counts are known on the CPU
  (bind::fold, also in console_list).
- ExecuteIndirect of one dispatch: the counts are only on the GPU. A
  one-thread pass (clamp.rs) reads them, writes the counts to dispatch into
  a slot of XCL's buffer and the console's count into the dispatch's io
  (folding only when the rows stay within 65 535, as bind::fold does),
  then the dispatch reads its arguments from the slot. bind_abi now returns
  what it bound so the binding can be set again after the pass.

The translated compute HLSL changes (a few lines in the prelude), so
cached translations and DXIL of compute programs are made again once.

New tests: a folded dispatch runs each console group once and none past
its count (GPU; fails without the change from group 65 535 on), the
indirect pass folds / clamps / leaves counts as they are (GPU), and the
folding rule (unit). runner::device() gives tests the runner's device: a
test making its own device first left the Agility SDK unappliable and the
GPU tests after it skipped.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 280164a748)
`bind` and `clamp` fold a dispatch of more than 65 535 groups in X into Y for
every translated compute pipeline, but only the HLSL path took its group in X
back from both ids (`IO_GROUP_LIMIT`). The direct translator (`gpu::dxil`,
`compute_init`) and its per-lane form (`recomp::lower`) now do the same: the
group in X from both ids, Y 0, and the groups past the console's count leave
at once (a gate before the program; the per-lane form's skip block).

The folded-dispatch GPU test runs all three: HLSL, direct (wave32, wave64,
split wave64) and per-lane; the native wave64 forms only on a GPU that runs
wave64.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 7dbd80c275)
A worker's compiler was made through DxcCreateInstance2 with a private
heap, and only E_INVALIDARG fell back to plain DxcCreateInstance. Any
other HRESULT (E_NOINTERFACE, REGDB_E_CLASSNOTREG from a different DXC
build), S_OK without an object, or a HeapCreate failure under commit
pressure failed the compile, and every later job on that worker failed
the same way, where the shared process heap had compiled it. Now any
failure of the private path warns once with the reason and makes the
compiler on the process heap; only a failure there too is an error.

The private heap is also no longer destroyed with its allocator. Before
the private heaps all DXC memory came from one heap, so a block DXC
keeps past its compiler (lazily made global state, freed later through
another compiler) could not dangle. With HeapDestroy on the last
release it would, for a thread that exits (the tests' scoped threads do).
Pool workers never exit, so in the runtime the heaps already lived until
the process ends; this costs nothing there.

Tested (release, software adapter): new tests show the fallback for
three failing DxcCreateInstance2 results, that a block outlives its
allocator, and that a private-heap compiler gives byte-identical DXIL
to a process-heap compiler for the same pixel shader. Whole library
suite run on this commit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Three follow-ups to the port of the dispatch fold (fe650b6):

- The ExecuteIndirect group clamp records ResourceBarrier calls, which
  a bundle cannot hold. It now runs only on a direct or compute list XCL
  keeps state for, the same test indirect_guard::check uses; a bundle
  keeps the plain path, as before the port.
- The gpu_profile span of a folded Dispatch recorded the folded grid
  (65535x2x1 for 82606x1x1), which hid that the dispatch was past the
  limit. Both translated_dispatch and the console list's dispatch now
  give the span the console's counts and pass the folded grid only to
  dispatch_chain::dispatch.
- A dispatch fold() can only clamp was warned about twice in
  translated_dispatch: by fold() and by the fork's own line. That path
  now uses fold_counts (fold without its log line) and keeps the fork's
  line, which names the cs id, reworded to say the count was clamped.
  fold() logs as before for its other callers.

Fork notes on the cherry-picks below this commit, whose upstream
messages are kept: 41f1a85 sets TRANSLATOR_VERSION 10 -> 11 (its message
says 9 -> 10) and adds kernel::translate_compute_rodata; fe650b6 puts the
group limit in io slot 114 (113 is IO_LOOP_BUDGET), lets the clamp read
the indirect guard's output slot (Checked::arguments / read), and sets
the clamp's and the rebind's pipelines past the SetPipelineState hook.

Tested: cargo check -p xcl --tests, and the whole xcl library suite in
release on the software adapter (the hardware-GPU tests not run).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The direct translator's TRANSLATOR_VERSION is 11 here (the fork was at 10
already, upstream's commit moves 9 to 10). The group limit of a folded
dispatch takes io slot 114; 113 is the fork's loop budget. The
ExecuteIndirect clamp runs on direct and compute lists only (a bundle
cannot hold its barriers).

Software adapter, whole library suite on the branch: 1393 passed, 0
failed, 24 ignored; 56 tests that open the hardware GPU not run.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
On top of the upstream commit: any failure of the private-heap path falls
back to DxcCreateInstance, and a worker's heap is never destroyed (a block
DXC keeps past its compiler must not dangle).

Software adapter, whole library suite on the branch: 1394 passed, 0
failed, 24 ignored; 55 tests that open the hardware GPU not run.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
No log line said which buffer a draw's depth-stencil view names: the
target dump logs only the depth buffer bound most in a frame, and the
per-draw frame trace lines came from direct draws only, so ExecuteIndirect
draws never got one. Before a stencil plane written through a UAV can be
fed to the draws that test it, a run has to show which buffer those draws
bind and whether indirect draws test the same target.

XCL_TRACE_FRAME only:
- state_summary resolves the bound DSV through the handle map that
  XCL_DUMP_TARGETS keeps and appends " names <resource> <w>x<h> PC format
  <f> flags <resource flags>" after the DSV handle.
- CreateDepthStencilView logs the first 64 views of depth buffers at least
  1920 wide with the resource's PC format, the view format passed to the
  PC and the view flags (1 read-only depth, 2 read-only stencil).
- The translated graphics path of ExecuteIndirect traces its draw as a
  direct draw does, so indirect draws get their "draws vs ... ps ... into"
  line.

Logging only, no test: the existing assertion on state_summary's text
keeps passing (the text is only appended to). cargo check -p xcl --tests
is clean of new warnings; the list_x, bind and real tests: 132 passed,
0 failed, 0 ignored (56 tests that open the hardware GPU not run).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The queue's CopyPageMappingsBatchX names pool addresses, and on the
console a physical page stays mapped at every address the title mapped
it at. XCL keeps a page's bytes in one place: Away::at holds an address
only while the bytes are kept there, and when the title maps the same
page at a second address XCL moves the bytes and move_away drops the
first address - which is the pool address the method names. So the
method could not tell which page a pool address holds.

Away gains title: address -> the page the title mapped there last.
map_pages clears an address's entry first and writes it only once the
page is in place (at home, after a move, at the lazy insert, at the
final insert); a failed map leaves none. FreeTitlePhysicalPages drops
the entries of the freed pages with one retain (page numbers are never
handed out again); the release of a sparse, view-window or graphics
reservation forgets the entries inside it. Bookkeeping only: nothing
reads it yet, no behaviour change.

Tested: cargo check -p xcl --tests (no new warnings);
cargo test --release -p xcl --lib hle::kernelx: 52 passed, 0 failed, 1 ignored, including
the new an_address_keeps_the_page_the_title_mapped_there_last.

Builds on xcl-dev/xcl#1055 by Xeltax (f532d33d69): Away::title,
forget_title_mappings and their insert points, with the fixes made there
after review (write after placement, clear on free, forget on release).
Not taken: Away::freed (the entries of freed pages are removed instead).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The queue's CopyPageMappingsBatchX (#29 of the older layout, #31 in the
newer one) maps pages of the title's pool into GPU views; it is a stub
here. Its arguments are decoded apart from what is done with them, so
the record that follows takes a checked list.

mirrors::decode_batches turns one call into (GPU-view page, pool page or
None for unmapped) in the call's order: batches of 24 bytes (first
destination, number of ranges, pointer to them), ranges of three u32
(kind 0: consecutive pool pages, 1: one pool page repeated, 2: unmapped,
3: left as they are; start; count). The whole call is checked before
anything is returned: an unreadable batch or range, a range leaving the
pool, an unknown kind or more than 1 << 20 pages refuse it. No lock.
Not called yet; mirrors::PAGE names the 64 KiB page.

Tested: cargo check -p xcl --tests (no new warnings);
cargo test --release -p xcl --lib hle::kernelx: 53 passed, 0 failed, 1 ignored, including
the new the_page_mapping_batches_are_decoded_whole.

Builds on xcl-dev/xcl#1055 by Xeltax (f532d33d69): the decoding, its
checks, the Batch test helper and the cases of the test.
Builds on xcl-dev/xcl#2308 by adiologydev (31fe59c037): the decoding
split from the record. The batch layout is a fact #1055 cites; no code
from elsewhere.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The queue's CopyPageMappingsBatchX copies the mapping of a pool page
into a page of a GPU view: from the call on, the view page shows the
physical page the title had mapped at that pool address. XCL keeps a
page's bytes in one place, often not the pool address (the title maps
most streamed pages into the CPU view behind the GPU view too), so the
record keeps, for each view page the method names, the physical page
and where XCL keeps its bytes now.

mirrors::apply_batches decodes a call (decode_batches), resolves each
pool address through Away::title to its page and the page's place
(the address it is mapped at away from home, else its home), and
records it with AWAY held from the lookup to the record, so a page that
moves in between cannot be recorded at the place it left. The record
has a lock of its own (PAGES, an RwLock; STATE -> PAGES where both are
held, readers take PAGES alone): what each page shows (physical page,
place, whether a tile may show the place - unified memory, a graphics
reservation or a home -, the call that last changed it, its log key),
physical page -> view pages, place -> view pages, the 16 MiB blocks of
the places and a log of the last change of each page. A pool page with
no page mapped and an unmapped page show nothing; the same mapping
named again changes nothing. mirrors::released drops the pages of the
views that go. Readers: shows (NoView, Same, Page, Nothing), resolve
(an address per 64 KiB page and four counts), touched, any_mapped,
calls - each one atomic load while nothing is recorded. Still not
called by the runtime: no behaviour change.

Tested: cargo check -p xcl --tests (no new warnings);
cargo test --release -p xcl --lib hle::kernelx: 54 passed, 0 failed, 1 ignored, including
the new gpu_view_pages_record_the_physical_page_mapped_into_them (a
call made after the page moved into the CPU view, the unchanged mapping
named again, a remap, the tile flag of a page kept in plain memory, the
release of the view).

Builds on xcl-dev/xcl#1055 by Xeltax (f532d33d69): the recorded
physical page, Mapped, the record step with its in-view check, the
released hunk and the cases of its tests.
Builds on xcl-dev/xcl#2308 by adiologydev (64ad64ce6b): a pool page
with nothing mapped shows nothing and is counted.
Fork: the place kept eagerly (in place of page_now, which locks AWAY),
the lock of its own, the tile flag.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The console lets shaders write a depth buffer through a UAV
(ALLOW_DEPTH_STENCIL | ALLOW_UNORDERED_ACCESS). The PC refuses the pair,
so pc_resource_desc keeps the depth buffer and every UAV of it is a null
view: what a compute program stores there, such as the stencil codes the
lighting draws test, is lost. Giving those UAVs a texture of their own
needs to know, from the view and the DSV, which buffer they name and in
which PC state it was made. This commit only keeps that, behind
XCL_DEPTH_UAV_TWIN=1; with the switch off (the default) nothing is
registered and every hook stops at one atomic load.

New module depth_uav:
- the switch (enabled, on: "0" off, "1" on, else the default, off);
- note_created at the creation paths with the PC state of the call that
  succeeded: CreatePlacedResourceX's three texture returns (with the
  title address), CreateCommittedResource, the PC's way of
  CreatePlacedResource and its memory of its own (0 after its retry). A
  single-sample 2D buffer with flags 6 and PC format 19/39/44/53 is kept;
  objects at one title address and shape share a Cell (on the PC they
  share texels), a buffer without a title address is a Cell of its own;
- note_dsv at CreateDepthStencilView, and DSV descriptor copies
  (CopyDescriptorsSimple, CopyDescriptors range by range) followed: the
  destination names what the source names, or nothing;
- forget at the last release: the object leaves its Cell, the last one
  takes the Cell with it. Returns at once when nothing is registered.
vram::canonical_va becomes pub(super) for the key.

Tests: the_switch_reads_0_and_1,
only_depth_buffers_that_allow_unordered_access_are_kept,
depth_buffers_at_one_title_address_share_a_cell_until_the_last_is_released,
a_copied_dsv_names_what_its_source_names (no GPU).
cargo check -p xcl --tests: no new warnings. cargo test --release -p xcl --lib on the software adapter, the depth_uav, real, device_x and vram tests: 108 passed, 0 failed, 0 ignored (56 tests that open the hardware GPU not run).

Builds on xcl-dev/xcl#1989 by raylitebull (51ee197c)
Builds on xcl-dev/xcl#1063 by IvyNotFound (21aa52cc)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A depth buffer the console lets shaders write keeps no ALLOW_UNORDERED_ACCESS
on the PC, so every UAV of it was a null view: a compute program that
stores stencil codes through it writes nothing, and the draws that test
the stencil plane see zeros. Behind XCL_DEPTH_UAV_TWIN=1 (off by default:
then nothing changes but the log lines), a UAV that names the stencil
plane of a kept two-plane depth buffer (plane slice 1, or a stencil or
8-bit view format) is now made on a twin of the plane: an R8_TYPELESS
texture of the buffer's size with unordered access, resting in
UNORDERED_ACCESS, made at the first such UAV through
real::dev_create_committed_resource (adopted, never in title memory) and
kept with the buffer's Cell until its last object is released.

dev_create_uav_x reads the resource description once and asks
depth_uav::resolve_uav with the title's view as it came. For a twin it
calls dev_create_uav_checked_x on the twin with the title's view on
plane 0 in R8_UINT (or the R8 UNORM / SNORM / SINT class asked for), so
the PC UAV, the published name, the companion SRV and the T# (GFX10
format 5, uint) come by the ordinary path of a texture with unordered
access. A UAV of the depth plane, of a buffer XCL did not see created,
or with the switch off stays a null view, counted with its reason.
Nothing copies between the twin and the plane yet.

Log lines: "depth UAV twins are off (XCL_DEPTH_UAV_TWIN)" once; each twin
made (first 8, then powers of two); "a UAV of a depth buffer stays a null
view (<why>): <n> so far" (first 4, then powers of two), in place of the
old warning for depth buffers.

Tests: a_view_names_the_stencil_plane_by_format_or_plane_slice,
the_twins_view_keeps_the_slices_and_the_r8_class_asked_for (no GPU);
gpu_a_stencil_uav_of_a_console_depth_buffer_is_a_view_of_its_twin on WARP
in a child process with the switch and the shared view heap: a 16x16
console D24S8 buffer with flags 6 made through
CreateCommittedResource, its DSV, two stencil UAVs and a depth UAV made
through the device calls; one twin, R8_TYPELESS with unordered access
and no title address; both stencil slots name it for UAV and SRV with an
R8_UINT T#; the depth slot is a null view counted with its reason; the
DSV is known; the twin goes with the buffer.
cargo check -p xcl --tests: no new warnings. cargo test --release -p xcl
--lib on the software adapter, the depth_uav, real, device_x and vram
tests: 111 passed, 0 failed, 0 ignored (56 tests that open the hardware
GPU not run).

Builds on xcl-dev/xcl#1989 by raylitebull (51ee197c)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The record of the queue's page-mapping method keeps, for each GPU-view
page it named, where XCL keeps the shown physical page's bytes. XCL
moves those bytes whenever the title maps the page at another address
or unmaps it (one place per page), so the place has to follow, on the
moving thread and before the memory the page leaves can go: otherwise a
reader of the record (and, later, a tile linked to the place) reads an
address that was decommitted under it.

mirrors::page_at(page, at, tile) moves the place of every GPU-view page
that shows the physical page (the reverse index by_page), with by_at
and the 16 MiB block counts; its call and its place in the log stay - a
move is no change of what the page shows - unless the page gets its
first place or loses it (its bytes appear or go). One atomic load while
nothing is recorded, and a read-locked lookup before the write lock.
mirrors::page_freed(page): the pages that showed a freed page show
nothing (a change). kernelx::page_placed calls page_at with the tile
flag (a home, unified memory or a graphics reservation) and notes a
moved page as a known write at its new address
(title_textures::note_known_write): a CPU write made just before the
move went with the page. Called, with AWAY held: in move_away after the
copy and before release_at, in unmap_away in both branches (before the
release), in map_pages at the lazy insert, after the copy from home
(before move_home_away can give the home back) and in the zero branch;
FreeTitlePhysicalPages calls page_freed for every page of the call.
Still not reached by the runtime: the record stays empty until the
queue method is turned on.

Tested: cargo check -p xcl --tests (no new warnings);
cargo test --release -p xcl --lib hle::kernelx: 55 passed, 0 failed, 1 ignored, including
the new a_gpu_view_page_follows_its_physical_page (mapped elsewhere,
unmapped home with its bytes, mapped at the CPU view's same offset, a
page never used mapped elsewhere, a move keeping call and log entry,
freed pages showing nothing).

Builds on xcl-dev/xcl#1102 by Xeltax (c387de21fa): the reverse index
physical page -> GPU-view pages and its hook points (unmap_away,
FreeTitlePhysicalPages, map_pages).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
What the textures need from the record of the queue's page-mapping
method, ahead of their use: which GPU-view pages show something else
now, and which GPU-view pages a CPU write reaches.

mirrors::changes_since(seen, lo, hi, most) walks the record's log from
a reader's cursor: each GPU-view page in [lo, hi) whose content changed
(a mapping, an unmap, a free, a page that gets or loses its place),
once, with the call that changed it last, in the order of the last
change, at most `most`, and the next cursor. Nothing is drained, so each
reader keeps its own cursor; one atomic compare when nothing changed. A
move is not in it. The changes do not go through GPU_VIEW_MAP_LOG: a
change there bumps gpu_view_map_gen, which empties every recording
thread's ask cache at every call of the method, and its 4096 entries
overflow into a recheck of every texture, each with a VirtualQuery.

mirrors::views_of_written(dirty, out): for each written 64 KiB page,
the written 4 KiB pages at every GPU-view page that shows the page kept
there (the place index by_at), and, for the CPU view of a pair, at the
GPU-view page of the same offset when the method never named that page
(it shows the CPU view, and keeps today's write tracking); a mapped or
unmapped GPU-view page gets nothing from the CPU view under it. One
STATE take to copy the pairs, then one PAGES read. shown_blocks (the
16 MiB blocks that hold a place), shown_gen and moved_pages. Not called
yet.

Tested: cargo check -p xcl --tests (no new warnings);
cargo test --release -p xcl --lib hle::kernelx: 57 passed, 0 failed, 1 ignored, including
the new changed_gpu_view_pages_are_told_once_in_order (a call of three
pages, a remap told again last with its new call, a move told not at
all, a page changed twice told once, one at a time, the range, a
released view) and
a_write_where_a_page_is_kept_is_a_write_to_the_views_showing_it (one
page at two view pages, nothing at the address it left, the CPU view
under a page never named, mapped or unmapped, the blocks).

Builds on xcl-dev/xcl#1102 by Xeltax (c387de21fa): the idea of a list
of changed pages that the textures read.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
With the fold of over-limit dispatches (upstream PR #1428) a retail
title's first world frames ended in a device removal on an NVIDIA GPU:
0x887A0006 eight seconds after the indirect clamp pass first ran, the
driver's breadcrumbs inside a Dispatch. A run of the same build with
XCL_CLAMP_INDIRECT=0 had none. Arguments that are not counts reach the
pass there (the log has 0 x 1 065 353 216 x 16, the bits of 1.0f), and
the pass and bind::fold turn such a count into work: 1 065 353 216 x 1
x 1 folds into 16 257 rows of 65 535 groups, 70 000 x 70 000 x 16 clamps
to 65 535 x 65 535 x 16. Before the fold the PC was handed the counts as
they were and ran nothing of them.

- bind::fold_counts_within: a dispatch that needs folding or clamping
  and would still run more groups in all than indirect_guard's bound
  (XCL_INDIRECT_MAX_GROUPS, 2^22; one row more for the fold's padding)
  gets no groups. Counts D3D12 takes pass as they are, whatever their
  product.
- clamp.rs: the pass applies the same bound on the GPU (a second root
  constant; the product of two counts fits 32 bits there), counts what
  it left out in its header and logs it.
- The pass is opt-in for now (XCL_CLAMP_INDIRECT=1): the bound closes
  the mechanism above, but no run of the title has shown yet that it was
  all of it.

Tests: a_dispatch_past_the_limit_with_more_groups_than_any_title_asks_for_is_left_out
(the CPU's decision), and the pass's GPU test with the new cases (2^22
folded; 2^22 + 65 536, 65 535^2, the bits of 1.0f and 70 000 x 70 000 x 16
left out; 70 000 x 70 000 x 0 as the CPU gives it). Software adapter,
filters fold, clamp, left_out, indirect: 29 passed. NVIDIA RTX 5090
(driver 621.14), filters indirect_group_counts, fold, clamp, left_out:
18 passed, 0 failed, the GPU test among them. Not run yet: the title with
the pass on.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Since the previous commit a stencil UAV of a depth buffer with unordered
access is a view of the buffer's R8 twin, but the title still clears it
with the depth buffer as the resource. The PC clear then gets a view and a
resource that differ, an invalid pair, and the twin keeps what it held.

list_x::clear_uav takes the GPU slot once, before uav_clear_handles. Behind
depth_uav::any() (one atomic load: no twin alive, nothing changes), it asks
depth_uav::clear_target with what the slot's UAV names in the shared heap
(console_heap::names_of; None when the slot has no place there):
- the view names a twin of the buffer: the PC clear gets the twin as its
  resource, counted as a clear of a twin;
- the slot is not in the shared heap, or the handles are PC handles: what
  the view names is not known, so the clear is not done, and counted;
- a null view, another resource, a buffer without a twin, or a resource
  XCL does not keep: as before.
The decision is a pure function (clear_choice) over the Cell's twins.
Console-recorded lists are not changed (a later commit).

Tests: the_resource_of_a_uav_clear_is_what_the_view_names (no GPU: twin
named, null view, another resource, slot outside the shared heap, buffer
without a twin, a buffer not kept); gpu_clear_uav_of_a_stencil_uav_clears_
the_twin on WARP in a child process with XCL_DEPTH_UAV_TWIN=1 and the shared
heap: a stencil UAV of a 16x16 console D24S8 buffer, then
clear_uav_uint_x with the slot's console handles and the depth buffer as
resource on an adopted list; one clear is counted on the twin and all 256
texels of the twin read back 0x5A. The child was also run directly: it
made twin #1 and printed no SKIPPED. The child-process launcher and the
device / heap / buffer / DSV setup of G1 became a shared fixture; G1's
assertions are unchanged.
cargo check -p xcl --tests: no new warnings. cargo test --release -p xcl
--lib on the software adapter: depth_uav 9 passed, list_x 29 passed,
real 80 passed, 0 failed, 0 ignored (56 tests that open the hardware GPU
not run).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A submit reads a tile's source with raw pointers under the sparse
state's lock (the scan and the copies). Today only a paired CPU view is
a source, and source_part tells sparse about the decommits and releases
of those alone. Once tiles show the pages the queue's page-mapping
method mapped, a source is wherever such a page is kept - the pool, a
home, any address the title mapped the page at - and a decommit there
that sparse does not hear of faults the next scan. Some of those
decommits did not go through source_going at all: give_back_homes, the
release of a block's home, the placeholder decommits.

source_part keeps the pair case as it is (SOURCES_GOING keeps meaning
paired CPU views) and, while any page is recorded
(mirrors::any_mapped), answers the whole range: sparse decides by its
own index of tile sources whether a tile shows it, so the cost while
pages are mapped is two takes of the SOURCES lock a decommit; one atomic
load more while nothing is. give_back_homes, the release of a home block
(sparse::free, unified memory or VirtualFree) and the two placeholder
decommits now go through source_going. A release of a graphics
reservation with size 0 passes the reservation's size (the pair case
gives the same range as before). When a graphics reservation or a
sparse reservation is released, the shown pages kept there have no place
from then on (mirrors::place_gone: they show nothing, a change of what
they show), and for a sparse one the tiles over it are forgotten while
pages are mapped. Still not reached by the runtime while the record is
empty.

Tested: cargo check -p xcl --tests (no new warnings);
cargo test --release -p xcl --lib hle::kernelx: 58 passed, 0 failed, 1 ignored, including
the new memory_under_a_shown_page_is_told_to_sparse_before_it_goes (a
thread-local hook, KEPT_GOING: the address a page leaves, told while
still committed; the home given back; the release of the home block;
the release of the pool leaving its page showing nothing). The two
existing tests of source_going pass unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Before any code copies a twin into its plane, one run has to show that the
compute program really stores stencil codes through the redirected UAV:
if the twin stays all zero, the store does not reach it (or is mistyped)
and the copies would only spread zeros over the plane.

Diagnostic, XCL_DUMP_TARGETS only, and nothing unless a twin is alive. In a
dumped frame, after the render targets, present.rs copies each twin
(depth_uav::twins_to_dump: tag "twin<n> <plane>", n as in the line that
said the twin was made) to a readback buffer on the present list, with a
barrier UNORDERED_ACCESS -> COPY_SOURCE before and back after. When the
dump is drained, such a tag goes to depth_uav::log_values instead of a
picture: the eight most frequent byte values with their counts, the number
of distinct values and the share of zero texels, counted row by row by the
footprint's row pitch. The Twin keeps its number for this.

Test: the_values_of_a_twin_are_counted_by_row_pitch (no GPU: row padding
is not counted, a short buffer counts the rows it has, the order is by
count and then by value, eight values at most, the zero share).
cargo check -p xcl --tests: no new warnings. cargo test --release -p xcl
--lib on the software adapter: depth_uav 10 passed, present 10 passed,
0 failed, 0 ignored; the whole library suite: 1408 passed, 0 failed,
24 ignored (56 tests that open the hardware GPU not run).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Three paths take a range of a GPU view to the CPU view behind it from its
first address alone: cpu_writes::write_now writes all its dwords from one
translated address, bind.rs draw_rects translates the vertex buffer's
start and adds the first vertex, and DirectStorage's cpu_range_in checks
only the first and the last byte. That is right while every page of a
GPU view shows the CPU view at the same offset. Once the queue's page
mappings put the pages of a view in other places, a range over two pages
kept apart would be read or written in the bytes of another page (the
case of issue #697: a buffer across two pages that are not side by side
read wrong when rebased to its first page).

view_want::cpu_run(va, len) gives the CPU address of a range only when
every later 64 KiB page lies right behind the first there, None when its
pages are kept apart or one lies outside the view. write_now writes a
range that is not one piece in two calls, split at the page boundary
(write_now_in takes the resolver, for the test); draw_rects translates
the range of its vertices and falls back to the caller's draw when it is
in pieces; cpu_range_in checks every page, so such a DirectStorage
destination or source is refused instead of written into another page.
Preparation: no behaviour change while every view page shows the same
offset (nothing maps pages into a view yet).

Tested: cargo check -p xcl --tests (no new warnings);
cargo test --release -p xcl --lib hle::d3d12x::view_want
hle::d3d12x::cpu_writes hle::dstorage hle::d3d12x::bind: 65 passed,
0 failed, 0 ignored, including the new
a_range_in_a_gpu_view_is_one_piece_only_while_its_pages_are and
a_write_over_pages_kept_apart_is_made_page_by_page; the existing
cpu_range test of DirectStorage passes unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The record of the queue's page-mapping method (kernelx::mirrors) says
what each GPU-view page shows; the tiles of the view windows still
showed the CPU view at the same offset, so a streamed page the title
mapped into its GPU view never reached the GPU there.

A tile now shows what the record says (tile_shows, behind
mirror_source_tile and cpu_of): the CPU view's tile for a page never
named, the place a mapped page is kept when a tile may show it there,
nothing for an unmapped page, one with no page or one kept where
kernelx does not see the memory go. cpu_of gives the place whatever its
tile flag (the CPU reads and writes any). With an empty record every
tile resolves as before.

When what a page shows changes, kernelx tells sparse::remapped (from
apply_batches for the pages whose entry changed, page_freed, place_gone,
and page_placed for a page that gets or loses its place); it queues the
tiles that were asked for (REMAPS, a lock of its own, no state's lock).
The next submit links them again (remap_mirrors, at most 4096, after the
finished copies back land and before map_mirrors): video memory over
the new place is cleared and filled from its committed pages ahead of
the older asks; a tile that shows nothing gives its video memory back
and stays asked for. A placed buffer's tile keeps its pool tile, cleared,
over no_source (64 KiB of XCL's own, reserved, never committed), because
the buffer maps its tiles once. take_asks leaves a tile that shows
nothing asked for (a later mapping finds it); buffer_tiles links one
over no_source. unlink_kept and park, the halves of unlink_mirror and
drop_mirror, keep the ask: forgetting it would empty every recording
thread's memory of its asks at every change. Still not reached by the
runtime: the record stays empty until the queue method is turned on.

Tested: cargo check -p xcl --tests (no new warnings);
cargo test --release -p xcl --lib hle::d3d12x::sparse hle::kernelx
hle::d3d12x::view_want: 111 passed, 0 failed, 2 ignored, on the
software adapter, including the new
a_tile_of_a_gpu_view_shows_the_page_mapped_there (a mapped, an
unmapped and an untouched tile; a later write to the pool page; a remap;
a page mapped where nothing was, with no new ask; an unmap; no ask
forgotten; a range over two pages kept apart is not one piece) and
a_buffer_over_a_remapped_tile_reads_the_new_page (remap on the same
pool tile, unmap to zeros, a buffer placed over an unmapped page shows
it once mapped). Two existing sparse tests skip there (no GPU).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The line that announces a depth UAV twin says which PC state the buffer
was made in, and the first run with the twins on reads it to learn that
state. It gave the state of the object the UAV was made on. A UAV made
by address (device #71) is made on XCL's own object for that memory,
which resource_at creates in COMMON, so the line read 0x0 for a buffer
the title made in another state.

resource_at now marks the objects it makes (depth_uav::by_address). A
Cell keeps the PC state of the first object a title's creation call
made, and the line gives that one; when the title made no object at
that address, it gives the state of the UAV's own object as before.
The copies that come later take the state of the DSV's object and are
not affected.

Tested: depth_uav::tests::the_state_a_buffer_was_made_in_is_that_of_the_titles_object
(new, no GPU).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
ClearUnorderedAccessView* of a depth buffer whose Cell has a twin went
to the PC as it came when the slot's UAV in the shared heap named 0 or
GONE, taken as a null view. But 0 also means "not known": a descriptor
copy from a slot that has no place in the shared heap notes 0 while it
may copy the twin's view. The PC clear then got the depth buffer as its
resource with a view of the twin, the invalid pair the clear's rule is
there to avoid. Such a clear is now not done and counted, as one through
a slot outside the shared heap; a clear through a real null view does
nothing either.

The test of the decision now covers 0 and GONE, and the half that went
through clear_target, which stopped at the "no twin alive" gate before
its lookup, now gives a registered buffer a stand-in twin (a COM object
that only counts references), so the lookup, the Cell's twins and the
counters are reached: the twin named, not known, a buffer XCL does not
keep, a kept buffer without a twin.

Tested: depth_uav::tests::the_resource_of_a_uav_clear_is_what_the_view_names
(no GPU).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
XCL keeps a physical page's bytes in one place and moves them whenever
the title maps the page elsewhere or unmaps it; the record of the queue's
page mappings follows the page (mirrors::page_at), and the place it left
is decommitted or released right after. A tile linked over the old place
would then be given back and filled again at the new one, or, worse,
read memory that is going. A move is no remap: the bytes are the same.

sparse::moved(tiles, from, to, whole), called by kernelx::page_placed on
the moving thread with AWAY held and before the old place can go, takes
the state's lock only when a tile shows `from` (SOURCES), giving way to
submits. State::retarget moves the link of each tile linked over `from`:
with video memory and the page's 64 KiB copied (`whole`) the entry keeps
its pool tile, gen and sent hashes, and nothing is cleared or filled -
the known write kernelx notes at the new place brings its pages to the
next scan, which sends only what differs, and a copy back recorded
before the move lands at the new place. A page never used (not
committed at the new place) gives its video memory up and waits there
like any linked tile. A page that moves to a place no tile may show (plain
memory) is queued with remapped instead, and shows nothing from the next
submit; the old place is told to sparse when it goes. Counted in
page_tiles()[1]. Still not reached by the runtime while the record is
empty.

Tested: cargo check -p xcl --tests (no new warnings);
cargo test --release -p xcl --lib hle::d3d12x::sparse hle::kernelx:
108 passed, 0 failed, 2 ignored, on the software adapter, including the
new a_tile_follows_its_page_without_being_filled_again (pool tile, gen
and sent hashes kept, nothing cleared or filled, a tile linked elsewhere
left; the new place's pages scanned: nothing sent when equal, the chunk
written when not; a copy back recorded before the move lands at the new
place; a page never used gives its video memory up). Two existing sparse
tests skip there (no GPU).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A ClearUnorderedAccessView* recorded on a console-recorded list
(XCL_CONSOLE_LISTS) is replayed into the PC list when the list closes.
The replay passed the title's resource, the depth buffer, together with
the slot's PC UAV, which with XCL_DEPTH_UAV_TWIN=1 is a view of the
buffer's twin: the invalid view/resource pair the direct list's clear
no longer makes. The first run with the twins on would have met it on
such a list, and the twin would have kept stale values.

The direct list's rule moves into list_x::uav_clear_resource and the
replay uses it as well: the twin when the slot's view names it, nothing
(counted as skipped) when what the view names is not known. The plan
left this to a later commit; it is taken now because that run uses the
switch.

The GPU test of the clear also checks what the PC method receives: it
calls the console method on a stand-in of the list whose PC #49 notes
its resource and goes on to the list's own. Before, it counted XCL's
decision only, and the readback would pass with the depth buffer as the
resource too, because the clear goes through the slot's descriptor. A
clear through the buffer's depth-plane UAV, a null view, is not done
and reaches nothing.

Tested: real::depth_uav_twin_tests::gpu_clear_uav_of_a_stencil_uav_clears_the_twin
(WARP, child process; run on its own it made twin #1 and printed no
SKIPPED line). The replay itself is not driven by a test: a console
list closes only with unified memory open on a GPU.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The two GPU tests of depth UAV twins run again in a child process (the
switch and the shared heap are the process's). When the child cannot
run them (no unified memory, no WARP device), skip_test prints its
SKIPPED line on the child's stderr, which the parent dropped on
success: a whole-suite run counted the test as passed and showed no
skip, and AGENTS.md asks for skips to be reported. The parent now
copies the child's SKIPPED lines to its own stderr.

Tested: the depth_uav tests (11 passed, 0 failed); on WARP both children
ran and no SKIPPED line was printed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The tests of depth UAV twins made their buffer with CreateCommittedResource,
which on WARP gave a committed PC resource with no title address. The
path a console depth buffer most likely takes was not covered:
CreatePlacedResourceX at a title address (the registration hooks in
device_x::create_placed_resource_x, the key by vram::canonical_va) and a
stencil UAV made by address (device #71), which is made on XCL's own
object at that memory. Nor was it asserted in the library's process that
with the switch off nothing is registered and a UAV stays a null view.

- gpu_a_stencil_uav_by_address_is_a_view_of_the_placed_buffers_twin (WARP,
  child process): the title places a 16x16 D24S8 buffer with
  ALLOW_DEPTH_STENCIL | ALLOW_UNORDERED_ACCESS at an address in unified
  memory, in DEPTH_WRITE. It is kept under that address with that state;
  a #71 stencil UAV of the same memory, on a second object there, names
  the placed buffer's twin in the shared heap, and the state stays the
  title's. Run on its own, the buffer went to a video-memory arena, the
  view's object aliased it, and twin #1's line gave state 0x10.
- the_switch_decides_whether_a_buffer_is_kept_and_its_uavs_redirected
  (no GPU): note_created keeps the buffer only when the switch is on;
  off, resolve_uav gives a null view with the reason "XCL_DEPTH_UAV_TWIN
  is off".

Tested: the depth_uav tests, 13 passed, 0 failed, no SKIPPED line.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
state_summary took the resource a bound DSV names from present's handle
map as a plain address and called GetDesc on it after the map's lock
was released. A CreateDepthStencilView at the same handle on another
thread replaces the entry and releases the old resource, so the call
could read a destroyed object. It now takes the resource through
present::view_resource, which checks the map and adds a reference under
its lock.

The flags in that text are the resource's (ALLOW_DEPTH_STENCIL, 0x2 for
every depth buffer), so the line could not say whether the DSV is
read-only for stencil, which the first run is to answer. When depth_uav
keeps the DSV (XCL_DEPTH_UAV_TWIN=1, a buffer with unordered access) the
view's D3D12_DSV_FLAGS follow as ", view flags {f:#x}"; otherwise the
CreateDepthStencilView line of the same handle gives them.

Tested: logging only (XCL_TRACE_FRAME with XCL_DUMP_TARGETS); the
existing assertion on state_summary's text in list_x's tests keeps
passing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
ExecuteIndirect draws now go through trace_ui_draw, but their lines read
like a direct draw's, and the draw kinds are listed once per (vertex
shader, pixel shader, target shape): an indirect draw with the shaders
and target of a direct draw already listed got no line at all. The
first run is to tell whether indirect lighting draws exist against the
lighting target, so the two have to be told apart. The kind's key and
text now carry "(ExecuteIndirect)", and the UI draw line ", ExecuteIndirect".

The "… that draw: {args}" lines read DRAW_ARGS, which only the direct
draw paths set: for an indirect draw they gave the previous direct
draw's arguments on that thread as this draw's. They are left out for
indirect draws, whose arguments are in GPU memory.

Tested: logging only (XCL_TRACE_FRAME); the crate builds with the same
warnings as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A texture placed in a GPU view whose pages the queue's page mappings
named was read at the CPU view's same offset (or, with a page mapped at
the address itself, after a VirtualQuery there). The pages the title
mapped into the view are kept elsewhere: in the pool, at their home, or
wherever the title mapped them last.

Such a texture now keeps its own address as its source (Entry::paged,
found by mirrors::touched with no AWAY and no VirtualQuery) and every
upload carries a table of where its 64 KiB pages are kept
(texture_upload::PageMap, from mirrors::resolve once per due texture).
A read takes no lock: one ReadProcessMemory per 64 KiB piece for a
mapped page (copy_or_zeros: a physical page is committed whole or not
at all), zeros for a page that shows nothing, and today's read for a
page the method never named. The comparison of written pages, the
detile of the upload, the level-pages check, the frame trace sample and
the probe read through such a table; a paged texture counts as watched
for the streamed recheck and skips written_pages; a source in a view
window adds no coarse watch block. The kinds of the pages read are
counted (page_counts). A texture over pages the method never touched
takes today's calls unchanged.

Tested (cargo test --release -p xcl --lib, software adapter):
new texture_upload::tests::an_upload_reads_pages_kept_apart and
title_textures::tests::a_texture_over_mapped_pages_is_read_where_they_are_kept;
gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes gains a
texture registered over a page the queue's page mappings put in the
GPU view, which reads the pool page (ran on WARP). Modules
texture_upload and title_textures: 42 passed, 0 failed, 0 ignored.

Builds on xcl-dev/xcl#1102 by Xeltax (c387de21fa)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The first five steps of the plan for depth and stencil planes that
shaders write through UAVs, with the review's fixes: nothing changes
unless XCL_DEPTH_UAV_TWIN=1 is set, and nothing is copied between a twin
and its plane yet.

Software adapter, whole library suite on the branch: reported by its last
pass (see the commits); hardware suite not run on the branch.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
When the queue's page mappings put another page under a texture read
through its pages, nothing was written: no write watch fires for a
clean, already filled pool page that is newly mapped, so the texture
kept the bytes of the page that was there before.

recheck_gpu_view_sources now also reads the GPU-view pages whose
mapping changed (mirrors::changes_since, 512 a submit: one upload
batch; the rest at the next), with one atomic compare when nothing
changed. It does not go through GPU_VIEW_MAP_LOG: that bumps the
generation that empties every recording thread's ask cache, and its
log of 4096 entries overflows into a recheck of every texture. A
texture becomes paged when a page under it is first named (pending, as
on today's source changes). For a paged texture that is not pending
the changed pages' bytes are stale: texture_upload::stale joins them
into what goes up again, and the existing AGAIN path sends them with no
comparison; the page hashes come to what went up. A shadowed texture is
made pending instead.

The GPU's write of a texture is noted per PC list as it is recorded
(note_gpu_write gains the list) and stamped when the list is submitted
(Entry::written_call = mirrors::calls()). A mapping changed by a later
call clears gpu_written and sends its pages; one changed before the
submit leaves the texture the GPU's. A list submitted again is stamped
again; a reset list writes nothing more. Textures read again are
counted (rereads).

Tested (cargo test --release -p xcl --lib, software adapter): new
title_textures::tests::a_gpu_write_counts_from_the_submit_of_its_list;
gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes extended
with a clean pool page newly mapped, a remap to equal bytes, an unmap
and a mapping again (ran on WARP). Modules texture_upload and
title_textures: 43 passed, 0 failed, 0 ignored; list_x: 29 passed,
0 failed, 0 ignored.

Builds on xcl-dev/xcl#1102 by Xeltax (c387de21fa)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A texture read through its pages is found by its own range in the GPU
view, which no write watch covers: a CPU write to the pool, to the CPU
view the page moved into, a DirectStorage write by page number or
XCL's own copy at a move is reported at the place the page is kept,
and no texture lay under that address.

refresh_parts now adds the GPU-view pages a write reaches
(mirrors::views_of_written) to the dirty pages, after sparse had the
real ones: each written page of a place where a mapped page is kept at
every view page that shows it, and a page of a CPU view at the view
page the method never named above it. The existing selection then
finds the paged textures by their own range and compares those pages
through their table; only what differs goes up (a moved page costs a
compare). The watched ranges take the 16 MiB blocks where shown pages
are kept (mirrors::shown_blocks, with shown_gen in the cache key), so
the pool and the CPU view are watched wherever such a page lies. One
atomic load more a submit while nothing is mapped.

Tested (cargo test --release -p xcl --lib, software adapter): new
title_textures::tests::an_untouched_page_of_a_paged_texture_is_found_written;
gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes extended
with a CPU write to the pool page, a write just before the page moves
into the CPU view with no look in between, a write there after the
move, write_physical_pages by page number, and a submitted GPU write
that stays over a CPU write, gives way to a later mapping, after which
a CPU write goes up (ran on WARP). Modules texture_upload and
title_textures: 44 passed, 0 failed, 0 ignored.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Queue method #29 (#31 in the newer layout) is how a title maps the pages
its texture streaming fills into the GPU views its textures are in. It
was a stub: every mapping was dropped, a GPU-view page kept showing its
CPU view at the same offset, and streamed textures uploaded as zeros.

Its arm now goes to q_copy_page_mappings, which hands the call to
kernelx::mirrors::apply_batches (the record, the tiles, the textures and
the writes of the commits before this one) and sums what it did. A call
the decoder refuses records nothing and logs one warning. The result is
S_OK either way, as the stub's was. The fifth argument does not reach
queue_dispatch and is ignored. This is the only commit of the series
that changes what a title sees.

XCL_PAGE_MAPPINGS=0 (mirrors::page_mappings, parsed by the pure
page_mappings_on) leaves slot 29 to the stub and logs that once; the
record then stays empty and every new path is behind one atomic load.
README names the switch.

Tested: the_queue_page_mapping_method_records_and_can_be_switched_off
(new): a call over a pair of views of the test's own records a named
pool page with no page and an unmapped page as showing nothing, leaves an
untouched page on its CPU view, and returns S_OK; a call with a range of
an unknown kind records nothing and returns S_OK; the switch parses.
Modules queue_tests + hle::kernelx: 61 passed, 0 failed, 1 ignored
(release, software adapter).

Builds on xcl-dev/xcl#1055 by Xeltax (f532d33d69): the queue arm, the
totals and the warning text.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
title_bytes hands the detile the title's memory in place when all of it
is readable. A page the title unmaps while the detile reads it ends the
process: an access violation in Chain::detile_level under
title_textures::subresources, the page's history showing "page unmapped
(copied home)" 2 to 3 ms before. Seen in two runs with XCL_TRACE_FRAME=1,
whose slower submits widen the window; not seen without it so far.

The switch takes the copy (read_committed: through the kernel, zeros for
a page that is gone) for every read. It is slower and off by default; the
race itself is to be closed where the upload reads (in work on the page
mappings).

Tested on a retail title (NVIDIA RTX 5090): a run with XCL_TRACE_FRAME=1
and the switch on went 161 s into the world without the fault; the run
before it, without the switch, ended in it at 78 s. The existing test of
title_bytes (in place when all is readable) is unchanged.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
One info line at the first recorded call of CopyPageMappingsBatchX, at
powers of two and when 10 s have passed since the last one: the calls;
the GPU-view pages mapped, unmapped, named with a pool page that had no
page mapped there (must stay 0: above 0, Away::title misses a path by
which the title maps pages) and elsewhere; the view pages that moved
with their physical page; the textures read again for a mapping changed
under them and the pages of their uploads by where they were read; the
tiles shown anew and the tiles that followed their page. This is what a
run needs to tell whether the page mappings reach the textures and
tiles. Diagnostics only; the text comes from a pure function, and the
counters are atomics read with the totals' lock dropped.

Tested: the_page_mapping_line (new) checks the exact text. Module
queue_tests: 4 passed, 0 failed, 0 ignored (release, software adapter);
the run printed the line for the test's own call.

Builds on xcl-dev/xcl#1055 by Xeltax (f532d33d69): the first half of the
line. The count of pool pages with nothing mapped follows
xcl-dev/xcl#2308 by adiologydev (64ad64ce6b).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Three lines for the question a run could not answer: which depth buffer
a lighting draw tests, and whether shaders write it.

- A depth buffer with unordered access at least 1920 wide gets a line
  when it is kept: object, size, PC and console format, its title
  address (two buffers at one address are one memory on the console) and
  the PC state it was made in.
- A UAV of such a buffer gets a line with its view format and the plane
  it names.
- With XCL_TRACE_FORMATS the pipeline lines keep to pipelines that draw
  into a target of those formats: a title's menus made the first 400
  pipelines, so the ones of its world never got their depth and stencil
  state logged.

XCL_TRACE_FRAME only; nothing changes without it. bind::trace_formats is
the list both the draw kinds and the pipeline lines read.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
When a shown physical page moved, page_placed decided once for all its
GPU-view pages: linked again (sparse::remapped) when the page had no place
before or has none now, or is now kept where no tile may show it; else
the tiles follow it (sparse::moved) from the first old place found.

That missed a page moving from plain memory (tile flag false) to memory a
tile may show (a graphics reservation, unified memory, its home). While
it sat in plain memory its tiles showed nothing and were left unlinked
but still asked for. sparse::moved returns at once when no tile is linked
over the old place, and nothing queued a relink, so the tiles kept
showing nothing until some later mapping change touched those pages. The
single `from` also sent view pages with a different old place (none
after a release, say) to moved, which does nothing for them.

mirrors::page_at now returns each moved view page with its old place and
old tile flag. page_placed has the tiles follow only for the view pages
kept where a tile could show them, at the place they leave, when the new
place may be shown too; all others are linked again at the next submit.

Tested: new test
hle::kernelx::tests::a_page_leaving_plain_memory_has_the_tiles_over_it_linked_again
(a test hook records what page_placed passes to sparse: plain memory,
then a graphics reservation, then another, then home). Module
hle::kernelx: 59 passed, 0 failed, 1 ignored.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The release of a block of unified memory (the title's MEM_GRAPHICS
allocations) told sparse nothing while GPU views show mapped pages: it
called source_going with size 0, which source_part only answers for a
paired CPU view. Yet unified memory counts as memory whose release
kernelx sees (freeing_is_seen), so tiles are linked over pages kept
there, and physical pages can be mapped into such blocks. The record
kept the place and Away::title kept the mapping, so once the block was
handed out again the tiles and paged textures showed the new owner's
bytes, and a later queue call naming a pool address in the block
resolved to the old page.

The release now takes the block's size (Uma::block_len, new), forgets
the title's mappings in it, leaves the shown pages kept there without a
place (mirrors::place_gone), tells sparse of the whole block, and has
their tiles linked again – all before Uma::free hands the block back.

The release of a sparse-window reservation did place_gone after the
address space was given back: a submit in between could link a tile
over the released range, and one reserved and committed again meanwhile
would fill it with unrelated bytes. The record is cleared before the
release now; sparse forgets the tiles over it and relinks the asked
ones after, as before.

forget_title_mappings removes the entries of each page of a range when
the range has fewer pages than there are entries, instead of a pass
over all of them: it now runs on every release of a block of unified
memory.

Tested: new test
hle::kernelx::tests::the_release_of_unified_memory_under_a_shown_page_leaves_it_showing_nothing
(the whole block told to sparse while committed, the page shows
nothing, the title's mapping is forgotten). Module hle::kernelx: 60
passed, 0 failed, 1 ignored. The first run had two failures from the
existing a_page_whose_move_fails_stays_mapped_where_it_was, which
releases an address and expects nobody to reserve it again; a parallel
test reserved it. The rerun passed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
sparse::remapped appends every asked tile of every mapping change to
REMAPS, and each submit appends REMAPS to the state's queue, of which
remap_mirrors takes MIRROR_ASKS_MAX (4096) a submit and removes
duplicates only inside that batch. A view page changed at every frame,
or by several calls, was queued once per change: above 4096 changes a
submit the queue grew without bound and a tile waited behind stale
copies of itself.

take_remaps (new) joins the queue and, once it is longer than
MIRROR_ASKS_MAX, sorts it and keeps each tile once, so the backlog is
bounded by the tiles asked for. The order of a short queue is kept; a
long one goes in address order, which remap_mirrors used within its
batch already.

Tested: new test
hle::d3d12x::sparse::tests::a_tile_remapped_again_and_again_waits_once
(100 tiles changed at each of 100 submits never queue more than
MIRROR_ASKS_MAX + 100). Modules kernelx, sparse, cpu_writes, dstorage,
title_textures, texture_upload, view_want, list_x: 213 passed, 0
failed, 2 ignored (2 SKIPPED: no GPU, existing).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
XCL's own CPU writes for the GPU (immediate writes after a fence, the
64-bit readback copies and maxima) into a GPU-view page go where
view_want::cpu says. Since the tiles of a GPU view show the pages mapped
into them, that is the place of the mapped page, which can be its home.
A home in plain memory is not write-watched (the plan relies on XCL's
own writes there being known writes), so neither the tile nor the
textures over the page saw such a write. Before, the same write went to
the write-watched CPU view.

cpu_writes now tells such a write as XCL's own
(title_textures::note_known_write) when the address it was asked for
shows a mapped page and the write landed elsewhere: write_now (each
part of a split write), write_u64_now and max_u64_now. One atomic load
more while nothing is mapped; a write into a page never named is not
told, as before.

Tested: new test
hle::d3d12x::cpu_writes::tests::a_write_where_a_mapped_page_is_kept_is_a_known_write
(a write through a mapped GPU-view page lands at the page's home and is
a known write there; one through a page never named lands in the CPU
view and is not). Modules kernelx, sparse, cpu_writes, dstorage,
title_textures, texture_upload, view_want, list_x: 213 passed, 0
failed, 2 ignored.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
note_gpu_write noted every GPU-written texture per PC list (LIST_WRITES)
for the stamp that orders a GPU write against the queue's page mappings,
and submitted() then took LIST_WRITES and TEXTURES at every submit of
such a list – also with XCL_PAGE_MAPPINGS=0, where nothing reads the
stamp. That switch is to give back the path from before the page
mappings.

The writes are noted only while mirrors::page_mappings() is on; with it
off, submitted() returns early again when no transition is noted.

Tested: no new test (the switch is read once per process from the
environment). Modules kernelx, sparse, cpu_writes, dstorage,
title_textures, texture_upload, view_want, list_x: 213 passed, 0
failed, 2 ignored; a_gpu_write_counts_from_the_submit_of_its_list
covers the stamp with the switch on.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Four gaps in the tests of the queue's page mappings:

- gpu_view_pages_record_the_physical_page_mapped_into_them paired a CPU
  view of 43 pages, the size an existing sparse test pairs too. GPU
  views pair by size with the most recent unpaired CPU view, so the two
  could pair across each other when run in parallel. It takes 199 pages
  now, a size no other test uses.
- The kernelx and title_textures tests of this work returned silently
  without unified memory, so a skip looked like a pass. They call
  skip_test("no unified memory") now, as the sparse ones do.
- The step "equal bytes in the old and the new page" of
  gpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes could
  not tell an upload from none by its readback; it now also checks that
  the texture was read again for the mapping (title_textures::rereads).
- A range over GPU-view pages kept apart was refused only in a test
  that skips without reserved buffers. New no-GPU test
  hle::dstorage::tests::a_range_over_gpu_view_pages_kept_apart_is_refused:
  view_want::cpu_run over two pages kept apart is None, DirectStorage's
  cpu_range refuses a range across them, reaches a range inside one
  where its page is kept, and one over pages never named at the CPU
  view.

Tested: modules kernelx, sparse, cpu_writes, dstorage, title_textures,
texture_upload, view_want, list_x: 213 passed, 0 failed, 2 ignored;
the GPU test ran on the software adapter (not skipped).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A driver reset three seconds into a retail title's world left a report
that could not name the pass: DRED's count stood at a Dispatch whose
pipeline had no label ("a stand-in, or not translated"), and of the 25
operations the list had left only four pipeline labels were given. DRED's
count can lag behind the GPU, so the operation that faulted is any of
those not done.

- For a list the GPU was in, the report now gives the 16 operations before
  the first one not done and every one after it (160 at most) by name,
  XCL's markers as the label of the pipeline bound from there (dred::ops).
- A bound pipeline with no label of its own is named by what its stand-in
  is built from: the compute program's record, or the shader key of a
  graphics pipeline, and whether it is built (pso_async::describe).
- The DRED 1.2 device state is logged (hung, fault, page fault, or none),
  and a removal without breadcrumbs says so: two removals with reason
  0x887a0005 left no line at all about what was in flight.

Diagnostics only (XCL_DRED=1 for the labels). The test of the labels also
checks the new operation list.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
A retail title's world lost the device with reason 0x887A0005 (no driver
error, DRED state 0, no list in flight) at 23 to 26 GB of video memory
and 46 to 49 GB of process memory, on a PC whose other programs held
71 GB of commit under a 147 GB limit. The sum looked like the limit;
nothing in the log could say.

- The memory line ends with "system commit N of M MB", and a removal
  reports it too. Measured with it: 30.8 GB were left at the removal, and
  the system's commit follows the process's own memory, not its video
  memory - the commit limit is not what removes the device (it is the
  driver's 512 MiB range for the code of pipelines in use,
  xcl-dev/xcl#2403).
- A warning when less than 8 GB of commit are left (once, then at each
  halving): there allocations start to fail for every program.

Tests: the rule of the warning; the commit is known and under its limit.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Twenty commits: the fourteen of the plan (kernelx keeps the page the title
mapped at an address, decodes the method's batches, records which physical
page each GPU-view page shows and follows it when it moves; the tiles of a
GPU view and the textures over it show and read the pages mapped there;
queue method #29 / #31 does it, XCL_PAGE_MAPPINGS=0 for the stub) and six
from two reviews (a page that leaves plain memory has its tiles linked
again, a released block of unified memory leaves no shown page, the queue
of tiles to link again is bounded, XCL's own writes where a page is kept
are known writes, GPU writes are noted per list only while the mappings
are on, the tests own their pairs and report skips).

No conflicts with the depth-buffer registry, the fold bound, the safe
texture read or the trace and device-removal lines on world-main.

Left by the reviews, not fixed: a release runs forget_mirrors on the title
thread (a cost, to be measured); a free and a GPU write of the same call
number are ordered by the call, not by the change. The race of an upload
with the title unmapping the texture's pages is not closed here:
XCL_TEXTURE_SAFE_READ=1 stays the workaround.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
A run with XCL_TRACE_FRAME that also dumped frames or targets ended in an
access violation under present_now (d3d12.dll, GetDesc; earlier in the
driver, on the clone): busiest_rt read every address in USES, which keeps
addresses and no references, and a retail title's world releases transient
render targets all the time. This is what made trace runs need frame
dumps off.

- busiest_rt gives a reference, and only of a target an RTV still names
  (view_resource: the RTV map holds it); most bound first. Followed
  targets go through the same check.
- The DSV line says the depth buffer's title address (two buffers at one
  address are one memory on the console).
- XCL_TRACE_DSV_FORMATS=53,55: the trace also lists draws whose depth
  buffer (2560 wide or more) has one of those PC formats, and pipelines
  with one of them as DSV format: the passes that write or test a depth
  buffer without drawing into a target of XCL_TRACE_FORMATS. The cap on
  pipeline lines is 1500.

Measured with it on a retail title: the 30 pipelines of its lighting pass
draw with depth EQUAL, depth write off and no stencil against a D16
depth-stencil view (RTs R11G11B10_FLOAT and R32_UINT).

Diagnostics only; nothing changes without XCL_TRACE_FRAME.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
A retail title's world ended three times in a device removal with
DEVICE_HUNG (0x887A0006, an nvlddmkm 153, no time-out: two to six
seconds into the world). Each report had one list in flight, and its
first operation not done was the same one: after two barriers and a
pipeline marker, the Dispatch of the pass that rewrites the arguments of
an ExecuteIndirect(DispatchMesh) for its two passes (SCALE_ARGS_HLSL),
at the first such draw of that list.

That pass sets XCL's ABI root signature and then root views 0, 2 and 3;
view 4 (the count buffer) only when the title gave one, which this title
never does. The program declares u4 and reads it under a test of a
constant, so a driver may load from it ahead of the test - and on a list
where nothing set that slot before, the load is at GPU address 0. A read
of GPU address 0 on a graphics node is also what a kernel trace of this
removal showed on another card (xcl-dev/xcl#1452).

scale_views gives every view the program declares an address: without a
count buffer u4 names the constants.

Test: the views with and without a count buffer, none of them 0, and
the registers the program declares. Not shown yet: that the removal is
gone - it came in three of about twelve world starts.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
A diagnostic. An NVIDIA driver keeps the code of the pipelines in use in
512 MiB and removes the device past that (xcl-dev/xcl#2403); a retail
title's world got there 16 to 28 s in, before the passes a trace was
after had run. The biggest compute programs are most of that code:
XCL_SKIP_CS_KB=<n> gives a program with n KiB of DXIL or more no pipeline,
so its dispatches are skipped as those of a program whose build failed,
and a run lives longer at the price of what those programs draw.

Off unless set. Test: the size is in KiB and off unless a positive number.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The console compiler places a root signature's static samplers as S#
words built from constants in the code, and constant_samplers turns an
S# whose four words were all set that way into a static sampler. It
knew s_mov_b32, s_movk_i32 and s_mov_b64. A word with only high bits
set is written bit-reversed instead (`s_brev_b32 s66, 40` for
0x14000000, the filter word of a point sampler with a mip filter), so
such an S# was not recognised and its image instruction looked up the
sampler-heap entry that word 3 names – entry 0 for a constant S#, a
sampler the title made for something else.

In a seeded sample of 1244 programs of a retail title, 534 use a
sampler in 4951 instructions; 482 of those instructions, in 203
programs, have an S# that is constant but for one s_brev_b32 word.
They get their own static sampler now, in the HLSL and the direct
translator alike (both use constant_samplers).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
(cherry picked from commit 253bc79d0b)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:34:06 +00:00
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 23:28 UTC · original

Verification on RTX 3060 Ti (Windows 11): merge conflict with current main (many files, e.g. crates/xcl/src/gpu/recomp/pso.rs, crates/xcl/src/hle/d3d12x/real.rs, crates/xcl/src/shaders.rs) — needs a rebase before it can be tested.

**@⁠DavidM1911** on GitHub · 2026-11-25 23:28 UTC · [original](https://github.com/xcl-dev/xcl/pull/2572#issuecomment-7177618292) Verification on RTX 3060 Ti (Windows 11): **merge conflict with current `main`** (many files, e.g. `crates/xcl/src/gpu/recomp/pso.rs`, `crates/xcl/src/hle/d3d12x/real.rs`, `crates/xcl/src/shaders.rs`) — needs a rebase before it can be tested.
Author
Owner

@⁠KOLESNiii on GitHub · 2026-11-25 23:42 UTC · original

What is wanted for this?

**@⁠KOLESNiii** on GitHub · 2026-11-25 23:42 UTC · [original](https://github.com/xcl-dev/xcl/pull/2572#issuecomment-7177941553) What is wanted for this?
Author
Owner

@⁠pr1sm-dev on GitHub · 2026-11-25 23:48 UTC · original · edited 2026-11-26 00:05 UTC

Linux / RTX 3070 8 GB, nvidia-dev at c044dc6: a 600 s run crashed at 374.8 s in xcl::hle::xg::copy_from (xg.rs:713), the CopyFromSubresource crash of #662. The branch has none of its open fixes (#684, #976, #992, #1435). One run, so a data point; the head of this PR is one recompiler commit past c044dc6 and does not touch xg.rs.

Setup: RTX 3070 8 GB, NVIDIA 595.91.07 (Linux), Ryzen 7 5800X, 62 GB RAM; Wine 11.22 + vkd3d-proton master 30b0eb9b with #257's patch; x86_64-pc-windows-gnu release build of c044dc6, no local changes. The retail title, VKD3D_CONFIG=ignore_shared_fence,pipeline_library_log,no_descriptor_heap,retain_psos, XCL_SHORT_MOVIES=1, XCL_NETWORK=0, XCL_PSO_WAIT_MS unset, A / DOWN pressed by XCL_PRESS_AT; compute driver blobs mostly warm (129 compute pipelines from kept blobs, 36 built in the run).

What happened

  • No world: the screen captures (every 5 s up to 328 s) show loading art and dark frames. The three compute programs over 600 KB of DXIL built in the run took 120 s on average (215 s the longest); presents averaged 1–35 per 2 s over each 30 s from 90 s to the crash.
  • At 374.8 s: 0xc0000005, a write inside msvcrt memcpy on a title thread that records command lists, called from xcl::hle::xg::copy_from at xg.rs:713 (resolved from this build's debug info) – the 2D row loop, writing row_pitch apart.

#684 on top

  • #684 (e56dbc3) cherry-picks onto c044dc6 without conflicts and builds.
  • One run with it, same settings and length: no crash, but presents stopped at 375 s while the title's threads waited for compute pipelines still being built (the driver had just started on one of about 1 MB of DXIL with no blob yet). So that run does not show whether the copy was reached; it is not a confirmation of #684 here. @⁠spicbully-star's report on #662 (RDNA4, Windows) is the one that shows a #684-like change removing the crash.

Edit: with the switches from #2057 (XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_UMA_SHADOW=1 XCL_COHERENT_HEAPS=sparse:16 XCL_LOOK_SKIP=1, otherwise as above), c044dc6 ends at 43.8 s and 17.4 s in two runs: status 0x3 with a winevulkan ← d3d12core stack, in the traced run during a compute pipeline's driver compile that never finished. It has the signature of the Linux NVIDIA crash on #2229's constant tables (that program's SPIR-V holds such tables), though I have not shown it is the same cause on this branch; @⁠MacieGx's v2 of #2229 removes it on its own branch here (#2229), but does not cherry-pick onto this branch (conflicts in 3 files), so it would need his rebase or a merge here.

AI use: Claude Code (Claude Opus 5.5) made the runs and wrote this comment.

**@⁠pr1sm-dev** on GitHub · 2026-11-25 23:48 UTC · [original](https://github.com/xcl-dev/xcl/pull/2572#issuecomment-7178084101) · edited 2026-11-26 00:05 UTC **Linux / RTX 3070 8 GB, `nvidia-dev` at `c044dc6`: a 600 s run crashed at 374.8 s in `xcl::hle::xg::copy_from` (`xg.rs:713`), the `CopyFromSubresource` crash of #662. The branch has none of its open fixes (#684, #976, #992, #1435).** One run, so a data point; the head of this PR is one recompiler commit past `c044dc6` and does not touch `xg.rs`. **Setup:** RTX 3070 8 GB, NVIDIA 595.91.07 (Linux), Ryzen 7 5800X, 62 GB RAM; Wine 11.22 + vkd3d-proton master `30b0eb9b` with #257's patch; `x86_64-pc-windows-gnu` release build of `c044dc6`, no local changes. The retail title, `VKD3D_CONFIG=ignore_shared_fence,pipeline_library_log,no_descriptor_heap,retain_psos`, `XCL_SHORT_MOVIES=1`, `XCL_NETWORK=0`, `XCL_PSO_WAIT_MS` unset, A / DOWN pressed by `XCL_PRESS_AT`; compute driver blobs mostly warm (129 compute pipelines from kept blobs, 36 built in the run). **What happened** - No world: the screen captures (every 5 s up to 328 s) show loading art and dark frames. The three compute programs over 600 KB of DXIL built in the run took 120 s on average (215 s the longest); presents averaged 1–35 per 2 s over each 30 s from 90 s to the crash. - At 374.8 s: `0xc0000005`, a write inside `msvcrt` `memcpy` on a title thread that records command lists, called from `xcl::hle::xg::copy_from` at `xg.rs:713` (resolved from this build's debug info) – the 2D row loop, writing `row_pitch` apart. **#684 on top** - #684 (`e56dbc3`) cherry-picks onto `c044dc6` without conflicts and builds. - One run with it, same settings and length: no crash, but presents stopped at 375 s while the title's threads waited for compute pipelines still being built (the driver had just started on one of about 1 MB of DXIL with no blob yet). So that run does not show whether the copy was reached; it is not a confirmation of #684 here. @⁠spicbully-star's report on #662 (RDNA4, Windows) is the one that shows a #684-like change removing the crash. **Edit: with the switches from #2057** (`XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_UMA_SHADOW=1 XCL_COHERENT_HEAPS=sparse:16 XCL_LOOK_SKIP=1`, otherwise as above), `c044dc6` ends at 43.8 s and 17.4 s in two runs: status `0x3` with a `winevulkan` ← `d3d12core` stack, in the traced run during a compute pipeline's driver compile that never finished. It has the signature of the Linux NVIDIA crash on #2229's constant tables (that program's SPIR-V holds such tables), though I have not shown it is the same cause on this branch; @⁠MacieGx's v2 of #2229 removes it on its own branch here (https://git.gtahub.st/github/xcl-dev--xcl/pulls/2229), but does not cherry-pick onto this branch (conflicts in 3 files), so it would need his rebase or a merge here. AI use: Claude Code (Claude Opus 5.5) made the runs and wrote this comment.
Author
Owner

@⁠GodlyBDS on GitHub · 2026-11-26 02:30 UTC · original

RTX 3090 Ti / Windows 10 — two CPU blockers and repeatable ExecuteIndirect TDR

Tested release 22eb6f211dc1256c202e8df9dfaffff4211d61ba on RTX 3090 Ti 24 GB, driver 621.40, Windows 10 19045, Ryzen 9 5950X, 32 GiB RAM and DXC 1.8.2502.11. The patched runs used the 1 GiB app profile, four heap windows, direct DXIL, UMA shadows, DRED and unlimited PSO waits.

  1. The unmodified build reported that a valid host XCL_D3D12_DIR on another drive had no D3D12Core.dll, fell back to inbox D3D12, rejected root flags and exited at 7.594 s with the +0xb5a5f8 null-read signature from #598. Scoping Agility initialization to native host path resolution loaded SDK v620 and passed that point. The path-scope regression passed.
  2. The Agility-fixed build reached 74.398 s and faulted in xg::copy_from on a destination write. The failing call uses the extra argument before the source pointer, as in #662. Using the extra-argument wrapper and checked row copies from our local baseline cleared this failure. Five XG tests passed, including argument ordering and the unmapped destination case.
  3. With both compatibility fixes, two runs reached DXGI_ERROR_DEVICE_HUNG (0x887a0006) at ~86 and ~96 s. Both recorded nvlddmkm 153 and Display 4101. DRED reported 16 of 7,339 operations complete in the affected list. The first outstanding operation was ExecuteIndirect. In the run with DRED pipeline names, the label was VS d2a238740e50f037, PS e2bcc91e569d6d13. VA was 0, with no associated allocations. The second run reproduced the breadcrumb with the CPU D3D12 debug layer and targeted binding tracing enabled.

The same shader pair drew the UI earlier. The breadcrumb helps locate the execution failure, and more evidence is needed to identify the faulty resource or producer. No verified world geometry in either run.

AI use: OpenAI Codex (GPT-6) integrated the focused local backports, ran the tests, and analyzed the logs.

**@⁠GodlyBDS** on GitHub · 2026-11-26 02:30 UTC · [original](https://github.com/xcl-dev/xcl/pull/2572#issuecomment-7180865764) **RTX 3090 Ti / Windows 10 — two CPU blockers and repeatable ExecuteIndirect TDR** Tested release `22eb6f211dc1256c202e8df9dfaffff4211d61ba` on RTX 3090 Ti 24 GB, driver 621.40, Windows 10 19045, Ryzen 9 5950X, 32 GiB RAM and DXC 1.8.2502.11. The patched runs used the 1 GiB app profile, four heap windows, direct DXIL, UMA shadows, DRED and unlimited PSO waits. 1. The unmodified build reported that a valid host `XCL_D3D12_DIR` on another drive had no `D3D12Core.dll`, fell back to inbox D3D12, rejected root flags and exited at 7.594 s with the `+0xb5a5f8` null-read signature from #598. Scoping Agility initialization to native host path resolution loaded SDK v620 and passed that point. The path-scope regression passed. 2. The Agility-fixed build reached 74.398 s and faulted in `xg::copy_from` on a destination write. The failing call uses the extra argument before the source pointer, as in #662. Using the extra-argument wrapper and checked row copies from our local baseline cleared this failure. Five XG tests passed, including argument ordering and the unmapped destination case. 3. With both compatibility fixes, two runs reached `DXGI_ERROR_DEVICE_HUNG` (`0x887a0006`) at ~86 and ~96 s. Both recorded `nvlddmkm` 153 and Display 4101. DRED reported 16 of 7,339 operations complete in the affected list. The first outstanding operation was `ExecuteIndirect`. In the run with DRED pipeline names, the label was VS `d2a238740e50f037`, PS `e2bcc91e569d6d13`. VA was 0, with no associated allocations. The second run reproduced the breadcrumb with the CPU D3D12 debug layer and targeted binding tracing enabled. The same shader pair drew the UI earlier. The breadcrumb helps locate the execution failure, and more evidence is needed to identify the faulty resource or producer. No verified world geometry in either run. AI use: OpenAI Codex (GPT-6) integrated the focused local backports, ran the tests, and analyzed the logs.
In the HLSL split-wave64 form a group of one console wave (64 threads or
fewer) is just the two 32-lane halves, and they take the same branches
(on exchanged, wave-uniform state), so both reach every exchange. Since
#798 they met through the bounded counter spin there too, which costs
about 2.3x the group barrier per exchange on Ampere (#1244: 13.2 ms vs
5.7 ms on an RTX 3080 in bench_split_wave64, 64-thread groups, one
exchange per iteration; 3.6x vs 1.55x wave32 on an RTX 3070).

x64_spin_for picks the form: groups of more than one console wave keep
the counters (a barrier would wait for other console waves); one-wave
groups now get the barrier, as the direct DXIL translator does
(Partner::Present, #1426). XCL_WAVE64_SPIN=1 forces the counters
everywhere, for debugging a desynchronised pair (wrong output instead
of a hang); =0 keeps the barrier, as before.

Assisted-by: Claude Code (Claude Opus 5.5)
When the device's local video memory passes 75 % of its budget, a new sampled
title texture gets no pool tiles for its largest mips (the largest side kept:
2048 from 75 %, 1024 from 85 %, 512 from 92 %). Those tiles stay unmapped and
every view of the texture is clamped to the first mip that has memory
(ResourceMinLODClamp, which counts from the resource's first mip). With lazy
levels (XCL_TEXTURE_LEVEL_PAGES=1) those levels never get pages.
XCL_TEXTURE_BUDGET=0 turns it off; XCL_TEXTURE_MAX caps every new texture.

Part of #1773.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Once any buffer mirror exists, sync_title_buffers runs on every draw and
nothing reported what it costs. With XCL_ACTIVITY=1 it now logs, every 2 s
in which it ran: draws synced and those with a mirror, copies (whole
buffers), bytes copied, indices scanned for the vertex range, readable()
calls (those over 16 pages, which can take the VirtualQuery walk), the time
in readable() and its slowest call, and the time in the function.

The slowest readable() is not in #2391's list: measuring on #2389 found
single calls of 16 pages or fewer taking 1-9 ms, which the other counters
average away.

The counters cost nothing without XCL_ACTIVITY: host_main turns them on
(enable_sync_activity) before it starts the activity thread, and until then
sync_title_buffers, sync_readable() and sync_count() check one relaxed
bool and take no time stamps and touch no shared counter.

No change in behaviour: the old body is sync_mirrors, unchanged apart
from the counters, and sync_title_buffers still returns first when no
mirror exists.

Fixes #2391. Part of #2389.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
With XCL_PSO_WAIT_MS set, a Dispatch or dispatching ExecuteIndirect put
off to the submit (#2118) was recorded through resolve_wait, with the same
budget a bind has as the title records. A pipeline a bind had already
found late got the stand-in at once, one still building got it after the
budget, and the dispatch was counted as skipped and left out. Its segment
lies between the list's other work, so the list's Write64 labels, EOP
writes and fence signals still fired: the title saw the work as done
while its UAV outputs, counters and indirect argument buffers were never
written.

record_deferred now waits for the segment's compute pipeline
(pso_async::wait_for_submit) before it records the call, whether a bind
found it late or not. Without the budget this is the wait the submit
already made. With it, the submit leaves the build to the workers for
the budget first, as a bind does, so big compiles keep their turns on
the workers; one no worker has started by then is built on the
submitting thread, so a submit never waits for a free worker. One a
worker builds is waited for at most 30 s (SUBMIT_WAIT_MOST, the time a
retail title's watchdog lets its main thread stand still, #891):
title_held stops kernelx::Sleep and the GPU-wait watchdog, not every
clock a title reads. Past that the call goes on with the stand-in as
before, with a WARN ("deferred dispatch skipped after waiting 30 s for
its pipeline") and a count of its own.

A worker's build that panics now ends as a failed build (catch_unwind
around the job), so whoever waits for it goes on instead of waiting for
a done flag nobody sets.

Tests: a put-off dispatch of a translated console program whose build
ends 400 ms into the submit, with a 50 ms budget and the pipeline already
late, has its store and the Write64 after it in the list reach memory
(without the change the label is written and the store is not); a
submit's wait for a late pipeline no worker can start builds it itself;
a submit waits for a worker's build no longer than its bound and counts
it; a panicking build ends as failed.
sync_title_buffers checked every copy's source, and the indices it scans,
with gpu::shader::readable. For a range with a page that is not resident,
or over 16 pages, that walks the region with VirtualQuery. Measured on
#2389, in 18 of 43 two-second windows one such call took 1.1-8.8 ms on
the render thread inside a draw.

The copy now uses title_textures::copy_committed_region (ReadProcessMemory,
which cannot fault), so a page the title freed or protected since keeps
what the mirror had. The indices are scanned from the index buffer's
mirror once copied there; an index buffer without a mirror is still
checked.

#2392 proposed checking once per mirror and again after kernelx frees or
reprotects memory. kernelx does not see HeapFree, which releases large
heap blocks inside ntdll, so that still needed a copy that cannot fault,
and with one the check has nothing left to protect.

Fixes #2392. Part of #2389.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Count completed records in the offline shader path and display progress while the launcher waits for the worker. Warm both pieces and the whole compute fallback for split records. A cancelled or unsuccessful pass leaves the host unstarted.
Keep the guest behind the preparation gate in the host. The presenter owns its window throughout warm-up and swap-chain creation. Let its message thread draw progress and handle cancellation until the guest is ready. Leave the runtime clock and input timing anchored to title startup.
The host starts the measured title interval only after the shader gate succeeds. Let a full-pack run specify a longer launcher deadline and record that setting in the evidence manifest. Keep the default timeout and regression block unchanged.
76 upstream commits; 15 files with conflicts, resolved keeping the fork's
fixes with upstream's new code. Where upstream's #2118 text replaced the
fork's port of it, the port's fixes are carried: the own allocator of a
recording stays on its primary list, a put-off segment's blocks are held
for the PC allocator it records on, alloc_pool asks its own fences
through real::fence_completed. Two upstream geometry tests meet the
fork's refusal of the split ES form and take the native form by default.

Software adapter: cargo test --release -p xcl --lib: 1519 passed,
0 failed, 24 ignored; 58 tests that open the hardware GPU not run.
Integration tests: d3d12_mesh_stream's
console_ms_in_as_slot_and_ms_with_as_are_refused_cleanly fails here and
on world-main before the merge alike (the fork translates that case);
the three e2e tests were not run (the test title was not built).
Not run on a title yet.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Taken as it is at 5bec5877 for a test on a title. One conflict in
shaders.rs: the fork's slice of the shader list and its rodata option
are kept with the pull request's counting of records and errors.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Seven upstream commits. Conflicts in four files: the README keeps both
bullets; dxc.rs keeps the fork's compile_with (a compiler on a private
heap) under upstream's compile_whole and linked form; a dispatch chain's
refusal warning stays, with ComputeBuild::Chain; the split fixture keeps
the fork's optional chain with upstream's timing block inside it.
driver_cache::path is back: upstream's new test calls it.

Software adapter: cargo test --release -p xcl --lib: 1531 passed,
1 failed, 25 ignored; 59 tests that open the hardware GPU not run. The
failure, sparse's flush_parked_does_not_free_or_reuse_tiles_while_unmap_
is_in_flight, passed three times of three run alone (it reads the clock;
a shader build was using the machine). Not run on a title yet.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Taken as it is for a test on a title.

Co-Authored-By: Claude Fable 5.2 <[email protected]>

# Conflicts:
#	crates/xcl/src/hle/d3d12x/list_x.rs
#	crates/xcl/src/host.rs
Taken as it is for a test on a title. The memory line keeps the fork's
budget and commit text after the pull request's count of thinned textures.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The driver builds about two pipelines at a time for one process, so the
preparation before a title (#2555) stood for minutes on each stretch of
large compute programs. The stages are still translated in the host;
the compute pipelines are built by worker processes of the same program,
each on its own slice of the records: the processors less two, 16 at
most, 3 GB of the commit left for each (XCL_PREPARE_WORKERS; 1: as
before). With a list of the pipelines an earlier run used, only those
are built before the title starts. A worker that fails is logged and the
title starts; a worker ends when the host does. A worker reports every
record while a title waits on it, and the host logs its progress every
5 s.

Measured on a retail title, RTX 5090, 32 threads: the first 92 % of the
steps in 85 s (one process: 84 % of one pass after several minutes).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Taken as it is for a test on a title.

Co-Authored-By: Claude Fable 5.2 <[email protected]>

# Conflicts:
#	crates/xcl/src/gpu/recomp/emit.rs
From #2547: pso_async::wait_for_submit, called by record_deferred
(bind::wait_for_bound) before each put-off call is recorded; the
SUBMIT_WAIT_MOST bound with its WARN and SUBMIT_GAVE_UP count; the test
switches for the wait budget and the submit bound; catch_unwind around a
worker's build; the four tests.

Kept from the fork: Demand's waiters/by_submit/ahead counting (the submit
counts once among the waiters through `ahead`, also for a late pipeline,
and leaves with unwant_ahead when it gives up), waits_for/need_by_submit,
the split LISTS locks (no lock held across the wait), the own allocator on
the primary list, run_job (the panic catch wraps it and clears its
thread-locals), the Wait struct (submit wait counters, 1 s logs, title
held), BUILT_HERE/BUILT_AT_SUBMIT for a build the submit runs itself, the
dred pipeline mark (now after the wait, so it names the built pipeline)
and bound_pso. XCL_CS_PSO_WAIT_MS keeps its precedence: with it set,
wait_for_submit leaves the wait to the call's resolve_wait as before.
Without XCL_PSO_WAIT_MS and XCL_CS_PSO_WAIT_MS the submit's wait is the
unbounded resolve_wait_for it already made.

The list_x GPU test makes the pipeline late after the dispatch is put
off, since the fork does not put off a late pipeline.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The two passes were added up (twice the records), and a worker's count
moved every 200 records, so the screen stood on one number for many
minutes. The workers' pass has its own heading and count, a worker
reports every record, and the line under the bar says a large pipeline
is compiling. Workers: the logical processors less four.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
A shader whose S# is taken for a heap entry it is not samples through
entry 0: point, wrap, mip 0 only. With the switch that entry is linear,
clamp, every mip, so a picture that changes with it shows such shaders.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
This reverts commit 4eb70f0fe3, reversing
changes made to 626459dbe7.
A program's S# constants were known only inside the block that set them.
The console compiler sets an S# before a loop or an if and samples
inside it; those samples went through sampler-heap entry 0 (point, wrap,
mip 0): banded gradients, stepped glows, a lookup that wraps. The
constants are followed through the program's branches: a register is a
constant at a block's start when every block that leads there leaves it
with the same one.

On a retail title, RTX 5090: with entry 0 made linear
(XCL_ZERO_SAMPLER_LINEAR=1) the bands and steps went, which showed the
samples went through it.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
This reverts commit 52590832bb, reversing
changes made to 2870e1007c.
This reverts commit 2870e1007c, reversing
changes made to 6aa80e3c80.
A run keeps the shaders of the pipelines it uses, each by its own key
(used-shaders.txt beside the DXIL cache). With that list the preparation
before a title translates only those records; the title translates
another when it first uses it. XCL_PREPARE_ALL=1: every record, as
without the list. XCL_PREPARE=0: no preparation, the title builds what
it uses as it goes.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
This reverts commit fbfac4d06d.
A program's S# constants were known only inside the block that set them.
The console compiler sets an S# before a loop or an if and samples
inside it; those samples went through sampler-heap entry 0 (point, wrap,
mip 0): banded gradients, stepped glows, a lookup that wraps. In vertex
and pixel programs the constants are followed through the branches: a
register is a constant at a block's start when every block that leads
there leaves it with the same one.

Not in the other programs: read this way on a retail title, compute
programs gave ExecuteIndirect 2 055 counts out of range in 75 s (none
before) and the device hung after 140 s. Why is not known yet.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
A console title may make a UAV of a depth buffer and have compute passes
read and write its depth plane. The PC buffer has no unordered access, so
behind XCL_DEPTH_UAV_TWIN=1 the depth plane of a D32, D16 or D32S8 buffer
gets a twin (R32_TYPELESS, R16_TYPELESS) that must hold what the plane
holds while shaders use it, and give back what they wrote.

The title says when that is: it moves the buffer into UNORDERED_ACCESS
before its shaders use the UAV and out of it before the next depth test or
sampling, and each transition names the state it leaves and the one it
enters. So, in ResourceBarrier:

- The PC buffer cannot be in UNORDERED_ACCESS: where the title has it
  there it rests in COPY_SOURCE (depth_uav::PARK), on every list (also the
  console-shaped ones), from its creation on, so its states agree wherever
  the title moves it. An object the title made in UNORDERED_ACCESS keeps
  the title's states, and gets no copies.
- After a transition into UNORDERED_ACCESS on a DIRECT list, the depth
  plane is copied into the twin (the twin made then when there is none):
  what was drawn reaches the shaders.
- Before a transition out of it, the twin is copied into the plane, which
  goes PARK -> COPY_DEST, and the title's transition goes on from there:
  what the shaders wrote reaches the next draw.
- A copy into the twin is not done while the two hold the same: after a
  copy on this recording with no transition to a state that writes the
  plane since (in_step, per list, cleared by Reset and KickoffX; a split
  segment starts without it). Record order is execution order only within
  one list, so nothing is carried across lists.
- A twin whose last way in was not copied (a compute list, a twin that
  could not be made) is not copied back: it does not hold the plane.
- A split transition is done whole at its end.

D3D12 rules relied on: copies of whole subresources between a depth
plane and a texture of the same format family (R32_TYPELESS and
R16_TYPELESS on both sides; plane 0 of R32G8X24_TYPELESS copies as
R32_TYPELESS); a depth-stencil resource may be in COPY_SOURCE / COPY_DEST;
the twin rests in UNORDERED_ACCESS and goes to COPY_* and back around each
copy. Copies only on DIRECT lists.

The UAV itself still names nothing here; the next commit makes it a view
of the twin.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
With XCL_DEPTH_UAV_TWIN=1 a UAV of the depth plane of a D32, D16 or D32S8
buffer was still a null view ("its depth plane has no twin yet"): on a
retail title 11 of them in the first seconds of its 3D world, so its
compute lighting read nothing and wrote nowhere. It is now a view of the
plane's twin, made at the first such UAV or transition into
UNORDERED_ACCESS, the way the stencil plane's UAV is a view of its R8
twin: the slot's UAV, companion SRV and T# name the twin.

The view keeps the title's dimension, mip and slices on plane 0; its
format is R32_FLOAT (D32, D32S8) or R16_UNORM (D16), the depth as a
shader reads it, unless the title asked for another class of that size
(R32_UINT, R16_UINT ...). A D24S8's depth plane stays a null view (no UAV
format reads it as the depth), as does that of a buffer made in
UNORDERED_ACCESS (its states stay the title's, the twin would never be
copied). The stencil plane goes as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A dumped frame's render targets show where a picture goes wrong (the
first tone-mapped target of a world frame comes out as a negative of
the HDR scene it reads), but not which pass drew it.

With XCL_DUMP_TARGETS set, every graphics pipeline made through
CreateGraphicsPipelineState (or a stream of console VS / PS) is noted
by the address the title holds: its shader set key, each stage's
shader key and dump hash, render target 0's blend state (with the
logic op) and the RT formats, and a copy of its shaders (512 MiB of
them at most, deduplicated by key). Each draw counts per (target,
pipeline); the first draw with a pipeline in a frame notes what its
descriptor tables name.

For each target written, the dump logs the 12 pipelines with most
draws into it: draws, translated or not, keys, formats and blend, the
written targets it reads, and one line for each other resource it
reads (dimension, size, mips, format). A thread of its own then writes
target<k>_<stage>_<key>.hlsl (the VS and PS translated again from the
kept console shader, as the pipeline translates them, the PS's static
samplers after the VS's) and .rdna2.txt (the disassembly) next to the
pictures.

Nothing of this runs without the switch: the hooks return at once.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A title's tone map reads colour-grading lookup tables (3D textures) whose
contents come out wrong. Nothing logged how XCL made, filled or viewed a
3D texture, nor what one holds on the PC.

With XCL_DUMP_TARGETS set (lut3d.rs; nothing is done without it):
- each 3D texture made through CreatePlacedResourceX (and the views by
  address that go through it), CreateCommittedResource, CreatePlacedResource
  in a heap of the title's or CreateReservedResource gets a line and a name
  (lut<n>): size, mips, PC and console format, flags, whether it is kept in
  step with the title's memory, its title address;
- the writes XCL sees are logged: CopyTextureRegion / CopyResource into it,
  a render target view made, drawn into or cleared, an unordered access
  view made, an upload from the title's memory, WriteToSubresource;
- a shader resource view of one in a console slot: its T# index, view
  format, mips, clamp and component mapping; and when a slot that held one
  gets another view (a T# the title copied out before then names that one
  on the PC, while on the console it still names the 3D texture's memory);
- at a dumped frame each live one of at most 64 on a side is read back in
  the state the title's submitted transitions left it in (noted beside
  title_textures'; one copied into from COMMON is not read back): the
  texels at its corners and centre and each channel's range over mip 0,
  and its first, middle and last depth slices as
  lut<n>_<w>x<h>x<d>_f<format>_slice<k>.bmp.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A title makes over two hundred of them; the ones a pass reads were past
the first 32.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The size of a 3D render target on the console is not modelled, and
without a size every PC tile of the reserved texture went on the
title's pages from its address on. The PC's texture has more tiles than
the console's takes (18 for 33x33x33 texels of 8 bytes), so the last
ones were the first pages of the texture the title placed behind it
(512 KiB on): two such textures wrote over each other.

A title's run-time colour-grading volumes are placed like that. Two of
the three the tone-mapping pass reads held slabs of their neighbours:
the picture came out teal and close to a negative. With the texels of
the first level as the least the texture takes, it has those pages at
its address and its own tiles for the rest.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
A dumped frame shows which graphics pipelines drew into each target,
but a scene lit per screen tile by compute passes leaves no trace
there: the dispatches are counted as work and nothing more.

With XCL_DUMP_TARGETS set, every compute pipeline made through
CreateComputePipelineState (or a stream of a console CS) is noted as
the graphics ones are (its CS kept, within the same 512 MiB). Each
Dispatch and each ExecuteIndirect of a dispatch signature counts for
the pipeline the title bound; an indirect one reads its first command's
arguments (and the count) when they are in unified memory at record
time.

The dump logs each compute pipeline of the frame in order of first use:
its CS key and dump hash, its direct and indirect dispatches, the
groups of the first direct one and of the largest, the first indirect
one's arguments (or that they are on the GPU), and whether it runs
translated. The first 400 get compute<k>_cs_<key>.hlsl and .rdna2.txt
on the dump's shader thread, translated through HLSL even when the
pipeline runs direct DXIL; the file names the path that made the
running DXIL (pso::compute_path: HLSL, direct DXIL for XCL_DIRECT_DXIL
or for enormous HLSL, or from the translated cache). HLSL above 8 MB
is not written, with a log line.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
XCL_DEBUG_PS_SUB probes inside one pixel shader; a pass done by
compute shaders had nothing alike.

XCL_DEBUG_CS_SUB=<dump hash>:from=>to||from=>to does the same for the
compute shader of that dump hash, with one [SHADER] line per
substitution giving the occurrences replaced. The two switches share
their parsing (debug_subs) and their replacement (apply_debug_subs).

That shader is translated through HLSL: not by the direct DXIL
translator, neither for XCL_DIRECT_DXIL nor for enormous HLSL. It takes
none of the caches kept by its console bytes, which hold it unchanged:
console_to_dxil_in skips the shader cache in memory and the translated
cache on disk for it, and keeps the substituted result in neither. So a
shader preparation that built the original (in this process or in its
worker processes, which also go through console_to_dxil_in) does not
stand in for it. The caches after that are keyed by what changed: the
DXC cache by the HLSL text, the driver's blobs by the DXIL. Every other
compute shader keeps its path and its caches.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Shaders that read zeros where data should be (vertices of prepared meshes
collapsing to a point, tile light lists read as empty) may be reading tiles
of the memory windows with no video memory: never filled, given back, or
asked for at a submit that ran before their fill. Nothing told these apart.
Three switches do, all off unless set:

- XCL_VIEW_KEEP=1: a tile over a CPU view keeps its video memory once
  filled. Where it would go back (its CPU view decommitted, its view gone,
  its page remapped or moved) it stays mapped in `kept` and is taken back
  from there as a parked tile is. Tiles kept count against XCL_MIRROR_MB;
  at the cap tiles are refused as before (warned once).
- XCL_VIEW_POISON=1 (or =0x<pattern>): every tile of the windows without
  video memory is mapped onto one shared tile filled with 0x7fc0dead
  (REUSE_SINGLE_TILE), and an unmapped tile goes back to it instead of
  NULL; a buffer placed in a window starts on it too. The tile is filled
  again at most every 16 ms, as shaders may write there.
- XCL_VIEW_STATS=1 (on with either of the others): a line every 2 s of the
  tiles asked for, filled, given back and kept, how many submits after
  going a tile got video memory again (0-1, 2-8, 9-64, more) and the bytes
  filled again for those, and the submits that left asked tiles waiting
  for a later submit (the fill budget and ask limit of a submit).

Which windows a pipeline's shaders reach is not known (the window comes
from each address at run time), so submits are not matched to the
windows their lists read.

Tests: the switches' pattern, the keep decision, the buckets and the line;
a kept tile stays mapped over a submit and comes back with its count; a
tile without video memory reads the pattern, filled reads its data, given
back reads the pattern again (on the software adapter).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Records with the same program are in several workers' slices. Each
worker found no driver blob and built the pipeline: the driver's
compile of one took about twice as long in each of four workers that
built it at once, and a worker that had waited for its turn built what
another had written to the cache meanwhile.

A worker claims a pipeline with a file beside the blob it will write
(<blob>.claim) and removes it when the build ends; a worker that finds
the claim leaves the pipeline, and the cache is read again after the
wait. A claim left by a process that died is taken over after 30
minutes. The count of pipelines left to another process is printed
with the others.

Reported by a tester who logged what each worker compiled.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The shader preparation before a title starts builds the compute pipelines
earlier runs used, but no graphics pipeline: what is kept between runs is
not enough to make one again. used-pipelines.txt holds only the key of a
pipeline's shader set, and the driver cache holds blobs named after the
translated DXIL and the description's hash. A retail title then builds
~6 000 graphics pipelines in its first minutes, with thousands of
stand-ins that draw nothing meanwhile.

A lazy graphics pipeline's description is now written down at its first
use in a run (pso_async::on_first_use, told once, as used::note is):
every field of the description but its pointers, its input layout, and
the keys of its console shaders, ~200 bytes, under the key
used-pipelines.txt has. The entry is made when the pipeline is (no
shader copy is kept for it after its build) and written by a thread of
its own, each description once, to used-graphics-pipelines.bin beside
the DXIL cache (gfx_records: the format is in the module's comment). The
file is versioned (another version reads as none and is started again),
an entry cut short or damaged ends it, and it stops at XCL_GFX_RECORDS_MB
(64) with a line in the log. No shader code is kept: the preparation
finds the shaders in the title's shader files by key, as it does for
used-shaders.txt.

Mesh pipeline streams are not recorded.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
After the compute pass, the shader preparation now reads the graphics
pipeline records of earlier runs (used-graphics-pipelines.bin), finds
their console shaders in the title's shader files by key, and builds each
pipeline in worker processes, the way the title's background build makes
it (real::prepare_graphics calls translated_graphics_pso, as
build_graphics does): the translation, DXC and driver blob caches on disk
then hold exactly what the title asks for, and the title makes these
pipelines from the kept blob in milliseconds instead of compiling them
while it draws stand-ins.

Worker processes, as for the compute pipelines: the driver builds about
two pipelines at a time for one process, and a driver that ends a worker
ends no title. Nothing of the title's device is needed: a translated
pipeline gets XCL's root signature, and what else its build reads of the
process is the title's memory windows (given with --windows, no memory
reserved: uma::leave_out, pso::set_title_windows) and the adapter
(XCL_ADAPTER from the title's setting). Each worker gets a file of its
part with the shaders it needs (gfx_records' format) in the temporary
folder, removed after.

The title did not keep the blob of most graphics pipelines: none of under
16 KB of DXIL and none built in under 250 ms (XCL_PSO_DISK_CACHE_MIN_MS),
so most were compiled again in every run. A preparation worker keeps
every blob, on disk only. The blob's file name is made of the
description's state, the DXIL, the adapter and driver and the window
count, no address, so the title's lookup finds the worker's file.

The screen shows "Building graphics pipelines" with its own count, the
5 s line counts graphics pipelines, a failure is logged and skipped and
the title starts regardless. XCL_PREPARE=0 skips it with the rest,
XCL_PREPARE_GRAPHICS=0 skips this pass only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Its one commit (an S# word written with s_brev_b32 is a constant) is
in the branch already, inside the follow-the-branches form of
constant_samplers; its tests are kept.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Author
Owner

@⁠Royalflamejlh on GitHub · 2026-11-26 05:18 UTC · original

On Linux + NVIDIA, c044dc6 with #684 lost the device in 14 of 17 runs, at 95 to 207 s, with Xid 109 (CTX SWITCH TIMEOUT) in the kernel log in 11 of them and in one run without a removal: probably the DXGI_ERROR_DEVICE_HUNG with event 153 reported above on the RTX 5090 and the RTX 3090 Ti (a guess). In 1 of the 2 runs with breadcrumbs_sync (a barrier after each command), the one queue vkd3d-proton could read had stopped in a Dispatch(320, 180, 1) of cs 3cd7bbae40a84030; the other skipped that program and placed no list. Skipping that program, or taking out 1be95b1b's spin exchange, did not stop the hang. main b49be18 with #684, #751, #1599, #1860, #2082, #2404, #2615 and #2598 (XCL_DIRECT_DXIL=1 of the four; two of the four plain runs on vkd3d-proton's standard dxil-spirv) hit Xid 109 in the 4 runs without breadcrumbs_sync (106 to 159 s), but not in the 2 with it (stopped by our memory guard at 167 and 188 s), so it may be a different hang.

Setup: RTX 4060 Ti 16 GB (NVIDIA 615.71.09), Wine 11.21 Staging, vkd3d-proton v3.1-90-g30b0eb9b with dxil-spirv 694cc674 and three local patches to it, unless named. XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_UMA_SHADOW=1 XCL_CS_PSO_WAIT_MS=50 unless named; first-run screens completed once, no story progress; 300 s asked (1,050 s in three runs).

changed from the setup runs device removed at
none 1 – (Xid 109 at 98.9 s, no removal reported; no present after 94.5 s)
breadcrumbs (the kit built with its trace option; 3 runs on a bench-only tree that waits 10 s at a removal) 5 95.3, 102.7, 104.5, 132.8 s; 94.9 s with breadcrumbs_sync
no XCL_CS_PSO_WAIT_MS 2 147.6 s; – (no present after 94.2 s)
no XCL_HEAP_WINDOWS, no XCL_UMA_SHADOW 2 207.4 s; – (no present after 94.2 s)
HLSL path (no XCL_DIRECT_DXIL) 1 177.0 s
vkd3d-proton's standard dxil-spirv, + #1860 1 132.3 s
XCL_TWO_PASS_MB=1: no two-pass ExecuteIndirect ran (the second with breadcrumbs) 2 130.8, 103.1 s
XCL_SKIP_CS=3cd7bbae40a84030 (the second with breadcrumbs_sync) 2 106.4, 99.6 s
kernel.rs:684 back to main's barrier (33..=64 => Partner::Present) 1 103.8 s
  • Read: that program (64 threads a group) has one loop, the counter spin 1be95b1b gives a 33–64-thread compute group (lanes.rs, up to 1,048,576 tries per wait), where main has the group barrier #1727 found hanging; the hang came with either (last row).
  • With XCL_TWO_PASS_MB=1 no two-pass ExecuteIndirect ran and the device was lost all the same, so the ExecuteIndirect that DRED left outstanding on the RTX 3090 Ti may be a list that waited, not the cause (a guess).

Not tested: Windows; the head 22eb6f2 (one commit past c044dc6, on static samplers; it touches neither ExecuteIndirect nor the wave exchange); main without the eight pull requests; more than one run in most rows.

AI use: Claude Code (Claude Opus 5.5) made the runs, read the logs, the breadcrumbs and the translated programs, and wrote this.

Posted without review by a person: the account owner was away and reads replies later.

**@⁠Royalflamejlh** on GitHub · 2026-11-26 05:18 UTC · [original](https://github.com/xcl-dev/xcl/pull/2572#issuecomment-7183368441) On Linux + NVIDIA, `c044dc6` with #684 lost the device in 14 of 17 runs, at 95 to 207 s, with Xid 109 (`CTX SWITCH TIMEOUT`) in the kernel log in 11 of them and in one run without a removal: probably the `DXGI_ERROR_DEVICE_HUNG` with event 153 reported above on the RTX 5090 and the RTX 3090 Ti (a guess). In 1 of the 2 runs with `breadcrumbs_sync` (a barrier after each command), the one queue vkd3d-proton could read had stopped in a `Dispatch(320, 180, 1)` of `cs 3cd7bbae40a84030`; the other skipped that program and placed no list. Skipping that program, or taking out `1be95b1b`'s spin exchange, did not stop the hang. `main` `b49be18` with #684, #751, #1599, #1860, #2082, #2404, #2615 and #2598 (`XCL_DIRECT_DXIL=1` of the four; two of the four plain runs on vkd3d-proton's standard dxil-spirv) hit Xid 109 in the 4 runs without `breadcrumbs_sync` (106 to 159 s), but not in the 2 with it (stopped by our memory guard at 167 and 188 s), so it may be a different hang. **Setup:** RTX 4060 Ti 16 GB (NVIDIA 615.71.09), Wine 11.21 Staging, vkd3d-proton `v3.1-90-g30b0eb9b` with dxil-spirv `694cc674` and three local patches to it, unless named. `XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_UMA_SHADOW=1 XCL_CS_PSO_WAIT_MS=50` unless named; first-run screens completed once, no story progress; 300 s asked (1,050 s in three runs). | changed from the setup | runs | device removed at | |---|---|---| | none | 1 | – (Xid 109 at 98.9 s, no removal reported; no present after 94.5 s) | | breadcrumbs (the kit built with its trace option; 3 runs on a bench-only tree that waits 10 s at a removal) | 5 | 95.3, 102.7, 104.5, 132.8 s; 94.9 s with `breadcrumbs_sync` | | no `XCL_CS_PSO_WAIT_MS` | 2 | 147.6 s; – (no present after 94.2 s) | | no `XCL_HEAP_WINDOWS`, no `XCL_UMA_SHADOW` | 2 | 207.4 s; – (no present after 94.2 s) | | HLSL path (no `XCL_DIRECT_DXIL`) | 1 | 177.0 s | | vkd3d-proton's standard dxil-spirv, + #1860 | 1 | 132.3 s | | `XCL_TWO_PASS_MB=1`: no two-pass `ExecuteIndirect` ran (the second with breadcrumbs) | 2 | 130.8, 103.1 s | | `XCL_SKIP_CS=3cd7bbae40a84030` (the second with `breadcrumbs_sync`) | 2 | 106.4, 99.6 s | | `kernel.rs:684` back to `main`'s barrier (`33..=64 => Partner::Present`) | 1 | 103.8 s | - **Read:** that program (64 threads a group) has one loop, the counter spin `1be95b1b` gives a 33–64-thread compute group (`lanes.rs`, up to 1,048,576 tries per wait), where `main` has the group barrier #1727 found hanging; the hang came with either (last row). - With `XCL_TWO_PASS_MB=1` no two-pass `ExecuteIndirect` ran and the device was lost all the same, so the `ExecuteIndirect` that DRED left outstanding on the RTX 3090 Ti may be a list that waited, not the cause (a guess). **Not tested:** Windows; the head `22eb6f2` (one commit past `c044dc6`, on static samplers; it touches neither `ExecuteIndirect` nor the wave exchange); `main` without the eight pull requests; more than one run in most rows. **AI use:** Claude Code (Claude Opus 5.5) made the runs, read the logs, the breadcrumbs and the translated programs, and wrote this. Posted without review by a person: the account owner was away and reads replies later.
Author
Owner

@⁠Prime1997 on GitHub · 2026-11-26 13:53 UTC · original · reviewed

NVIDIA-related PR status — bounded review, 26 November 2026. This records the discovered 13:22 UTC cohort across all target branches, including drafts: 288 open PRs, 46 drafts: 24 good within the reviewed scope,62 need changes, 202 blocked. #2791 was subsequently rechecked and retested at 749b0e06. Other rows identify the cutoff head; later pushes require a new review. Ten unrelated candidates and two externally closed PRs are excluded. This is not an exhaustive audit of all 1492 open PRs.

Current main is b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7; this NVIDIA stack is af2cecc40886a8682ecf3267f5328c6dc4b66ad7:0 main-only / 371 NVIDIA-only commits. Targets in this cohort:272 main, 12 nvidia-dev, 4 amd-dev.

Meaning of the statuses: good means useful within the named source or targeted-test scope, not merge approval. Needs changes includes implementation defects, inherited stack prerequisites, unsafe/inaccurate fixtures and reporting errors; it does not mean every issue was introduced by that PR. Blocked means current integration, full stack, platform or device validation is incomplete. Draft status, conflicts and overlap alone are never closure reasons. No PR was closed in this pass.

Measured: 86 CPU passes across 30 distinct CPU source/test variants, plus 1 CPU-only query fixture in the device harness; 9 device-fixture passes; negative controls 2 passed / 6 expected failures; 3 synthetic script runs passed. Four repeat baseline passes are excluded. Failed/deferred setup attempts remain separate; an old-DXC failure was resolved using a private DXC 1.9 copy. No ignored/skip result is counted as coverage. Tests include current-main baselines and 12 isolated PR integrations; other reports identify clean PR heads or local repairs. Counts overlap across revisions and are not one whole-suite run.

The worker/adapter fixes remain local, including contributor #2705 plus #2712/#2555 integration. The #2731 local repair passed 6 checks after reproducing the stale-ownership failure. The refreshed #2791 passed its CPU query-failure fixture and both device fixtures, with 19 tiling cases on RTX 3060 Ti. Whole-suite/retail validation, AMD comparison, real multi-adapter recovery and the large PSO-memory benchmark remain unperformed. All native work used isolated sources, the shared lock and game-idle guards; this review made no installation or game-data change.

The cohort is accounted through 243 bounded exact-head source reviews, 10 public scoped reviews and 35 existing scoped receipts whose limits remain explicit. Bounded source review can cover an owned delta and relevant callers without certifying its entire inherited stack. Individual reports below preserve exact variants, selected tests and exclusions.

Good within the reviewed scope: 24 PRs
PR Head Draft Scope / next action
#857 aaf8aa16809d no Docs: the wave64-on-wave32 note calls closed PR #33 a draft; bounded source/script review only.
#1262 aa9c75a49cee no Docs: the split-wave64 exchange spins by default, since PR #798; bounded source/script review only.
#1270 5e4d91a7fe2c no Scripts: smoke.ps1 reads the log of a run it killed on timeout; bounded source/script review only.
#2179 9483d4363b9c no Shaders: gate offline --pipelines large DXIL builds on commit headroom; targeted result in linked report; remaining validation applies.
#2332 ab861b819677 yes D3D12.X: check shader cache capacity before copying entries; targeted result in linked report; remaining validation applies.
#2350 4cd2bc20cc28 yes D3D12.X: plan split-dispatch slabs without heap allocations; targeted result in linked report; remaining validation applies.
#2424 89bbbb4995b4 yes D3D12.X: keep inline split pipeline pieces on the foreground path; targeted result in linked report; remaining validation applies.
#2426 9c178b2d6499 no D3D12.X: a create that fails on a lost device keeps the driver's blob; targeted result in linked report; remaining validation applies.
#2437 e4269721c279 no D3D12.X: the per-draw mirror sync copies without asking readable(); targeted result in linked report; remaining validation applies.
#2475 398cefbcd74a no Recompiler: count split shader pieces in the cache budget; targeted result in linked report; remaining validation applies.
#2532 bb33ceed26be no D3D12.X: reserve split compute scratch before allocating it; targeted result in linked report; remaining validation applies.
#2535 1e4a2c787a07 no Recompiler: the rerouted shader cache checks fresh DXIL and chain pieces; targeted result in linked report; remaining validation applies.
#2579 93445592be14 no D3D12.X: a build a submit waits for is wanted from the moment its call is put off; targeted result in linked report; remaining validation applies.
#2687 df0b92ae87ff no Document shared cache history for used-only precompile; bounded source/script review only.
#2729 93e66c197c27 no D3D12.X: instrument submitting-thread call breakdown under XCL_LOOK_STATS=2; targeted result in linked report; remaining validation applies.
#2765 d7fab00e9e8a no README: translation-only --precompile; --measure-pso needs Developer Mode; bounded source/script review only.
#2767 a173e209151f no Recompiler: share translated DXIL across repeated pipeline builds; targeted result in linked report; remaining validation applies.
#2768 936bb90e17e7 no D3D12.X: anchor XCL_LOOK_SKIP per frame and clear CLOSED on list reset/release; targeted result in linked report; remaining validation applies.
#2770 7a7e161d907c no Tests: wait for late release before checking released pipelines are gone; targeted result in linked report; remaining validation applies.
#2771 6b2691e18b02 yes Tests: some_ranges in texture_upload wraps its generator instead of overflowing; targeted result in linked report; remaining validation applies.
#2773 0c0a7aa4ef1c yes Tests: a page's failed move goes to an address Windows never hands out; targeted result in linked report; remaining validation applies.
#2777 e59d1d11043b yes Shaders: keep xcl shaders out of EcoQoS execution-speed throttling; targeted result in linked report; remaining validation applies.
#2790 ccb14f7f653d no D3D12.X: stencil views get a uint T# format, so shaders load them as integers; targeted result in linked report; remaining validation applies.
#2791 749b0e06c186 no Tests: add AMD vs NVIDIA D3D12 tiling, budget, and pipeline memory parity suite; targeted result in linked report; remaining validation applies.
Needs changes: 62 PRs
PR Head Draft Scope / next action
#245 2fcb0950de68 no Include partial-wave optimizer source in translated-cache invalidation.
#546 720143505d92 yes Correct wave64 reporting on wave32-only hardware.
#562 8ec2a46974d3 no Fence assignment and enqueue can reorder same-queue payloads; baseline gap also remains.
#688 760f742b4238 no Retry ordinary DXC creation after optional private-heap/factory failure.
#759 dd66d20995e2 yes Reject missing/invalid bounds and validate input before starting work.
#827 44d69219872a no Sweep weak shader entries; Weak slice allocations otherwise retain backing bytes.
#924 a2b500731907 no Record successful signals separately from rejected attempts.
#977 47fb4bb5a831 no Short-circuit a failed backend probe before the next device probe.
#1006 ec5bac99305d no Retain pending-save state when persistence fails.
#1102 c387de21fa81 yes Track mapping/content changes so GPU-written state cannot hide later CPU writes.
#1168 0840ff5a690c no Publish queued state and count without exposing decrement-before-increment.
#1193 5ae60ad0a9ba no Include pre-body loop-budget exhaustion in EXEC analysis; local4-test repair passes.
#1385 875a60352ed3 no Revalidate mapping generation before copying old readback bytes after unlocking.
#1442 293584e0078a no Validate or saturate reserve-to-byte conversion.
#1620 3a185909fe54 no Correct the bpermute reference oracle using native half-wave semantics.
#1630 91ae2c62e89f no Preserve low-address carry when choosing scalar-load memory windows.
#1638 2639c0806ef2 no Bound handshake/reply waits and failure fallback before claiming a worker cap.
#1643 7711f4c55672 no Serialize fence/payload ordering and add queue-lifetime cleanup.
#1665 cd46e3fc2bd9 no Allow recovery from transient failures instead of permanently suppressing wanted work.
#1710 89faa8d3fd63 no Make alone-retry admission atomic relative to normal entrants.
#1723 fca46d42e5a1 no Restore nested/thread-local cap state on all exits, including unwind.
#1762 3cd15cb7e896 yes Reserve the working slot atomically with admission; spacing alone leaves a race.
#1809 f090104a9c16 no Use the selected stage backend consistently in cache identity.
#1819 0062ee19f59c no Preserve same-queue enqueue order and unblock fixture GPU waits before assertions.
#1830 6423b67d9d42 no Timeouts must not leave overlapping benchmark work; bound discovery too.
#1871 27362a08509c no Reject a trailing --records instead of starting unbounded whole-pack work.
#1883 327abc816d36 no Report the early-return case through standard skip accounting.
#1924 c09d37689f16 no Reserve aggregate BIG/GIANT capacity atomically across both lanes.
#1931 e870dd2b576f yes Reserve frame allowance atomically and settle against the original frame.
#2009 2f490889758f no Do not signal successful title completion when readback settling fails.
#2010 d30e9a969c20 no Label distinct error reasons accurately and preserve unavailable telemetry.
#2114 21c88bc26b60 no Preserve compute producers under defaults and synchronize demand priority changes.
#2208 e4720ca15041 no Recheck device loss after queued work obtains admission.
#2229 3ce7f30fa5ea no Preserve constant/SDWA source alternatives and invalidate affected cache identity.
#2234 70d5f59b42a6 no Correct documentation that assigns all cache-miss rebuilding to the title thread.
#2246 949609b2ee21 no Gate stale-blob cold retries through large-compute admission.
#2327 e56c368079bb yes Invalidate legacy default cache identity, not only explicit SAFE_BARRIER=0.
#2404 5b9d4ff6f5f4 no Prevent first-call indirect chain truncation while whole fallback is unavailable.
#2422 349970c0a7ad no Address or explicitly scope the disclosed concurrent-final-release gap.
#2438 90bfbd423fe3 no Report the actual benchmark backend and cache provenance.
#2439 336c6c2eeafb yes Handle device-removed fence sentinels and recorded completion-publication gaps.
#2446 3a71471c80b8 no Invalidate graphics reload facts for SDWA scalar destinations.
#2519 50af98ed1f5e no Remove forbidden bundle barriers and resolve multi-piece ordering/lifetime gaps.
#2547 60349e51011d no Complete submit-owned builds as failed after a caught panic; local repair passes.
#2554 ca6f17b1cf4e no Stop on failed whole fallback and enforce expanded dispatch-axis limits.
#2555 5bec587753dd no Match startup adapter fallback to title selection; local injected tests pass.
#2558 2dc76ac89461 no Retain submitted texture resources through failed fence setup/wait recovery.
#2590 004fa0f61f9c yes Verify driver-profile ownership/content before modification or deletion.
#2611 445129ba178e no Capture RTV/DSV ownership before legal descriptor overwrite/free.
#2615 a0734c9f0931 no Preserve pending compute producers under the default wait policy.
#2633 19be65904f91 yes Resolve inherited first-call chain coverage before integrating root-CBV improvement.
#2635 24e584cab160 no Bound initial lock/I/O paths and account for batches already owned by writer.
#2670 ca6a0cc0e8f5 no Do not count cached two-pass work without trace metadata as a cold build.
#2712 8b113eeb3e30 yes Correct worker error classification, adapter forwarding and recovery fixtures.
#2726 71f30c6fe84f no Inject commit headroom and avoid unconditional join after the timeout.
#2730 2e63cbcf565d no Rename lifetime created-SRV coverage currently labelled srv-sampled.
#2731 2f2bb070fafc no Clear stale SRV ownership after UAV replacement; local6-test repair passes.
#2762 496ef5780a45 no Distinguish failed null cache entries from retained textures.
#2772 18b34a9d992f yes Retain ownership metadata after failed memory release; local5-test repair passes.
#2776 d485694b2161 no Compare raw optional usage when selecting the peak ownership snapshot.
#2782 b755223752d7 no Publish drained free descriptors without a retired/free availability gap.
#2792 bfff51a7a366 yes Handle negative SDK batch returns and worker creation failure; feature build untested.
Blocked pending validation: 202 PRs
PR Head Draft Scope / next action
#172 ca66c4aeb0de yes Recompiler: structured form for programs that needed the pc chain; existing scoped evidence; current integration/runtime pending.
#202 6c6b000705e5 no Recompiler: complete remaining RDNA2 integer CLAMP=1 saturation (#105); existing scoped evidence; current integration/runtime pending.
#214 96e68a46b2b2 no D3D12.X: bound driver PSO compile concurrency and surface stage progress (#156); existing scoped evidence; current integration/runtime pending.
#242 ff28e60b41e0 no D3D12.X: R9G9B9E5 render targets / UAVs are half floats where the device refuses them (retail title, Series S); existing scoped evidence; current integration/runtime pending.
#541 6bd8f6410400 no D3D12.X: a console MS in the AS slot is translated as the mesh shader it is; bounded source reviewed; integration/device or full-stack validation pending.
#572 14d638a3ab3c yes Shaders: bound default compile workers by available memory; bounded source reviewed; integration/device or full-stack validation pending.
#591 6c68cc703df3 no dxc: hash arguments into the DXIL cache key and honor XCL_DXC_ARGS (#559); bounded source reviewed; integration/device or full-stack validation pending.
#613 920c3807df84 yes Recompiler: honor DXC overrides with warm translation caches; bounded source reviewed; integration/device or full-stack validation pending.
#628 766b66123528 no D3D12.X: prioritize graphics pipelines in the async PSO worker pool; bounded source reviewed; integration/device or full-stack validation pending.
#642 f1e90c149b5f no Shaders: honor --precompile for a single shader file; bounded source reviewed; integration/device or full-stack validation pending.
#645 aee6962bc639 no Tests: report disabled async compute PSO as skipped; bounded source reviewed; integration/device or full-stack validation pending.
#663 ad0f0cd1d13f no Tests: cover 3D wave64 compute through the D3D12.X PSO hook; bounded source reviewed; integration/device or full-stack validation pending.
#757 4e8aaf4b393c yes D3D12.X: the PC desc of a translated VS / PS pipeline in its own function; bounded source reviewed; integration/device or full-stack validation pending.
#758 c02d05921a5d yes D3D12.X: a journal of the pipelines a title queues (\cache\pipelines.bin); bounded source reviewed; integration/device or full-stack validation pending.
#768 953f9ee0ce38 no D3D12.X: copy from the backing pages of GPU-only views; bounded source reviewed; integration/device or full-stack validation pending.
#789 bc82410abd9c no D3D12.X: decommit released sparse blocks outside the driver callback; existing scoped evidence; current integration/runtime pending.
#820 0488eceb1f4c no D3D12.X: XCL_BIG_COMPILES sets how many big compute pipelines the driver builds at once; bounded source reviewed; integration/device or full-stack validation pending.
#828 b1530ac54544 no D3D12.X: optional graphics-only pipeline preloading; bounded source reviewed; integration/device or full-stack validation pending.
#877 a553a22486ac no Memory: lazily map sparse VRAM tiles for Wine graphics heaps (#175); bounded source reviewed; integration/device or full-stack validation pending.
#881 76dcb8f560bd no Title textures: one upload batch moves its textures in two barrier calls; bounded source reviewed; integration/device or full-stack validation pending.
#889 a39c3992c7a4 no D3D12.X: compute pipelines are built ahead of their first bind; bounded source reviewed; integration/device or full-stack validation pending.
#898 dc4300da36da no D3D12.X: journal a pipeline when the title first binds it; bounded source reviewed; integration/device or full-stack validation pending.
#899 734e6e78b004 no D3D12.X: log how long a bind waits for a pipeline still being built; bounded source reviewed; integration/device or full-stack validation pending.
#900 2817c7c6ee17 no Recompiler: keep the split wave64 halves' scalar state wave-uniform; bounded source reviewed; integration/device or full-stack validation pending.
#902 90d70031f179 no D3D12.X: the driver's blob of a slow graphics pipeline is kept on disk; bounded source reviewed; integration/device or full-stack validation pending.
#904 7c2ccd9b777f no D3D12.X: draws find their pipeline facts and list state without global locks; bounded source reviewed; integration/device or full-stack validation pending.
#917 709abd7fe1a5 no Recompiler: shadow v_writelane spill slots in split-wave64; bounded source reviewed; integration/device or full-stack validation pending.
#941 91ca6cec4ddd no Tests: cover graphics PSO hooks on the GPU without game files; bounded source reviewed; integration/device or full-stack validation pending.
#944 e22a0a6e781b no Recompiler: batch consecutive v_readfirstlane/v_readlane exchanges in…; bounded source reviewed; integration/device or full-stack validation pending.
#969 23eb733a0faf no Tests: cover textured graphics PSOs and static samplers on the GPU; bounded source reviewed; integration/device or full-stack validation pending.
#1022 7e1b659cfcd9 no Recompiler: ds_bpermute_b32 in wave64 stays in each 32-lane half (#772); bounded source reviewed; integration/device or full-stack validation pending.
#1045 fcc2fd20186a no D3D12.X: distinguish the Wait64 signal queue from recording history; bounded source reviewed; integration/device or full-stack validation pending.
#1055 f532d33d695a no kernelx: queue CopyPageMappingsBatchX records the physical page each GPU-view page shows; existing scoped evidence; current integration/runtime pending.
#1111 c29bbad8cafb no Recompiler: propagate split-wave64 lane-local masks through 64-bit bitwise SALU ops; bounded source reviewed; integration/device or full-stack validation pending.
#1113 8aef2946818b no D3D12.X: only a title's run reads and writes used-pipelines.txt; bounded source reviewed; integration/device or full-stack validation pending.
#1123 c6db70c71fcf no D3D12.X: the GPU-wait watchdog says where a chain of waits ends; bounded source reviewed; integration/device or full-stack validation pending.
#1215 757ece9795bc no Recompiler: bound descriptor heap indices from T# and S# words to the heap; bounded source reviewed; integration/device or full-stack validation pending.
#1232 9af37dc2466a no Shaders: count reused compute shaders as cache hits; bounded source reviewed; integration/device or full-stack validation pending.
#1241 7b7c85359bec no Recompiler: clamp out-of-range format and sub-dword buffer loads; bounded source reviewed; integration/device or full-stack validation pending.
#1244 71d3a384d9b3 no Recompiler: split wave64 spin loops poll with a compare-exchange, not an add of 0 (#847); bounded source reviewed; integration/device or full-stack validation pending.
#1252 ec00d67e5075 no Recompiler: split wave64 halves meet before each LDS access; bounded source reviewed; integration/device or full-stack validation pending.
#1254 d88c2aa0fca8 no D3D12.X: the shared view heap logs how full it gets; bounded source reviewed; integration/device or full-stack validation pending.
#1279 d2eb1b4da080 yes Shaders: --pipelines makes programs of 4 MB DXIL or more last, by name; bounded source reviewed; integration/device or full-stack validation pending.
#1315 0d7907b385de no Recompiler: compact form that emits every distinct block text once; bounded source reviewed; integration/device or full-stack validation pending.
#1331 e860e83a1178 no D3D12.X: hold BASES lock across DEPTH_BIAS_PSOS in depth_bias_pso and forget_base; bounded source reviewed; integration/device or full-stack validation pending.
#1363 3d035cfb6fcd no Tests: skip offline compute PSO checks when D3D12 is unavailable; bounded source reviewed; integration/device or full-stack validation pending.
#1364 0da4c3589012 no Recompiler: fix the race for the last wanted DXC slot; bounded source reviewed; integration/device or full-stack validation pending.
#1368 0074749a9678 no D3D12.X: translated compute pipelines are made with node mask 0; bounded source reviewed; integration/device or full-stack validation pending.
#1380 7d43a468169f no Recompiler: big compute programs read their memory windows without a switch; bounded source reviewed; integration/device or full-stack validation pending.
#1396 ca0e1b06d85f no Shaders: restore cache-only state across nesting and unwinding; bounded source reviewed; integration/device or full-stack validation pending.
#1398 36e23fddc939 no D3D12.X: retry driver-rejected compute PSOs without DXC GVN (#756); bounded source reviewed; integration/device or full-stack validation pending.
#1410 b63a67b175d8 no D3D12.X: log once which form wave64 programs get, and why (#1407); bounded source reviewed; integration/device or full-stack validation pending.
#1413 190c97e2c357 no Shaders: XCL_SAFE_BARRIER turns the translation caches off (#1409); bounded source reviewed; integration/device or full-stack validation pending.
#1417 9a3230fa2027 no Shaders: reserve compiler memory slots atomically; bounded source reviewed; integration/device or full-stack validation pending.
#1420 867d307572af no D3D12.X: separate compute driver blobs by static sampler state; bounded source reviewed; integration/device or full-stack validation pending.
#1421 7124a95392e1 no D3D12.X: replace busy copy scratch within budget; bounded source reviewed; integration/device or full-stack validation pending.
#1428 7dbd80c275e4 no D3D12.X: dispatches of more than 65 535 groups in X are folded into Y; existing scoped evidence; current integration/runtime pending.
#1469 188f8ac84f4b no Tests: verify offline compute pipeline blobs are reused at runtime; bounded source reviewed; integration/device or full-stack validation pending.
#1477 86df8e857eed no D3D12.X: fix console_list::cl_reset initial PSO/rollback, oversized push, and null constants; bounded source reviewed; integration/device or full-stack validation pending.
#1502 c65e2c8b459d yes Shaders: --precompile --processes N builds in N processes; bounded source reviewed; integration/device or full-stack validation pending.
#1529 3386385bb1b7 no Shader compile time: DXC compiles without lifetime markers; bounded source reviewed; integration/device or full-stack validation pending.
#1552 e25f6d3a94e8 no D3D12.X: XCL_BACKGROUND_COMPILES=0 stops the driver's second compiles; bounded source reviewed; integration/device or full-stack validation pending.
#1596 524b25c1b7da no Recompiler: split-wave64 EXEC is exchanged only where it is read whole; bounded source reviewed; integration/device or full-stack validation pending.
#1597 6acbfb1f4d57 no Recompiler: a split-wave64 bitwise mask tree exchanges once, at its end; bounded source reviewed; integration/device or full-stack validation pending.
#1601 0003178b8c8b no D3D12.X: guard disk_stores removal on ShaderCacheSession SetDeleteOnDestroy; bounded source reviewed; integration/device or full-stack validation pending.
#1637 b8d92f997eba no Tests: cover split-wave64 mask liveness and mesh_wave analysis; bounded source reviewed; integration/device or full-stack validation pending.
#1652 5829b34f8efb yes d3d12x: bound PSO bind waits, guard pending draws, and auto-init uninitialized targets; bounded source reviewed; integration/device or full-stack validation pending.
#1656 8510ca021834 no xcl run: XCL_STALL_DUMP dumps every thread and ends the title when frames stop; bounded source reviewed; integration/device or full-stack validation pending.
#1661 f70293d56a46 no D3D12.X: route stream graphics PSOs through create_graphics_pso_tracked; bounded source reviewed; integration/device or full-stack validation pending.
#1674 874203435863 no Tests: offline compute pipeline test finds the driver blob with XCL_D…; bounded source reviewed; integration/device or full-stack validation pending.
#1691 f71cf2147ecd no D3D12.X: a queue the title releases is not kept alive by submit tracking; bounded source reviewed; integration/device or full-stack validation pending.
#1692 204625923242 no Recompiler: compact dispatch can switch in two levels (XCL_COMPACT_NEST); bounded source reviewed; integration/device or full-stack validation pending.
#1695 7372ef0f13fa no Recompiler: heap memory windows without a guard (min + null view), and the 64-bit atomics check; bounded source reviewed; integration/device or full-stack validation pending.
#1706 121bfea74639 no Tests: the D32S8 target test waits at most 10 s for its list; bounded source reviewed; integration/device or full-stack validation pending.
#1708 35ec9ebfae00 no D3D12.X: reuse the pipeline lookup when binding a stand-in; bounded source reviewed; integration/device or full-stack validation pending.
#1709 a57a76cd4a9c yes Recompiler: a pixel shader's ordered section uses rasterizer ordered views; bounded source reviewed; integration/device or full-stack validation pending.
#1720 94ecdd55d5f2 no Recompiler: v_pack_b32_f16 applies the abs and neg half modifiers; bounded source reviewed; integration/device or full-stack validation pending.
#1756 f86b01177dee no Scripts: stop shader precompile at a private commit budget; bounded source reviewed; integration/device or full-stack validation pending.
#1758 e2c7975dfaae no Shaders: report progress for every precompile record; bounded source reviewed; integration/device or full-stack validation pending.
#1776 3546d8dea095 no Tests: pin mesh dispatcher scratch and wave32-on-wave64 contract; bounded source reviewed; integration/device or full-stack validation pending.
#1792 f03d41181257 no kernelx: commit a mapping call's sparse pages once per run, not per page; bounded source reviewed; integration/device or full-stack validation pending.
#1793 e935debf939c no Direct DXIL: make multi-wave Compute and Mesh s_barrier early-exit-safe; bounded source reviewed; integration/device or full-stack validation pending.
#1798 55e7beb6de9f no D3D12.X: a draw does not wait for a graphics pipeline still being built; bounded source reviewed; integration/device or full-stack validation pending.
#1802 a01669b516e8 no shaders: benchmark direct DXIL PSO compilation; bounded source reviewed; integration/device or full-stack validation pending.
#1804 97e501e0dee3 no Shaders: --precompile --pipelines skips cached PSOs after canary check; bounded source reviewed; integration/device or full-stack validation pending.
#1826 7ae2bb71845c no Shaders: xcl pipelines --shard k/n splits the journal over processes; bounded source reviewed; integration/device or full-stack validation pending.
#1841 89724e5d4269 no Recompiler: round f16 add / sub / fma / ldexp results to nearest even; bounded source reviewed; integration/device or full-stack validation pending.
#1849 2cc2ba1ac89b no Scripts: measure NVIDIA PSOs with a temporary cache-off profile; existing scoped evidence; current integration/runtime pending.
#1903 13f5a7be9d1e no Tests: use the wave64 skip reason for per-lane DXIL; bounded source reviewed; integration/device or full-stack validation pending.
#1919 5835139244eb no Recompiler: LDS ds_sub_u32 hides its negation from the driver (RTX 50 refuses it); bounded source reviewed; integration/device or full-stack validation pending.
#1921 0c8f2928e938 no Tests: cover D3D12.X pipeline hooks and device extensions; bounded source reviewed; integration/device or full-stack validation pending.
#1936 6158c0cf82b4 yes D3D12.X: no VS, input layout or topology from the title in a mesh pipeline; bounded source reviewed; integration/device or full-stack validation pending.
#1942 f9c9df37703b no D3D12.X: persist both PSOs for translated mesh and geometry; existing scoped evidence; current integration/runtime pending.
#1956 a7217a4f6b1c yes Recompiler: DXC arguments come from one public function (arguments); bounded source reviewed; integration/device or full-stack validation pending.
#1962 5011a26413ed no README: XCL_PIPELINE_THREADS is only for xcl shaders --pipelines; bounded source reviewed; integration/device or full-stack validation pending.
#1997 f053f279fe89 no Shaders: bound direct sweep workers and report panics; bounded source reviewed; integration/device or full-stack validation pending.
#2001 008d9c1c443c no D3D12.X: offload PSO builds, defer lazy compile-on-draw, and wire mmap ID3D12PipelineLibrary1; bounded source reviewed; integration/device or full-stack validation pending.
#2018 908c454a5f0d no Recompiler: XCL_COMPACT_NEST=auto nests programs of 512 cases or more; bounded source reviewed; integration/device or full-stack validation pending.
#2025 eee2b862a16c no Recompiler: nest the compact dispatch of big programs by default; bounded source reviewed; integration/device or full-stack validation pending.
#2047 0e9ebc56978e no Shaders: restore direct DXIL cache ID after source deletion; bounded source reviewed; integration/device or full-stack validation pending.
#2052 b67c8f0cb5a6 yes D3D12.X: a wait an earlier signal covers does not make a signal a cycle; bounded source reviewed; integration/device or full-stack validation pending.
#2053 ea16145a4694 no D3D12.X: catch panics in async PSO builds so waiters and workers do not stall; bounded source reviewed; integration/device or full-stack validation pending.
#2057 4df1e6e3d40a yes D3D12.X: integration branch that reaches the in-world HUD on NVIDIA (reference, not for merge); existing scoped evidence; current integration/runtime pending.
#2067 9b35718ffd32 no Recompiler: emit per-instruction globallycoherent on compute flat memory (stacked on #1850); bounded source reviewed; integration/device or full-stack validation pending.
#2070 8cb43460c48b no Shaders: offline pipeline builds use the runtime workers' 64 MB stack; bounded source reviewed; integration/device or full-stack validation pending.
#2079 fa4bfd114933 no Direct DXIL: route split-wave64 GS-only entry through gate block; bounded source reviewed; integration/device or full-stack validation pending.
#2085 529d13f557a1 no Shaders: share compiled DXIL across pipeline builds; bounded source reviewed; integration/device or full-stack validation pending.
#2096 bb4dea405b5a no D3D12.X: XCL_PSO_MANIFEST=1 writes the order a run asks for its pipelines (#2088); bounded source reviewed; integration/device or full-stack validation pending.
#2097 d98d2d46131c no Recompiler: split wave64 compute groups of several waves across dispatches; bounded source reviewed; integration/device or full-stack validation pending.
#2098 d27d471b9373 no D3D12.X: scale huge pipeline compile slots with available CPUs; existing scoped evidence; current integration/runtime pending.
#2103 7743842ada44 no Direct DXIL: defer cold console_geometry during cached_only PSO probes; bounded source reviewed; integration/device or full-stack validation pending.
#2104 f1810d0c362e no Shaders: precompile compute pipelines through a recorded present; bounded source reviewed; integration/device or full-stack validation pending.
#2122 ddcda0184c4f no Recompiler: close four wave64-on-wave32 partition classifier soundness holes; bounded source reviewed; integration/device or full-stack validation pending.
#2125 765e475dbe83 no Docs: explain the NVIDIA driver-blob workaround under Wine; existing scoped evidence; current integration/runtime pending.
#2127 0e84e7406356 no Shaders: under Wine, at most 4 DXC compile threads by default; bounded source reviewed; integration/device or full-stack validation pending.
#2129 30a3ef1055ed no Scripts: cold driver benchmark of compute pipelines over thread counts (#2088); bounded source reviewed; integration/device or full-stack validation pending.
#2144 f8eeef4de89d yes D3D12.X: the looks line splits "the rest" and shows the longest look; bounded source reviewed; integration/device or full-stack validation pending.
#2146 52577f993895 no Recompiler: size a compute program's LDS block from its LDS_SIZE; bounded source reviewed; integration/device or full-stack validation pending.
#2177 244aa780c951 no Kernel.X: preserve GPU texture data when a physical page moves from home (stacked on #1182); bounded source reviewed; integration/device or full-stack validation pending.
#2210 c0d3729436c2 yes Recompiler: XCL_OUTLINE_EXCHANGE=0 keeps the split-wave64 rendezvous inline; bounded source reviewed; integration/device or full-stack validation pending.
#2220 419431cf03c2 no Shaders: trace offline precompile phases; bounded source reviewed; integration/device or full-stack validation pending.
#2224 85d79bf639d4 no D3D12.X: abort failed device batches and restore pending in title_textures::upload_all; bounded source reviewed; integration/device or full-stack validation pending.
#2252 da82f106813b no dxil: refuse wave64 VS/PS with upper-lane reads in 32-lane mode (#1895); bounded source reviewed; integration/device or full-stack validation pending.
#2270 b7f6b760e2ce no D3D12.X: unmap a superseded texture only once the work before it is done; bounded source reviewed; integration/device or full-stack validation pending.
#2288 5e502c50805e yes Recompiler: guard direct DXIL window stores with bit tests; bounded source reviewed; integration/device or full-stack validation pending.
#2291 4bad50562dd5 no Recompiler: a compute loop's passes shrink with the dispatch's size; bounded source reviewed; integration/device or full-stack validation pending.
#2297 739407b67a28 no D3D12.X: guard null and unreadable pointers in graphics and compute PSO hooks; bounded source reviewed; integration/device or full-stack validation pending.
#2299 4de52614fa58 no Recompiler: split direct compute programs that use guest LDS; bounded source reviewed; integration/device or full-stack validation pending.
#2301 c94ad8afe3a7 no Direct DXIL: compute programs over 1.5 MB of plain DXIL are retried in the compact form; bounded source reviewed; integration/device or full-stack validation pending.
#2302 30985d3f48b6 no Recompiler: replace tn[4]/id[4] local arrays in bvh_intersect with scalars; bounded source reviewed; integration/device or full-stack validation pending.
#2326 d65ae604ba81 yes Shaders: make static-sampler root signatures first, in one order; bounded source reviewed; integration/device or full-stack validation pending.
#2333 a7b93a853ec5 no D3D12.X: keep caller allocator for untracked lists and retain whole PSOs in dispatch_chain; bounded source reviewed; integration/device or full-stack validation pending.
#2341 45dbd47ccdfc no recomp: cap per-lane compute size so giant shaders use compact DXIL (#2203); bounded source reviewed; integration/device or full-stack validation pending.
#2343 3ec09d711cb1 no dxil: batch consecutive v_readfirstlane/v_readlane exchanges in split-wave64; bounded source reviewed; integration/device or full-stack validation pending.
#2344 c24f3e9743cf no DXIL split: prune piece-local features after optimize and transport f16/f64; bounded source reviewed; integration/device or full-stack validation pending.
#2348 bc43fd6dc403 no Recompiler: cube sc / tc negate by the sign bit on both backends; bounded source reviewed; integration/device or full-stack validation pending.
#2349 63131c64802a no Recompiler: split native wave32 compute groups beyond [32, 1, 1]; bounded source reviewed; integration/device or full-stack validation pending.
#2353 a81f9d536f15 no Recompiler: split single-wave compute groups of any shape; bounded source reviewed; integration/device or full-stack validation pending.
#2356 ff9716539139 yes Recompiler: compress per-class branch targets in direct DXIL compact; bounded source reviewed; integration/device or full-stack validation pending.
#2377 0c446533681f no Recompiler: split-wave64 one-wave groups can meet at a group barrier (opt-in, XCL_WAVE64_BARRIER=1); existing scoped evidence; current integration/runtime pending.
#2385 4c4c5772f74c no D3D12.X: sampled textures go without their top mips while video memory fills up; existing scoped evidence; current integration/runtime pending.
#2398 e9d7aefc3a18 no DXIL: saturate 16-bit integer valu16 ops when CLAMP=1; bounded source reviewed; integration/device or full-stack validation pending.
#2409 1ee46bda18ef no D3D12.X: record first use of synchronously created compute PSOs; bounded source reviewed; integration/device or full-stack validation pending.
#2417 1a51cb95ebd7 no D3D12.X: retain resolved async pipelines until reset and retirement; bounded source reviewed; integration/device or full-stack validation pending.
#2423 63ea17f3cf85 no Recompiler: prioritize wanted DXC compiles and reserve worker headroom; bounded source reviewed; integration/device or full-stack validation pending.
#2427 c8c2b7a6b19d no Recompiler: direct DXIL reads heap memory windows without a branch; bounded source reviewed; integration/device or full-stack validation pending.
#2428 c6e5af8690fc no Recompiler: NVIDIA compute programs take flat heap windows by default; existing scoped evidence; current integration/runtime pending.
#2440 633b1e4213c3 yes Tests: exercise direct geometry in expanded heap windows; bounded source reviewed; integration/device or full-stack validation pending.
#2448 d61ffdc435d5 no D3D12.X: canonicalize inactive two-pass stream descriptors; existing scoped evidence; current integration/runtime pending.
#2469 44a66e63d717 no D3D12.X: reuse split dispatch scratch when growth fails; bounded source reviewed; integration/device or full-stack validation pending.
#2495 bbcfc3818168 yes Scripts: reject invalid or stale cold PSO benchmark results; existing scoped evidence; current integration/runtime pending.
#2496 2e8ff6b6ce0c no Recompiler: an access may take its base address's window (XCL_WINDOW_NO_CARRY); bounded source reviewed; integration/device or full-stack validation pending.
#2500 b17262c485cc no xcl run: a profile-tracy build records a Tracy timeline of the run; bounded source reviewed; integration/device or full-stack validation pending.
#2515 f655cfdac728 yes Shaders: --pipelines blobs are made as a title's run asks for them; bounded source reviewed; integration/device or full-stack validation pending.
#2523 8b290bf2944d yes D3D12.X: MakeResident and Evict give the driver the pipeline behind a stand-in; bounded source reviewed; integration/device or full-stack validation pending.
#2526 0fd22d04dc79 yes D3D12.X: compute pipelines not used for a while are released on NVIDIA; existing scoped evidence; current integration/runtime pending.
#2540 f5cb7eaa1c54 no Recompiler: validate DXIL containers and split pieces in translated cache; bounded source reviewed; integration/device or full-stack validation pending.
#2543 12141ccbfa16 no D3D12.X: clear dispatch_chain shared scratch on list lifecycle transitions; bounded source reviewed; integration/device or full-stack validation pending.
#2548 c0d09204145a no D3D12.X: Reset, KickoffX and CreateCommandList do not wait for a compute pipeline still being built; bounded source reviewed; integration/device or full-stack validation pending.
#2551 3567b2efdc94 no Shaders: --precompile --pipelines also builds a split program's whole form; bounded source reviewed; integration/device or full-stack validation pending.
#2552 84f6bdc97a46 no Recompiler: fold finite constant legacyF16ToF32 conversions in direct DXIL; bounded source reviewed; integration/device or full-stack validation pending.
#2557 2a1fadcf8eb4 no Recompiler: generalize bitmask and zero-shift folding via known_nonzero_bits; bounded source reviewed; integration/device or full-stack validation pending.
#2559 7bf48538afde no Recompiler: simplify bfm / s_bfm_b64 and lower ffbh_i to FirstbitSHi in direct DXIL; bounded source reviewed; integration/device or full-stack validation pending.
#2565 97376ee13636 no Recompiler: lower 32-bit VALU add/sub with carry without i64 in direct DXIL; bounded source reviewed; integration/device or full-stack validation pending.
#2566 72e94879f268 yes Diagnostics: label translated pipelines in PIX captures; bounded source reviewed; integration/device or full-stack validation pending.
#2567 3c0fc4b96a6b no Recompiler: share scalar-load bodies in direct DXIL compute shaders; bounded source reviewed; integration/device or full-stack validation pending.
#2568 4094ff9cb9c3 no Recompiler: simplify integer min/max (dx.op.binary.i32) via range bounds and absorption in direct DXIL opt; bounded source reviewed; integration/device or full-stack validation pending.
#2571 ad0ded91d9fa no Recompiler: direct PS compares skip the per-quad mask where no helper bit is read; bounded source reviewed; integration/device or full-stack validation pending.
#2572 af2cecc40886 no Nvidia dev; existing scoped evidence; current integration/runtime pending.
#2574 e2aae0e87df1 no D3D12.X: persist slow driver blobs past the RAM cache cap (#1833); bounded source reviewed; integration/device or full-stack validation pending.
#2581 d5d694b04b3e no D3D12.X: with bounded pipeline waits, dispatches are not put off to the submit; bounded source reviewed; integration/device or full-stack validation pending.
#2585 2066b32e5d12 no DXC: keep LINK_GATE open on OOM and forward opt/extra args to IDxcLinker::Link; bounded source reviewed; integration/device or full-stack validation pending.
#2594 ae921b40fc1f yes Shaders: reuse the file buffer when loading unsplit cache entries; bounded source reviewed; integration/device or full-stack validation pending.
#2603 88c0f1481ff2 no Tests: isolate the streamed-texture recheck fixture; bounded source reviewed; integration/device or full-stack validation pending.
#2613 2d229b9f76b6 no Shaders: warm runtime-selected graphics DXIL variants in --precompile; bounded source reviewed; integration/device or full-stack validation pending.
#2614 cd7be10ff02b no D3D12.X: preserve replaced driver blobs after stale rejection; existing scoped evidence; current integration/runtime pending.
#2621 aad6434c1c6a no D3D12.X: preserve extended state in translated graphics PSO streams; bounded source reviewed; integration/device or full-stack validation pending.
#2622 f0f9daee2d7e no D3D12.X: a put-off call's segment that does not close is not submitted; bounded source reviewed; integration/device or full-stack validation pending.
#2628 8b15baee713b no D3D12.X: a worker waiting for a big compile turn leaves the queue to a helper; bounded source reviewed; integration/device or full-stack validation pending.
#2629 8bfaa12f1fdf no D3D12.X: a split program's failed whole build is not tried again; bounded source reviewed; integration/device or full-stack validation pending.
#2641 c9751948934e no Recompiler: simplify direct DXIL frexp_mant, frexp_exp, and alignbit helpers; existing scoped evidence; current integration/runtime pending.
#2652 88d7b0a19a27 no Recompiler: serialize dxc::wait_for_memory slot admission (#2463); bounded source reviewed; integration/device or full-stack validation pending.
#2697 50cfb321be82 no D3D12.X: a memory line by owner, against DXGI's budget; existing scoped evidence; current integration/runtime pending.
#2704 9b6811395e23 no Shaders: include HEAP_FLAT in offline precompile runtime_windows; bounded source reviewed; integration/device or full-stack validation pending.
#2705 231c4f1d06b5 no xcl run: preparation workers count the commit left in MiB, not bytes; existing scoped evidence; current integration/runtime pending.
#2706 f614add84d53 yes D3D12.X: preserve the NVIDIA world-streaming integration; existing scoped evidence; current integration/runtime pending.
#2711 dfead3702a1e yes Recompiler: canonicalize split compute pieces and prune unused bindings (#2088); existing scoped evidence; current integration/runtime pending.
#2717 23d313161e3a no D3D12.X: a mid-list split gets its next segment before it closes the list; bounded source reviewed; integration/device or full-stack validation pending.
#2723 2d14195e83eb no D3D12.X: share dispatch-chain root signatures per device and key compute blobs on NodeMask; existing scoped evidence; current integration/runtime pending.
#2725 ad9172c015a8 no D3D12.X: a title allocator takes a free spare another one put aside; existing scoped evidence; current integration/runtime pending.
#2728 ae5a2f99b02e yes README: document xcl shaders --precompile --limit; existing scoped evidence; current integration/runtime pending.
#2739 e58cd9e7945f no shaders: distinguish precompiled PSOs from saved driver blobs; bounded source reviewed; integration/device or full-stack validation pending.
#2740 9ecae592ea3a no D3D12.X: persist compute blobs when the RAM cache is full; existing scoped evidence; current integration/runtime pending.
#2749 9cfa7536e978 no D3D12.X: split sparse readback spin and submission out of STATE lock; bounded source reviewed; integration/device or full-stack validation pending.
#2750 44a7e6fe3431 no D3D12.X: count the resources XCL makes for itself, by where it makes them; existing scoped evidence; current integration/runtime pending.
#2755 4bb6b30fc5b1 no D3D12.X: preserve used-pipeline key on RT-gated compute stand-ins; bounded source reviewed; integration/device or full-stack validation pending.
#2761 7cbc65139995 no Recompiler: use u128 dependency masks for reload invalidation; bounded source reviewed; integration/device or full-stack validation pending.
#2764 24695174b1c1 no D3D12.X: a placed view's padding does not make a second texture; bounded source reviewed; integration/device or full-stack validation pending.
#2781 e1e5bbf0d9bd no Recompiler: Wave32 pixel mask writes kill one SGPR, not a pair; bounded source reviewed; integration/device or full-stack validation pending.
#2786 7587c01324cf no D3D12.X: add opt-in first-demand capture sidecar for Chain::whole fallbacks; bounded source reviewed; integration/device or full-stack validation pending.
#2788 2331f2ea810c no Tests: a console MS in the AS slot is refused by its MS translation; bounded source reviewed; integration/device or full-stack validation pending.
#2789 ed13531a2869 no Build: hash the translator sources of the tree being built; bounded source reviewed; integration/device or full-stack validation pending.

Confirmed semantic overlap is being retained where policy, target branch, residual behavior or unmerged prerequisites differ. A partial overlap is not a complete duplicate. No full-stack runtime certification is implied for this umbrella PR.

AI use: Codex (GPT-6) reviewed source with independent cross-checks, executed the selected local fixtures and reconciled raw results; historical evidence is kept separate. Optional temporary Discord for coordinating contributor work, testing and comparing results.

**@⁠Prime1997** on GitHub · 2026-11-26 13:53 UTC · [original](https://github.com/xcl-dev/xcl/pull/2572#pullrequestreview-6075300896) · **reviewed** **NVIDIA-related PR status — bounded review, 26 November 2026.** This records the discovered 13:22 UTC cohort across all target branches, including drafts: **288 open PRs, 46 drafts: 24 good within the reviewed scope,62 need changes, 202 blocked.** #2791 was subsequently rechecked and retested at 749b0e06. Other rows identify the cutoff head; later pushes require a new review. Ten unrelated candidates and two externally closed PRs are excluded. This is not an exhaustive audit of all 1492 open PRs. Current main is `b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7`; this NVIDIA stack is `af2cecc40886a8682ecf3267f5328c6dc4b66ad7`:0 main-only / 371 NVIDIA-only commits. Targets in this cohort:272 main, 12 nvidia-dev, 4 amd-dev. **Meaning of the statuses:** good means useful within the named source or targeted-test scope, not merge approval. Needs changes includes implementation defects, inherited stack prerequisites, unsafe/inaccurate fixtures and reporting errors; it does not mean every issue was introduced by that PR. Blocked means current integration, full stack, platform or device validation is incomplete. Draft status, conflicts and overlap alone are never closure reasons. No PR was closed in this pass. **Measured:** 86 CPU passes across 30 distinct CPU source/test variants, plus 1 CPU-only query fixture in the device harness; 9 device-fixture passes; negative controls 2 passed / 6 expected failures; 3 synthetic script runs passed. Four repeat baseline passes are excluded. Failed/deferred setup attempts remain separate; an old-DXC failure was resolved using a private DXC 1.9 copy. No ignored/skip result is counted as coverage. Tests include current-main baselines and 12 isolated PR integrations; other reports identify clean PR heads or local repairs. Counts overlap across revisions and are not one whole-suite run. The worker/adapter fixes remain local, including contributor #2705 plus #2712/#2555 integration. The #2731 local repair passed 6 checks after reproducing the stale-ownership failure. The refreshed #2791 passed its CPU query-failure fixture and both device fixtures, with 19 tiling cases on RTX 3060 Ti. Whole-suite/retail validation, AMD comparison, real multi-adapter recovery and the large PSO-memory benchmark remain unperformed. All native work used isolated sources, the shared lock and game-idle guards; this review made no installation or game-data change. The cohort is accounted through 243 bounded exact-head source reviews, 10 public scoped reviews and 35 existing scoped receipts whose limits remain explicit. Bounded source review can cover an owned delta and relevant callers without certifying its entire inherited stack. Individual reports below preserve exact variants, selected tests and exclusions. <details><summary>Good within the reviewed scope: 24 PRs</summary> | PR | Head | Draft | Scope / next action | |---|---|---|---| | #857 | `aaf8aa16809d` | no | Docs: the wave64-on-wave32 note calls closed PR #33 a draft; bounded source/script review only. | | #1262 | `aa9c75a49cee` | no | Docs: the split-wave64 exchange spins by default, since PR #798; bounded source/script review only. | | #1270 | `5e4d91a7fe2c` | no | Scripts: smoke.ps1 reads the log of a run it killed on timeout; bounded source/script review only. | | [#2179](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2179) | `9483d4363b9c` | no | Shaders: gate offline --pipelines large DXIL builds on commit headroom; targeted result in linked report; remaining validation applies. | | [#2332](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2332) | `ab861b819677` | yes | D3D12.X: check shader cache capacity before copying entries; targeted result in linked report; remaining validation applies. | | [#2350](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2350) | `4cd2bc20cc28` | yes | D3D12.X: plan split-dispatch slabs without heap allocations; targeted result in linked report; remaining validation applies. | | [#2424](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2424) | `89bbbb4995b4` | yes | D3D12.X: keep inline split pipeline pieces on the foreground path; targeted result in linked report; remaining validation applies. | | [#2426](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2426) | `9c178b2d6499` | no | D3D12.X: a create that fails on a lost device keeps the driver's blob; targeted result in linked report; remaining validation applies. | | [#2437](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2437) | `e4269721c279` | no | D3D12.X: the per-draw mirror sync copies without asking readable(); targeted result in linked report; remaining validation applies. | | [#2475](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2475) | `398cefbcd74a` | no | Recompiler: count split shader pieces in the cache budget; targeted result in linked report; remaining validation applies. | | [#2532](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2532) | `bb33ceed26be` | no | D3D12.X: reserve split compute scratch before allocating it; targeted result in linked report; remaining validation applies. | | [#2535](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2535) | `1e4a2c787a07` | no | Recompiler: the rerouted shader cache checks fresh DXIL and chain pieces; targeted result in linked report; remaining validation applies. | | [#2579](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2579) | `93445592be14` | no | D3D12.X: a build a submit waits for is wanted from the moment its call is put off; targeted result in linked report; remaining validation applies. | | #2687 | `df0b92ae87ff` | no | Document shared cache history for used-only precompile; bounded source/script review only. | | [#2729](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2729) | `93e66c197c27` | no | D3D12.X: instrument submitting-thread call breakdown under XCL_LOOK_STATS=2; targeted result in linked report; remaining validation applies. | | #2765 | `d7fab00e9e8a` | no | README: translation-only --precompile; --measure-pso needs Developer Mode; bounded source/script review only. | | [#2767](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2767) | `a173e209151f` | no | Recompiler: share translated DXIL across repeated pipeline builds; targeted result in linked report; remaining validation applies. | | [#2768](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2768) | `936bb90e17e7` | no | D3D12.X: anchor XCL_LOOK_SKIP per frame and clear CLOSED on list reset/release; targeted result in linked report; remaining validation applies. | | [#2770](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2770) | `7a7e161d907c` | no | Tests: wait for late release before checking released pipelines are gone; targeted result in linked report; remaining validation applies. | | [#2771](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2771) | `6b2691e18b02` | yes | Tests: some_ranges in texture_upload wraps its generator instead of overflowing; targeted result in linked report; remaining validation applies. | | [#2773](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2773) | `0c0a7aa4ef1c` | yes | Tests: a page's failed move goes to an address Windows never hands out; targeted result in linked report; remaining validation applies. | | [#2777](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2777) | `e59d1d11043b` | yes | Shaders: keep `xcl shaders` out of EcoQoS execution-speed throttling; targeted result in linked report; remaining validation applies. | | [#2790](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2790) | `ccb14f7f653d` | no | D3D12.X: stencil views get a uint T# format, so shaders load them as integers; targeted result in linked report; remaining validation applies. | | [#2791](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2791) | `749b0e06c186` | no | Tests: add AMD vs NVIDIA D3D12 tiling, budget, and pipeline memory parity suite; targeted result in linked report; remaining validation applies. | </details> <details><summary>Needs changes: 62 PRs</summary> | PR | Head | Draft | Scope / next action | |---|---|---|---| | #245 | `2fcb0950de68` | no | Include partial-wave optimizer source in translated-cache invalidation. | | #546 | `720143505d92` | yes | Correct wave64 reporting on wave32-only hardware. | | #562 | `8ec2a46974d3` | no | Fence assignment and enqueue can reorder same-queue payloads; baseline gap also remains. | | [#688](https://git.gtahub.st/github/xcl-dev--xcl/pulls/688) | `760f742b4238` | no | Retry ordinary DXC creation after optional private-heap/factory failure. | | #759 | `dd66d20995e2` | yes | Reject missing/invalid bounds and validate input before starting work. | | #827 | `44d69219872a` | no | Sweep weak shader entries; Weak slice allocations otherwise retain backing bytes. | | #924 | `a2b500731907` | no | Record successful signals separately from rejected attempts. | | #977 | `47fb4bb5a831` | no | Short-circuit a failed backend probe before the next device probe. | | #1006 | `ec5bac99305d` | no | Retain pending-save state when persistence fails. | | #1102 | `c387de21fa81` | yes | Track mapping/content changes so GPU-written state cannot hide later CPU writes. | | #1168 | `0840ff5a690c` | no | Publish queued state and count without exposing decrement-before-increment. | | [#1193](https://git.gtahub.st/github/xcl-dev--xcl/pulls/1193) | `5ae60ad0a9ba` | no | Include pre-body loop-budget exhaustion in EXEC analysis; local4-test repair passes. | | #1385 | `875a60352ed3` | no | Revalidate mapping generation before copying old readback bytes after unlocking. | | #1442 | `293584e0078a` | no | Validate or saturate reserve-to-byte conversion. | | #1620 | `3a185909fe54` | no | Correct the bpermute reference oracle using native half-wave semantics. | | #1630 | `91ae2c62e89f` | no | Preserve low-address carry when choosing scalar-load memory windows. | | #1638 | `2639c0806ef2` | no | Bound handshake/reply waits and failure fallback before claiming a worker cap. | | #1643 | `7711f4c55672` | no | Serialize fence/payload ordering and add queue-lifetime cleanup. | | #1665 | `cd46e3fc2bd9` | no | Allow recovery from transient failures instead of permanently suppressing wanted work. | | #1710 | `89faa8d3fd63` | no | Make alone-retry admission atomic relative to normal entrants. | | #1723 | `fca46d42e5a1` | no | Restore nested/thread-local cap state on all exits, including unwind. | | #1762 | `3cd15cb7e896` | yes | Reserve the working slot atomically with admission; spacing alone leaves a race. | | #1809 | `f090104a9c16` | no | Use the selected stage backend consistently in cache identity. | | #1819 | `0062ee19f59c` | no | Preserve same-queue enqueue order and unblock fixture GPU waits before assertions. | | #1830 | `6423b67d9d42` | no | Timeouts must not leave overlapping benchmark work; bound discovery too. | | #1871 | `27362a08509c` | no | Reject a trailing --records instead of starting unbounded whole-pack work. | | #1883 | `327abc816d36` | no | Report the early-return case through standard skip accounting. | | #1924 | `c09d37689f16` | no | Reserve aggregate BIG/GIANT capacity atomically across both lanes. | | #1931 | `e870dd2b576f` | yes | Reserve frame allowance atomically and settle against the original frame. | | #2009 | `2f490889758f` | no | Do not signal successful title completion when readback settling fails. | | #2010 | `d30e9a969c20` | no | Label distinct error reasons accurately and preserve unavailable telemetry. | | #2114 | `21c88bc26b60` | no | Preserve compute producers under defaults and synchronize demand priority changes. | | #2208 | `e4720ca15041` | no | Recheck device loss after queued work obtains admission. | | [#2229](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2229) | `3ce7f30fa5ea` | no | Preserve constant/SDWA source alternatives and invalidate affected cache identity. | | #2234 | `70d5f59b42a6` | no | Correct documentation that assigns all cache-miss rebuilding to the title thread. | | #2246 | `949609b2ee21` | no | Gate stale-blob cold retries through large-compute admission. | | #2327 | `e56c368079bb` | yes | Invalidate legacy default cache identity, not only explicit SAFE_BARRIER=0. | | #2404 | `5b9d4ff6f5f4` | no | Prevent first-call indirect chain truncation while whole fallback is unavailable. | | #2422 | `349970c0a7ad` | no | Address or explicitly scope the disclosed concurrent-final-release gap. | | #2438 | `90bfbd423fe3` | no | Report the actual benchmark backend and cache provenance. | | #2439 | `336c6c2eeafb` | yes | Handle device-removed fence sentinels and recorded completion-publication gaps. | | #2446 | `3a71471c80b8` | no | Invalidate graphics reload facts for SDWA scalar destinations. | | #2519 | `50af98ed1f5e` | no | Remove forbidden bundle barriers and resolve multi-piece ordering/lifetime gaps. | | [#2547](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2547) | `60349e51011d` | no | Complete submit-owned builds as failed after a caught panic; local repair passes. | | #2554 | `ca6f17b1cf4e` | no | Stop on failed whole fallback and enforce expanded dispatch-axis limits. | | [#2555](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2555) | `5bec587753dd` | no | Match startup adapter fallback to title selection; local injected tests pass. | | #2558 | `2dc76ac89461` | no | Retain submitted texture resources through failed fence setup/wait recovery. | | #2590 | `004fa0f61f9c` | yes | Verify driver-profile ownership/content before modification or deletion. | | #2611 | `445129ba178e` | no | Capture RTV/DSV ownership before legal descriptor overwrite/free. | | #2615 | `a0734c9f0931` | no | Preserve pending compute producers under the default wait policy. | | #2633 | `19be65904f91` | yes | Resolve inherited first-call chain coverage before integrating root-CBV improvement. | | #2635 | `24e584cab160` | no | Bound initial lock/I/O paths and account for batches already owned by writer. | | #2670 | `ca6a0cc0e8f5` | no | Do not count cached two-pass work without trace metadata as a cold build. | | [#2712](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2712) | `8b113eeb3e30` | yes | Correct worker error classification, adapter forwarding and recovery fixtures. | | #2726 | `71f30c6fe84f` | no | Inject commit headroom and avoid unconditional join after the timeout. | | #2730 | `2e63cbcf565d` | no | Rename lifetime created-SRV coverage currently labelled srv-sampled. | | [#2731](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2731) | `2f2bb070fafc` | no | Clear stale SRV ownership after UAV replacement; local6-test repair passes. | | #2762 | `496ef5780a45` | no | Distinguish failed null cache entries from retained textures. | | [#2772](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2772) | `18b34a9d992f` | yes | Retain ownership metadata after failed memory release; local5-test repair passes. | | #2776 | `d485694b2161` | no | Compare raw optional usage when selecting the peak ownership snapshot. | | #2782 | `b755223752d7` | no | Publish drained free descriptors without a retired/free availability gap. | | #2792 | `bfff51a7a366` | yes | Handle negative SDK batch returns and worker creation failure; feature build untested. | </details> <details><summary>Blocked pending validation: 202 PRs</summary> | PR | Head | Draft | Scope / next action | |---|---|---|---| | #172 | `ca66c4aeb0de` | yes | Recompiler: structured form for programs that needed the pc chain; existing scoped evidence; current integration/runtime pending. | | #202 | `6c6b000705e5` | no | Recompiler: complete remaining RDNA2 integer CLAMP=1 saturation (#105); existing scoped evidence; current integration/runtime pending. | | #214 | `96e68a46b2b2` | no | D3D12.X: bound driver PSO compile concurrency and surface stage progress (#156); existing scoped evidence; current integration/runtime pending. | | #242 | `ff28e60b41e0` | no | D3D12.X: R9G9B9E5 render targets / UAVs are half floats where the device refuses them (retail title, Series S); existing scoped evidence; current integration/runtime pending. | | #541 | `6bd8f6410400` | no | D3D12.X: a console MS in the AS slot is translated as the mesh shader it is; bounded source reviewed; integration/device or full-stack validation pending. | | #572 | `14d638a3ab3c` | yes | Shaders: bound default compile workers by available memory; bounded source reviewed; integration/device or full-stack validation pending. | | #591 | `6c68cc703df3` | no | dxc: hash arguments into the DXIL cache key and honor XCL_DXC_ARGS (#559); bounded source reviewed; integration/device or full-stack validation pending. | | #613 | `920c3807df84` | yes | Recompiler: honor DXC overrides with warm translation caches; bounded source reviewed; integration/device or full-stack validation pending. | | #628 | `766b66123528` | no | D3D12.X: prioritize graphics pipelines in the async PSO worker pool; bounded source reviewed; integration/device or full-stack validation pending. | | #642 | `f1e90c149b5f` | no | Shaders: honor --precompile for a single shader file; bounded source reviewed; integration/device or full-stack validation pending. | | #645 | `aee6962bc639` | no | Tests: report disabled async compute PSO as skipped; bounded source reviewed; integration/device or full-stack validation pending. | | #663 | `ad0f0cd1d13f` | no | Tests: cover 3D wave64 compute through the D3D12.X PSO hook; bounded source reviewed; integration/device or full-stack validation pending. | | #757 | `4e8aaf4b393c` | yes | D3D12.X: the PC desc of a translated VS / PS pipeline in its own function; bounded source reviewed; integration/device or full-stack validation pending. | | #758 | `c02d05921a5d` | yes | D3D12.X: a journal of the pipelines a title queues (<data>\cache\pipelines.bin); bounded source reviewed; integration/device or full-stack validation pending. | | #768 | `953f9ee0ce38` | no | D3D12.X: copy from the backing pages of GPU-only views; bounded source reviewed; integration/device or full-stack validation pending. | | #789 | `bc82410abd9c` | no | D3D12.X: decommit released sparse blocks outside the driver callback; existing scoped evidence; current integration/runtime pending. | | #820 | `0488eceb1f4c` | no | D3D12.X: XCL_BIG_COMPILES sets how many big compute pipelines the driver builds at once; bounded source reviewed; integration/device or full-stack validation pending. | | #828 | `b1530ac54544` | no | D3D12.X: optional graphics-only pipeline preloading; bounded source reviewed; integration/device or full-stack validation pending. | | #877 | `a553a22486ac` | no | Memory: lazily map sparse VRAM tiles for Wine graphics heaps (#175); bounded source reviewed; integration/device or full-stack validation pending. | | #881 | `76dcb8f560bd` | no | Title textures: one upload batch moves its textures in two barrier calls; bounded source reviewed; integration/device or full-stack validation pending. | | #889 | `a39c3992c7a4` | no | D3D12.X: compute pipelines are built ahead of their first bind; bounded source reviewed; integration/device or full-stack validation pending. | | #898 | `dc4300da36da` | no | D3D12.X: journal a pipeline when the title first binds it; bounded source reviewed; integration/device or full-stack validation pending. | | #899 | `734e6e78b004` | no | D3D12.X: log how long a bind waits for a pipeline still being built; bounded source reviewed; integration/device or full-stack validation pending. | | #900 | `2817c7c6ee17` | no | Recompiler: keep the split wave64 halves' scalar state wave-uniform; bounded source reviewed; integration/device or full-stack validation pending. | | #902 | `90d70031f179` | no | D3D12.X: the driver's blob of a slow graphics pipeline is kept on disk; bounded source reviewed; integration/device or full-stack validation pending. | | #904 | `7c2ccd9b777f` | no | D3D12.X: draws find their pipeline facts and list state without global locks; bounded source reviewed; integration/device or full-stack validation pending. | | #917 | `709abd7fe1a5` | no | Recompiler: shadow v_writelane spill slots in split-wave64; bounded source reviewed; integration/device or full-stack validation pending. | | #941 | `91ca6cec4ddd` | no | Tests: cover graphics PSO hooks on the GPU without game files; bounded source reviewed; integration/device or full-stack validation pending. | | #944 | `e22a0a6e781b` | no | Recompiler: batch consecutive v_readfirstlane/v_readlane exchanges in…; bounded source reviewed; integration/device or full-stack validation pending. | | #969 | `23eb733a0faf` | no | Tests: cover textured graphics PSOs and static samplers on the GPU; bounded source reviewed; integration/device or full-stack validation pending. | | #1022 | `7e1b659cfcd9` | no | Recompiler: ds_bpermute_b32 in wave64 stays in each 32-lane half (#772); bounded source reviewed; integration/device or full-stack validation pending. | | #1045 | `fcc2fd20186a` | no | D3D12.X: distinguish the Wait64 signal queue from recording history; bounded source reviewed; integration/device or full-stack validation pending. | | #1055 | `f532d33d695a` | no | kernelx: queue CopyPageMappingsBatchX records the physical page each GPU-view page shows; existing scoped evidence; current integration/runtime pending. | | #1111 | `c29bbad8cafb` | no | Recompiler: propagate split-wave64 lane-local masks through 64-bit bitwise SALU ops; bounded source reviewed; integration/device or full-stack validation pending. | | #1113 | `8aef2946818b` | no | D3D12.X: only a title's run reads and writes used-pipelines.txt; bounded source reviewed; integration/device or full-stack validation pending. | | #1123 | `c6db70c71fcf` | no | D3D12.X: the GPU-wait watchdog says where a chain of waits ends; bounded source reviewed; integration/device or full-stack validation pending. | | #1215 | `757ece9795bc` | no | Recompiler: bound descriptor heap indices from T# and S# words to the heap; bounded source reviewed; integration/device or full-stack validation pending. | | #1232 | `9af37dc2466a` | no | Shaders: count reused compute shaders as cache hits; bounded source reviewed; integration/device or full-stack validation pending. | | #1241 | `7b7c85359bec` | no | Recompiler: clamp out-of-range format and sub-dword buffer loads; bounded source reviewed; integration/device or full-stack validation pending. | | #1244 | `71d3a384d9b3` | no | Recompiler: split wave64 spin loops poll with a compare-exchange, not an add of 0 (#847); bounded source reviewed; integration/device or full-stack validation pending. | | #1252 | `ec00d67e5075` | no | Recompiler: split wave64 halves meet before each LDS access; bounded source reviewed; integration/device or full-stack validation pending. | | #1254 | `d88c2aa0fca8` | no | D3D12.X: the shared view heap logs how full it gets; bounded source reviewed; integration/device or full-stack validation pending. | | #1279 | `d2eb1b4da080` | yes | Shaders: --pipelines makes programs of 4 MB DXIL or more last, by name; bounded source reviewed; integration/device or full-stack validation pending. | | #1315 | `0d7907b385de` | no | Recompiler: compact form that emits every distinct block text once; bounded source reviewed; integration/device or full-stack validation pending. | | #1331 | `e860e83a1178` | no | D3D12.X: hold BASES lock across DEPTH_BIAS_PSOS in depth_bias_pso and forget_base; bounded source reviewed; integration/device or full-stack validation pending. | | #1363 | `3d035cfb6fcd` | no | Tests: skip offline compute PSO checks when D3D12 is unavailable; bounded source reviewed; integration/device or full-stack validation pending. | | #1364 | `0da4c3589012` | no | Recompiler: fix the race for the last wanted DXC slot; bounded source reviewed; integration/device or full-stack validation pending. | | #1368 | `0074749a9678` | no | D3D12.X: translated compute pipelines are made with node mask 0; bounded source reviewed; integration/device or full-stack validation pending. | | #1380 | `7d43a468169f` | no | Recompiler: big compute programs read their memory windows without a switch; bounded source reviewed; integration/device or full-stack validation pending. | | #1396 | `ca0e1b06d85f` | no | Shaders: restore cache-only state across nesting and unwinding; bounded source reviewed; integration/device or full-stack validation pending. | | #1398 | `36e23fddc939` | no | D3D12.X: retry driver-rejected compute PSOs without DXC GVN (#756); bounded source reviewed; integration/device or full-stack validation pending. | | #1410 | `b63a67b175d8` | no | D3D12.X: log once which form wave64 programs get, and why (#1407); bounded source reviewed; integration/device or full-stack validation pending. | | #1413 | `190c97e2c357` | no | Shaders: XCL_SAFE_BARRIER turns the translation caches off (#1409); bounded source reviewed; integration/device or full-stack validation pending. | | #1417 | `9a3230fa2027` | no | Shaders: reserve compiler memory slots atomically; bounded source reviewed; integration/device or full-stack validation pending. | | #1420 | `867d307572af` | no | D3D12.X: separate compute driver blobs by static sampler state; bounded source reviewed; integration/device or full-stack validation pending. | | #1421 | `7124a95392e1` | no | D3D12.X: replace busy copy scratch within budget; bounded source reviewed; integration/device or full-stack validation pending. | | #1428 | `7dbd80c275e4` | no | D3D12.X: dispatches of more than 65 535 groups in X are folded into Y; existing scoped evidence; current integration/runtime pending. | | #1469 | `188f8ac84f4b` | no | Tests: verify offline compute pipeline blobs are reused at runtime; bounded source reviewed; integration/device or full-stack validation pending. | | #1477 | `86df8e857eed` | no | D3D12.X: fix console_list::cl_reset initial PSO/rollback, oversized push, and null constants; bounded source reviewed; integration/device or full-stack validation pending. | | #1502 | `c65e2c8b459d` | yes | Shaders: --precompile --processes N builds in N processes; bounded source reviewed; integration/device or full-stack validation pending. | | #1529 | `3386385bb1b7` | no | Shader compile time: DXC compiles without lifetime markers; bounded source reviewed; integration/device or full-stack validation pending. | | #1552 | `e25f6d3a94e8` | no | D3D12.X: XCL_BACKGROUND_COMPILES=0 stops the driver's second compiles; bounded source reviewed; integration/device or full-stack validation pending. | | #1596 | `524b25c1b7da` | no | Recompiler: split-wave64 EXEC is exchanged only where it is read whole; bounded source reviewed; integration/device or full-stack validation pending. | | #1597 | `6acbfb1f4d57` | no | Recompiler: a split-wave64 bitwise mask tree exchanges once, at its end; bounded source reviewed; integration/device or full-stack validation pending. | | #1601 | `0003178b8c8b` | no | D3D12.X: guard disk_stores removal on ShaderCacheSession SetDeleteOnDestroy; bounded source reviewed; integration/device or full-stack validation pending. | | #1637 | `b8d92f997eba` | no | Tests: cover split-wave64 mask liveness and mesh_wave analysis; bounded source reviewed; integration/device or full-stack validation pending. | | #1652 | `5829b34f8efb` | yes | d3d12x: bound PSO bind waits, guard pending draws, and auto-init uninitialized targets; bounded source reviewed; integration/device or full-stack validation pending. | | #1656 | `8510ca021834` | no | xcl run: XCL_STALL_DUMP dumps every thread and ends the title when frames stop; bounded source reviewed; integration/device or full-stack validation pending. | | #1661 | `f70293d56a46` | no | D3D12.X: route stream graphics PSOs through create_graphics_pso_tracked; bounded source reviewed; integration/device or full-stack validation pending. | | #1674 | `874203435863` | no | Tests: offline compute pipeline test finds the driver blob with XCL_D…; bounded source reviewed; integration/device or full-stack validation pending. | | #1691 | `f71cf2147ecd` | no | D3D12.X: a queue the title releases is not kept alive by submit tracking; bounded source reviewed; integration/device or full-stack validation pending. | | #1692 | `204625923242` | no | Recompiler: compact dispatch can switch in two levels (XCL_COMPACT_NEST); bounded source reviewed; integration/device or full-stack validation pending. | | #1695 | `7372ef0f13fa` | no | Recompiler: heap memory windows without a guard (min + null view), and the 64-bit atomics check; bounded source reviewed; integration/device or full-stack validation pending. | | #1706 | `121bfea74639` | no | Tests: the D32S8 target test waits at most 10 s for its list; bounded source reviewed; integration/device or full-stack validation pending. | | #1708 | `35ec9ebfae00` | no | D3D12.X: reuse the pipeline lookup when binding a stand-in; bounded source reviewed; integration/device or full-stack validation pending. | | #1709 | `a57a76cd4a9c` | yes | Recompiler: a pixel shader's ordered section uses rasterizer ordered views; bounded source reviewed; integration/device or full-stack validation pending. | | #1720 | `94ecdd55d5f2` | no | Recompiler: v_pack_b32_f16 applies the abs and neg half modifiers; bounded source reviewed; integration/device or full-stack validation pending. | | #1756 | `f86b01177dee` | no | Scripts: stop shader precompile at a private commit budget; bounded source reviewed; integration/device or full-stack validation pending. | | #1758 | `e2c7975dfaae` | no | Shaders: report progress for every precompile record; bounded source reviewed; integration/device or full-stack validation pending. | | #1776 | `3546d8dea095` | no | Tests: pin mesh dispatcher scratch and wave32-on-wave64 contract; bounded source reviewed; integration/device or full-stack validation pending. | | #1792 | `f03d41181257` | no | kernelx: commit a mapping call's sparse pages once per run, not per page; bounded source reviewed; integration/device or full-stack validation pending. | | #1793 | `e935debf939c` | no | Direct DXIL: make multi-wave Compute and Mesh s_barrier early-exit-safe; bounded source reviewed; integration/device or full-stack validation pending. | | #1798 | `55e7beb6de9f` | no | D3D12.X: a draw does not wait for a graphics pipeline still being built; bounded source reviewed; integration/device or full-stack validation pending. | | #1802 | `a01669b516e8` | no | shaders: benchmark direct DXIL PSO compilation; bounded source reviewed; integration/device or full-stack validation pending. | | #1804 | `97e501e0dee3` | no | Shaders: --precompile --pipelines skips cached PSOs after canary check; bounded source reviewed; integration/device or full-stack validation pending. | | #1826 | `7ae2bb71845c` | no | Shaders: xcl pipelines --shard k/n splits the journal over processes; bounded source reviewed; integration/device or full-stack validation pending. | | #1841 | `89724e5d4269` | no | Recompiler: round f16 add / sub / fma / ldexp results to nearest even; bounded source reviewed; integration/device or full-stack validation pending. | | #1849 | `2cc2ba1ac89b` | no | Scripts: measure NVIDIA PSOs with a temporary cache-off profile; existing scoped evidence; current integration/runtime pending. | | #1903 | `13f5a7be9d1e` | no | Tests: use the wave64 skip reason for per-lane DXIL; bounded source reviewed; integration/device or full-stack validation pending. | | #1919 | `5835139244eb` | no | Recompiler: LDS ds_sub_u32 hides its negation from the driver (RTX 50 refuses it); bounded source reviewed; integration/device or full-stack validation pending. | | #1921 | `0c8f2928e938` | no | Tests: cover D3D12.X pipeline hooks and device extensions; bounded source reviewed; integration/device or full-stack validation pending. | | #1936 | `6158c0cf82b4` | yes | D3D12.X: no VS, input layout or topology from the title in a mesh pipeline; bounded source reviewed; integration/device or full-stack validation pending. | | #1942 | `f9c9df37703b` | no | D3D12.X: persist both PSOs for translated mesh and geometry; existing scoped evidence; current integration/runtime pending. | | #1956 | `a7217a4f6b1c` | yes | Recompiler: DXC arguments come from one public function (arguments); bounded source reviewed; integration/device or full-stack validation pending. | | #1962 | `5011a26413ed` | no | README: XCL_PIPELINE_THREADS is only for xcl shaders --pipelines; bounded source reviewed; integration/device or full-stack validation pending. | | #1997 | `f053f279fe89` | no | Shaders: bound direct sweep workers and report panics; bounded source reviewed; integration/device or full-stack validation pending. | | #2001 | `008d9c1c443c` | no | D3D12.X: offload PSO builds, defer lazy compile-on-draw, and wire mmap ID3D12PipelineLibrary1; bounded source reviewed; integration/device or full-stack validation pending. | | #2018 | `908c454a5f0d` | no | Recompiler: XCL_COMPACT_NEST=auto nests programs of 512 cases or more; bounded source reviewed; integration/device or full-stack validation pending. | | #2025 | `eee2b862a16c` | no | Recompiler: nest the compact dispatch of big programs by default; bounded source reviewed; integration/device or full-stack validation pending. | | #2047 | `0e9ebc56978e` | no | Shaders: restore direct DXIL cache ID after source deletion; bounded source reviewed; integration/device or full-stack validation pending. | | #2052 | `b67c8f0cb5a6` | yes | D3D12.X: a wait an earlier signal covers does not make a signal a cycle; bounded source reviewed; integration/device or full-stack validation pending. | | #2053 | `ea16145a4694` | no | D3D12.X: catch panics in async PSO builds so waiters and workers do not stall; bounded source reviewed; integration/device or full-stack validation pending. | | #2057 | `4df1e6e3d40a` | yes | D3D12.X: integration branch that reaches the in-world HUD on NVIDIA (reference, not for merge); existing scoped evidence; current integration/runtime pending. | | #2067 | `9b35718ffd32` | no | Recompiler: emit per-instruction globallycoherent on compute flat memory (stacked on #1850); bounded source reviewed; integration/device or full-stack validation pending. | | #2070 | `8cb43460c48b` | no | Shaders: offline pipeline builds use the runtime workers' 64 MB stack; bounded source reviewed; integration/device or full-stack validation pending. | | #2079 | `fa4bfd114933` | no | Direct DXIL: route split-wave64 GS-only entry through gate block; bounded source reviewed; integration/device or full-stack validation pending. | | #2085 | `529d13f557a1` | no | Shaders: share compiled DXIL across pipeline builds; bounded source reviewed; integration/device or full-stack validation pending. | | #2096 | `bb4dea405b5a` | no | D3D12.X: XCL_PSO_MANIFEST=1 writes the order a run asks for its pipelines (#2088); bounded source reviewed; integration/device or full-stack validation pending. | | #2097 | `d98d2d46131c` | no | Recompiler: split wave64 compute groups of several waves across dispatches; bounded source reviewed; integration/device or full-stack validation pending. | | #2098 | `d27d471b9373` | no | D3D12.X: scale huge pipeline compile slots with available CPUs; existing scoped evidence; current integration/runtime pending. | | #2103 | `7743842ada44` | no | Direct DXIL: defer cold console_geometry during cached_only PSO probes; bounded source reviewed; integration/device or full-stack validation pending. | | #2104 | `f1810d0c362e` | no | Shaders: precompile compute pipelines through a recorded present; bounded source reviewed; integration/device or full-stack validation pending. | | #2122 | `ddcda0184c4f` | no | Recompiler: close four wave64-on-wave32 partition classifier soundness holes; bounded source reviewed; integration/device or full-stack validation pending. | | #2125 | `765e475dbe83` | no | Docs: explain the NVIDIA driver-blob workaround under Wine; existing scoped evidence; current integration/runtime pending. | | #2127 | `0e84e7406356` | no | Shaders: under Wine, at most 4 DXC compile threads by default; bounded source reviewed; integration/device or full-stack validation pending. | | #2129 | `30a3ef1055ed` | no | Scripts: cold driver benchmark of compute pipelines over thread counts (#2088); bounded source reviewed; integration/device or full-stack validation pending. | | #2144 | `f8eeef4de89d` | yes | D3D12.X: the looks line splits "the rest" and shows the longest look; bounded source reviewed; integration/device or full-stack validation pending. | | #2146 | `52577f993895` | no | Recompiler: size a compute program's LDS block from its LDS_SIZE; bounded source reviewed; integration/device or full-stack validation pending. | | #2177 | `244aa780c951` | no | Kernel.X: preserve GPU texture data when a physical page moves from home (stacked on #1182); bounded source reviewed; integration/device or full-stack validation pending. | | #2210 | `c0d3729436c2` | yes | Recompiler: XCL_OUTLINE_EXCHANGE=0 keeps the split-wave64 rendezvous inline; bounded source reviewed; integration/device or full-stack validation pending. | | #2220 | `419431cf03c2` | no | Shaders: trace offline precompile phases; bounded source reviewed; integration/device or full-stack validation pending. | | #2224 | `85d79bf639d4` | no | D3D12.X: abort failed device batches and restore pending in title_textures::upload_all; bounded source reviewed; integration/device or full-stack validation pending. | | #2252 | `da82f106813b` | no | dxil: refuse wave64 VS/PS with upper-lane reads in 32-lane mode (#1895); bounded source reviewed; integration/device or full-stack validation pending. | | #2270 | `b7f6b760e2ce` | no | D3D12.X: unmap a superseded texture only once the work before it is done; bounded source reviewed; integration/device or full-stack validation pending. | | #2288 | `5e502c50805e` | yes | Recompiler: guard direct DXIL window stores with bit tests; bounded source reviewed; integration/device or full-stack validation pending. | | #2291 | `4bad50562dd5` | no | Recompiler: a compute loop's passes shrink with the dispatch's size; bounded source reviewed; integration/device or full-stack validation pending. | | #2297 | `739407b67a28` | no | D3D12.X: guard null and unreadable pointers in graphics and compute PSO hooks; bounded source reviewed; integration/device or full-stack validation pending. | | #2299 | `4de52614fa58` | no | Recompiler: split direct compute programs that use guest LDS; bounded source reviewed; integration/device or full-stack validation pending. | | #2301 | `c94ad8afe3a7` | no | Direct DXIL: compute programs over 1.5 MB of plain DXIL are retried in the compact form; bounded source reviewed; integration/device or full-stack validation pending. | | #2302 | `30985d3f48b6` | no | Recompiler: replace tn[4]/id[4] local arrays in bvh_intersect with scalars; bounded source reviewed; integration/device or full-stack validation pending. | | #2326 | `d65ae604ba81` | yes | Shaders: make static-sampler root signatures first, in one order; bounded source reviewed; integration/device or full-stack validation pending. | | #2333 | `a7b93a853ec5` | no | D3D12.X: keep caller allocator for untracked lists and retain whole PSOs in dispatch_chain; bounded source reviewed; integration/device or full-stack validation pending. | | #2341 | `45dbd47ccdfc` | no | recomp: cap per-lane compute size so giant shaders use compact DXIL (#2203); bounded source reviewed; integration/device or full-stack validation pending. | | #2343 | `3ec09d711cb1` | no | dxil: batch consecutive v_readfirstlane/v_readlane exchanges in split-wave64; bounded source reviewed; integration/device or full-stack validation pending. | | #2344 | `c24f3e9743cf` | no | DXIL split: prune piece-local features after optimize and transport f16/f64; bounded source reviewed; integration/device or full-stack validation pending. | | #2348 | `bc43fd6dc403` | no | Recompiler: cube sc / tc negate by the sign bit on both backends; bounded source reviewed; integration/device or full-stack validation pending. | | #2349 | `63131c64802a` | no | Recompiler: split native wave32 compute groups beyond [32, 1, 1]; bounded source reviewed; integration/device or full-stack validation pending. | | #2353 | `a81f9d536f15` | no | Recompiler: split single-wave compute groups of any shape; bounded source reviewed; integration/device or full-stack validation pending. | | #2356 | `ff9716539139` | yes | Recompiler: compress per-class branch targets in direct DXIL compact; bounded source reviewed; integration/device or full-stack validation pending. | | #2377 | `0c446533681f` | no | Recompiler: split-wave64 one-wave groups can meet at a group barrier (opt-in, XCL_WAVE64_BARRIER=1); existing scoped evidence; current integration/runtime pending. | | #2385 | `4c4c5772f74c` | no | D3D12.X: sampled textures go without their top mips while video memory fills up; existing scoped evidence; current integration/runtime pending. | | #2398 | `e9d7aefc3a18` | no | DXIL: saturate 16-bit integer valu16 ops when CLAMP=1; bounded source reviewed; integration/device or full-stack validation pending. | | #2409 | `1ee46bda18ef` | no | D3D12.X: record first use of synchronously created compute PSOs; bounded source reviewed; integration/device or full-stack validation pending. | | #2417 | `1a51cb95ebd7` | no | D3D12.X: retain resolved async pipelines until reset and retirement; bounded source reviewed; integration/device or full-stack validation pending. | | #2423 | `63ea17f3cf85` | no | Recompiler: prioritize wanted DXC compiles and reserve worker headroom; bounded source reviewed; integration/device or full-stack validation pending. | | #2427 | `c8c2b7a6b19d` | no | Recompiler: direct DXIL reads heap memory windows without a branch; bounded source reviewed; integration/device or full-stack validation pending. | | #2428 | `c6e5af8690fc` | no | Recompiler: NVIDIA compute programs take flat heap windows by default; existing scoped evidence; current integration/runtime pending. | | #2440 | `633b1e4213c3` | yes | Tests: exercise direct geometry in expanded heap windows; bounded source reviewed; integration/device or full-stack validation pending. | | #2448 | `d61ffdc435d5` | no | D3D12.X: canonicalize inactive two-pass stream descriptors; existing scoped evidence; current integration/runtime pending. | | #2469 | `44a66e63d717` | no | D3D12.X: reuse split dispatch scratch when growth fails; bounded source reviewed; integration/device or full-stack validation pending. | | #2495 | `bbcfc3818168` | yes | Scripts: reject invalid or stale cold PSO benchmark results; existing scoped evidence; current integration/runtime pending. | | #2496 | `2e8ff6b6ce0c` | no | Recompiler: an access may take its base address's window (XCL_WINDOW_NO_CARRY); bounded source reviewed; integration/device or full-stack validation pending. | | #2500 | `b17262c485cc` | no | xcl run: a profile-tracy build records a Tracy timeline of the run; bounded source reviewed; integration/device or full-stack validation pending. | | #2515 | `f655cfdac728` | yes | Shaders: --pipelines blobs are made as a title's run asks for them; bounded source reviewed; integration/device or full-stack validation pending. | | #2523 | `8b290bf2944d` | yes | D3D12.X: MakeResident and Evict give the driver the pipeline behind a stand-in; bounded source reviewed; integration/device or full-stack validation pending. | | #2526 | `0fd22d04dc79` | yes | D3D12.X: compute pipelines not used for a while are released on NVIDIA; existing scoped evidence; current integration/runtime pending. | | #2540 | `f5cb7eaa1c54` | no | Recompiler: validate DXIL containers and split pieces in translated cache; bounded source reviewed; integration/device or full-stack validation pending. | | #2543 | `12141ccbfa16` | no | D3D12.X: clear dispatch_chain shared scratch on list lifecycle transitions; bounded source reviewed; integration/device or full-stack validation pending. | | #2548 | `c0d09204145a` | no | D3D12.X: Reset, KickoffX and CreateCommandList do not wait for a compute pipeline still being built; bounded source reviewed; integration/device or full-stack validation pending. | | #2551 | `3567b2efdc94` | no | Shaders: --precompile --pipelines also builds a split program's whole form; bounded source reviewed; integration/device or full-stack validation pending. | | #2552 | `84f6bdc97a46` | no | Recompiler: fold finite constant legacyF16ToF32 conversions in direct DXIL; bounded source reviewed; integration/device or full-stack validation pending. | | #2557 | `2a1fadcf8eb4` | no | Recompiler: generalize bitmask and zero-shift folding via known_nonzero_bits; bounded source reviewed; integration/device or full-stack validation pending. | | #2559 | `7bf48538afde` | no | Recompiler: simplify bfm / s_bfm_b64 and lower ffbh_i to FirstbitSHi in direct DXIL; bounded source reviewed; integration/device or full-stack validation pending. | | #2565 | `97376ee13636` | no | Recompiler: lower 32-bit VALU add/sub with carry without i64 in direct DXIL; bounded source reviewed; integration/device or full-stack validation pending. | | #2566 | `72e94879f268` | yes | Diagnostics: label translated pipelines in PIX captures; bounded source reviewed; integration/device or full-stack validation pending. | | #2567 | `3c0fc4b96a6b` | no | Recompiler: share scalar-load bodies in direct DXIL compute shaders; bounded source reviewed; integration/device or full-stack validation pending. | | #2568 | `4094ff9cb9c3` | no | Recompiler: simplify integer min/max (dx.op.binary.i32) via range bounds and absorption in direct DXIL opt; bounded source reviewed; integration/device or full-stack validation pending. | | #2571 | `ad0ded91d9fa` | no | Recompiler: direct PS compares skip the per-quad mask where no helper bit is read; bounded source reviewed; integration/device or full-stack validation pending. | | #2572 | `af2cecc40886` | no | Nvidia dev; existing scoped evidence; current integration/runtime pending. | | #2574 | `e2aae0e87df1` | no | D3D12.X: persist slow driver blobs past the RAM cache cap (#1833); bounded source reviewed; integration/device or full-stack validation pending. | | #2581 | `d5d694b04b3e` | no | D3D12.X: with bounded pipeline waits, dispatches are not put off to the submit; bounded source reviewed; integration/device or full-stack validation pending. | | #2585 | `2066b32e5d12` | no | DXC: keep LINK_GATE open on OOM and forward opt/extra args to IDxcLinker::Link; bounded source reviewed; integration/device or full-stack validation pending. | | #2594 | `ae921b40fc1f` | yes | Shaders: reuse the file buffer when loading unsplit cache entries; bounded source reviewed; integration/device or full-stack validation pending. | | #2603 | `88c0f1481ff2` | no | Tests: isolate the streamed-texture recheck fixture; bounded source reviewed; integration/device or full-stack validation pending. | | #2613 | `2d229b9f76b6` | no | Shaders: warm runtime-selected graphics DXIL variants in --precompile; bounded source reviewed; integration/device or full-stack validation pending. | | #2614 | `cd7be10ff02b` | no | D3D12.X: preserve replaced driver blobs after stale rejection; existing scoped evidence; current integration/runtime pending. | | #2621 | `aad6434c1c6a` | no | D3D12.X: preserve extended state in translated graphics PSO streams; bounded source reviewed; integration/device or full-stack validation pending. | | #2622 | `f0f9daee2d7e` | no | D3D12.X: a put-off call's segment that does not close is not submitted; bounded source reviewed; integration/device or full-stack validation pending. | | #2628 | `8b15baee713b` | no | D3D12.X: a worker waiting for a big compile turn leaves the queue to a helper; bounded source reviewed; integration/device or full-stack validation pending. | | #2629 | `8bfaa12f1fdf` | no | D3D12.X: a split program's failed whole build is not tried again; bounded source reviewed; integration/device or full-stack validation pending. | | #2641 | `c9751948934e` | no | Recompiler: simplify direct DXIL frexp_mant, frexp_exp, and alignbit helpers; existing scoped evidence; current integration/runtime pending. | | #2652 | `88d7b0a19a27` | no | Recompiler: serialize dxc::wait_for_memory slot admission (#2463); bounded source reviewed; integration/device or full-stack validation pending. | | #2697 | `50cfb321be82` | no | D3D12.X: a memory line by owner, against DXGI's budget; existing scoped evidence; current integration/runtime pending. | | #2704 | `9b6811395e23` | no | Shaders: include HEAP_FLAT in offline precompile runtime_windows; bounded source reviewed; integration/device or full-stack validation pending. | | #2705 | `231c4f1d06b5` | no | xcl run: preparation workers count the commit left in MiB, not bytes; existing scoped evidence; current integration/runtime pending. | | #2706 | `f614add84d53` | yes | D3D12.X: preserve the NVIDIA world-streaming integration; existing scoped evidence; current integration/runtime pending. | | #2711 | `dfead3702a1e` | yes | Recompiler: canonicalize split compute pieces and prune unused bindings (#2088); existing scoped evidence; current integration/runtime pending. | | #2717 | `23d313161e3a` | no | D3D12.X: a mid-list split gets its next segment before it closes the list; bounded source reviewed; integration/device or full-stack validation pending. | | #2723 | `2d14195e83eb` | no | D3D12.X: share dispatch-chain root signatures per device and key compute blobs on NodeMask; existing scoped evidence; current integration/runtime pending. | | #2725 | `ad9172c015a8` | no | D3D12.X: a title allocator takes a free spare another one put aside; existing scoped evidence; current integration/runtime pending. | | #2728 | `ae5a2f99b02e` | yes | README: document xcl shaders --precompile --limit; existing scoped evidence; current integration/runtime pending. | | #2739 | `e58cd9e7945f` | no | shaders: distinguish precompiled PSOs from saved driver blobs; bounded source reviewed; integration/device or full-stack validation pending. | | #2740 | `9ecae592ea3a` | no | D3D12.X: persist compute blobs when the RAM cache is full; existing scoped evidence; current integration/runtime pending. | | #2749 | `9cfa7536e978` | no | D3D12.X: split sparse readback spin and submission out of STATE lock; bounded source reviewed; integration/device or full-stack validation pending. | | #2750 | `44a7e6fe3431` | no | D3D12.X: count the resources XCL makes for itself, by where it makes them; existing scoped evidence; current integration/runtime pending. | | #2755 | `4bb6b30fc5b1` | no | D3D12.X: preserve used-pipeline key on RT-gated compute stand-ins; bounded source reviewed; integration/device or full-stack validation pending. | | #2761 | `7cbc65139995` | no | Recompiler: use u128 dependency masks for reload invalidation; bounded source reviewed; integration/device or full-stack validation pending. | | #2764 | `24695174b1c1` | no | D3D12.X: a placed view's padding does not make a second texture; bounded source reviewed; integration/device or full-stack validation pending. | | #2781 | `e1e5bbf0d9bd` | no | Recompiler: Wave32 pixel mask writes kill one SGPR, not a pair; bounded source reviewed; integration/device or full-stack validation pending. | | #2786 | `7587c01324cf` | no | D3D12.X: add opt-in first-demand capture sidecar for Chain::whole fallbacks; bounded source reviewed; integration/device or full-stack validation pending. | | #2788 | `2331f2ea810c` | no | Tests: a console MS in the AS slot is refused by its MS translation; bounded source reviewed; integration/device or full-stack validation pending. | | #2789 | `ed13531a2869` | no | Build: hash the translator sources of the tree being built; bounded source reviewed; integration/device or full-stack validation pending. | </details> Confirmed semantic overlap is being retained where policy, target branch, residual behavior or unmerged prerequisites differ. A partial overlap is not a complete duplicate. No full-stack runtime certification is implied for this umbrella PR. AI use: Codex (GPT-6) reviewed source with independent cross-checks, executed the selected local fixtures and reconciled raw results; historical evidence is kept separate. Optional temporary [Discord](https://discord.gg/gK3y7WRRY) for coordinating contributor work, testing and comparing results.
Author
Owner

@⁠Prime1997 on GitHub · 2026-11-26 15:31 UTC · original · reviewed

Merge status: these three test fixes remain blocked by CI; retain their useful changes. Using Prime1997, I approved the waiting CI runs for the reviewed NVIDIA-target revisions and applied the documented test-only label to the two changes inside test modules. Their new description checks passed. No PR was merged or closed.

All three CI attempt2 runs finished with failure:

PR Exact reviewed head CI result
#2770 7a7e161d907c91e32fbf727201806171f5580c51 Run45812413546
#2771 6b2691e18b02fd5f5efcca5c8e27db93e3ce727a Run45812422397
#2773 0c0a7aa4ef1c0ced8436ebfd9fdaf1c4182baf98 Run45812437568

The full job logs show successful dev/test compilation, followed by the xcl --lib process aborting on Microsoft Basic Render Driver with 0x887a0020. Each job exits1, contains347 GPU-skip diagnostics and has no final libtest summary. Complete suite pass/fail totals therefore cannot be reported. No named FAILED test line was observed in these three logs.

This is a real failed merge gate, not evidence that each test fix introduced a regression. It matches the earlier #2729 software-renderer abort pattern, but no same-runner AF2 baseline comparison has established causation. The earlier scoped local passes remain separate evidence. The test-only labels waive only the exact-revision smoke-description requirement; they do not waive CI, validate whole-stack behavior or turn drafts into ready PRs.

Target remains nvidia-dev at af2cecc40886a8682ecf3267f5328c6dc4b66ad7. Resolve or independently isolate the failing CI path and complete the remaining validation before merging. A failed or missing check alone is not duplicate/rejection evidence. The strongest overlap candidates also retained distinct behavior, so none was closed on that basis.

AI use: Codex (GPT-6) rechecked account/head/base, reviewed the test-only diffs and unchanged workflows, advanced the permitted checks and reconciled full CI logs. The CI counts above are observed GitHub-runner evidence, not local hardware results. Optional temporary Discord for coordinating contributor work, testing and comparing results.

**@⁠Prime1997** on GitHub · 2026-11-26 15:31 UTC · [original](https://github.com/xcl-dev/xcl/pull/2572#pullrequestreview-6076797405) · **reviewed** **Merge status: these three test fixes remain blocked by CI; retain their useful changes.** Using Prime1997, I approved the waiting CI runs for the reviewed NVIDIA-target revisions and applied the documented `test-only` label to the two changes inside test modules. Their new description checks passed. No PR was merged or closed. All three CI attempt2 runs finished with failure: | PR | Exact reviewed head | CI result | |---|---|---| | #2770 | `7a7e161d907c91e32fbf727201806171f5580c51` | [Run45812413546](https://github.com/xcl-dev/xcl/actions/runs/45812413546) | | #2771 | `6b2691e18b02fd5f5efcca5c8e27db93e3ce727a` | [Run45812422397](https://github.com/xcl-dev/xcl/actions/runs/45812422397) | | #2773 | `0c0a7aa4ef1c0ced8436ebfd9fdaf1c4182baf98` | [Run45812437568](https://github.com/xcl-dev/xcl/actions/runs/45812437568) | The full job logs show successful dev/test compilation, followed by the `xcl --lib` process aborting on **Microsoft Basic Render Driver** with `0x887a0020`. Each job exits1, contains347 GPU-skip diagnostics and has no final libtest summary. Complete suite pass/fail totals therefore cannot be reported. No named `FAILED` test line was observed in these three logs. This is a real failed merge gate, not evidence that each test fix introduced a regression. It matches the earlier #2729 software-renderer abort pattern, but no same-runner AF2 baseline comparison has established causation. The earlier scoped local passes remain separate evidence. The test-only labels waive only the exact-revision smoke-description requirement; they do not waive CI, validate whole-stack behavior or turn drafts into ready PRs. Target remains `nvidia-dev` at `af2cecc40886a8682ecf3267f5328c6dc4b66ad7`. Resolve or independently isolate the failing CI path and complete the remaining validation before merging. A failed or missing check alone is not duplicate/rejection evidence. The strongest overlap candidates also retained distinct behavior, so none was closed on that basis. AI use: Codex (GPT-6) rechecked account/head/base, reviewed the test-only diffs and unchanged workflows, advanced the permitted checks and reconciled full CI logs. The CI counts above are observed GitHub-runner evidence, not local hardware results. Optional temporary [Discord](https://discord.gg/gK3y7WRRY) for coordinating contributor work, testing and comparing results.
Author
Owner

@⁠pvfreis on GitHub · 2026-11-26 16:07 UTC · original

Test report: nvidia-dev at af2cecc4 (this PR's head), RTX 3060 12 GB / 32 GB RAM, XCL_PREPARE=0, empty DXIL cache: no device removal in 463 s; no present after 282 s; our memory guard stopped the run at 37 GiB private. One run. This is not a smoke block.

Setup

  • RTX 3060 12 GB, driver 617.14; Ryzen 9 5900XT; 31.9 GB RAM (commit limit 65,385 MB); Windows 11.
  • af2cecc40886a8682ecf3267f5328c6dc4b66ad7, release build, Rust 1.100.0, no local changes.
  • Retail title, Series X profile, A pressed every 4 s by script.
  • XCL_DIRECT_DXIL=1 XCL_COHERENT_HEAPS=0 XCL_COHERENT_MB=512 XCL_PSO_WAIT_MS=50 XCL_PSO_TRACE=1 XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_PREPARE=0; every other switch at its default (the ExecuteIndirect guard on).
  • Fresh XCL data folder and empty DXIL cache; NVIDIA's own driver cache was not cleared. No driver-profile change was made for this run.

What it showed (seconds from the xcl.log timestamps; MB as the log prints them)

  • Intro presents from 6 s. First large dispatch burst at 124 s: 7,228 dispatches in 2 s.
  • First chained dispatches between 140 and 150 s, then a present again at 164 s. A second gap from about 176 to 210 s.
  • 214–282 s: 84 presents and 177,069 dispatches.
  • No present from 282 s to the end (90 windows of 2 s, 6 dispatches). From 282 s, compute programs of 0.98–1.07 MB of DXIL were compiled by the driver one after another: 282–315 s (33.3 s), 315–358 s (42.3 s), 358–416 s (58.3 s, the longest in the run), and one started at 416 s that was still open at the end, with 19 smaller compiles also in flight.
  • Totals: 1,810 presents, 209,513 dispatches (197,828 after the first chained ones), 10,626 chained dispatches in 44,297 slabs, 131 programs split.
  • No device removal. Local video memory was over the DXGI budget from 90 s on (187 warnings) and stayed at 16,390 MB from 284 s, against a budget of about 11,000 MB. nvidia-smi peaked at 11,931 of 12,288 MiB.
  • No lines from the ExecuteIndirect guard. Other ExecuteIndirect skips in the log: 4 at 120 s (pipeline still being built) and 8 at 142 s (two-pass arguments not in a console buffer).
  • How it ended: our guard stopped the run when the process reached 37 GiB private (465 s on the guard's clock; the log ends at 463 s). Process commit was 33,431 MB at 150 s, 36,318 MB at 282 s and 37,957 MB at 463 s. In the last memory: line, system commit was 55,194 of 65,385 MB, about 17,200 MB of it not this process. The lowest points on the guard's samples were 0.01 GiB of available RAM and 7.7 GiB of free commit, both at about 407 s. The title did not crash or stop by itself, and Windows had not run out of commit.
  • For comparison, same machine and switches on main at b49be183 (13 commits behind today's main; no preparation step there; plus one local commit that only adds log lines), empty DXIL cache, stopped by us at 208 s: first chained dispatches by 120 s, then 956 dispatches and 0 presents to the end, with compute compiles of up to 0.9 MB of DXIL still open. nvidia-dev by 208 s: 4 presents and 15,505 dispatches after its first chained ones (150 s).

Not tested: preparation on (the XCL_PREPARE default) and its worker processes; warm caches; the #2590 shader-heap profile; #2794; whether the S# sampler fix changes anything on screen; the picture (no frame captures); the test suite at this head; AMD; a second run.

AI use: Claude Code (Claude Opus 5.5) ran this and wrote it; Claude Fable 5.2 rechecked it against the logs.

**@⁠pvfreis** on GitHub · 2026-11-26 16:07 UTC · [original](https://github.com/xcl-dev/xcl/pull/2572#issuecomment-7197210489) **Test report: `nvidia-dev` at `af2cecc4` (this PR's head), RTX 3060 12 GB / 32 GB RAM, `XCL_PREPARE=0`, empty DXIL cache: no device removal in 463 s; no present after 282 s; our memory guard stopped the run at 37 GiB private.** One run. This is not a smoke block. **Setup** - RTX 3060 12 GB, driver 617.14; Ryzen 9 5900XT; 31.9 GB RAM (commit limit 65,385 MB); Windows 11. - `af2cecc40886a8682ecf3267f5328c6dc4b66ad7`, release build, Rust 1.100.0, no local changes. - Retail title, Series X profile, A pressed every 4 s by script. - `XCL_DIRECT_DXIL=1 XCL_COHERENT_HEAPS=0 XCL_COHERENT_MB=512 XCL_PSO_WAIT_MS=50 XCL_PSO_TRACE=1 XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_PREPARE=0`; every other switch at its default (the ExecuteIndirect guard on). - Fresh XCL data folder and empty DXIL cache; NVIDIA's own driver cache was not cleared. No driver-profile change was made for this run. **What it showed** (seconds from the `xcl.log` timestamps; MB as the log prints them) - Intro presents from 6 s. First large dispatch burst at 124 s: 7,228 dispatches in 2 s. - First chained dispatches between 140 and 150 s, then a present again at 164 s. A second gap from about 176 to 210 s. - 214–282 s: 84 presents and 177,069 dispatches. - No present from 282 s to the end (90 windows of 2 s, 6 dispatches). From 282 s, compute programs of 0.98–1.07 MB of DXIL were compiled by the driver one after another: 282–315 s (33.3 s), 315–358 s (42.3 s), 358–416 s (58.3 s, the longest in the run), and one started at 416 s that was still open at the end, with 19 smaller compiles also in flight. - Totals: 1,810 presents, 209,513 dispatches (197,828 after the first chained ones), 10,626 chained dispatches in 44,297 slabs, 131 programs split. - No device removal. Local video memory was over the DXGI budget from 90 s on (187 warnings) and stayed at 16,390 MB from 284 s, against a budget of about 11,000 MB. nvidia-smi peaked at 11,931 of 12,288 MiB. - No lines from the ExecuteIndirect guard. Other ExecuteIndirect skips in the log: 4 at 120 s (pipeline still being built) and 8 at 142 s (two-pass arguments not in a console buffer). - **How it ended:** our guard stopped the run when the process reached 37 GiB private (465 s on the guard's clock; the log ends at 463 s). Process commit was 33,431 MB at 150 s, 36,318 MB at 282 s and 37,957 MB at 463 s. In the last `memory:` line, system commit was 55,194 of 65,385 MB, about 17,200 MB of it not this process. The lowest points on the guard's samples were 0.01 GiB of available RAM and 7.7 GiB of free commit, both at about 407 s. The title did not crash or stop by itself, and Windows had not run out of commit. - For comparison, same machine and switches on `main` at `b49be183` (13 commits behind today's `main`; no preparation step there; plus one local commit that only adds log lines), empty DXIL cache, stopped by us at 208 s: first chained dispatches by 120 s, then 956 dispatches and 0 presents to the end, with compute compiles of up to 0.9 MB of DXIL still open. `nvidia-dev` by 208 s: 4 presents and 15,505 dispatches after its first chained ones (150 s). **Not tested:** preparation on (the `XCL_PREPARE` default) and its worker processes; warm caches; the #2590 shader-heap profile; #2794; whether the S# sampler fix changes anything on screen; the picture (no frame captures); the test suite at this head; AMD; a second run. **AI use:** Claude Code (Claude Opus 5.5) ran this and wrote it; Claude Fable 5.2 rechecked it against the logs.
Author
Owner

@⁠throny on GitHub · 2026-11-26 16:46 UTC · original

Two notes for whoever syncs this branch with main next, from an RTX 4080 16 GB that has been testing PRs on af2cecc4 all day (runs and numbers: #2688, comment 7184950679).

  • main is 10 commits ahead (#2555, #1942, #2448, #565, merged 07:56–08:02 today). The startup preparation is not the problem: this branch's present/preparation.rs already sits on #2555's commit plus four more. A trial merge (git merge-tree) conflicts in two places only: crates/xcl/src/hle/d3d12x/real.rs (content) and crates/xcl/tests/gpu_two_pass_cache_e2e.rs (added on both sides), both from the two-pass blob PRs.
  • #684 is needed here: without it this card stops at 148.6 s in hle::xg::copy_from in 2 of 2 runs; with it, 0 of about 30. @⁠Royalflamejlh's Linux runs above already carry it.

And one match with the reports above: on this card the device goes (0x887a0005, no nvlddmkm event, DRED without breadcrumbs) in about half of the world runs, 40–330 s after world entry, on the Series X and the Series S profile, with video memory over the budget or just at it. That looks like the Windows side of the Xid 109 losses at 95–207 s on Linux. Seven open PRs tried on top so far (#2749, #2768, #2782, #2725, #2581, #2422, the two-pass stack #2817) do not change it; reports are on each PR.

AI use: Claude Code (Claude Fable 5.2) ran the merge check and the runs and wrote this.

**@⁠throny** on GitHub · 2026-11-26 16:46 UTC · [original](https://github.com/xcl-dev/xcl/pull/2572#issuecomment-7198082098) Two notes for whoever syncs this branch with `main` next, from an RTX 4080 16 GB that has been testing PRs on `af2cecc4` all day (runs and numbers: #2688, comment 7184950679). - **`main` is 10 commits ahead** (#2555, #1942, #2448, #565, merged 07:56–08:02 today). The startup preparation is not the problem: this branch's `present/preparation.rs` already sits on #2555's commit plus four more. A trial merge (`git merge-tree`) conflicts in two places only: `crates/xcl/src/hle/d3d12x/real.rs` (content) and `crates/xcl/tests/gpu_two_pass_cache_e2e.rs` (added on both sides), both from the two-pass blob PRs. - **#684 is needed here**: without it this card stops at 148.6 s in `hle::xg::copy_from` in 2 of 2 runs; with it, 0 of about 30. @⁠Royalflamejlh's Linux runs above already carry it. And one match with the reports above: on this card the device goes (`0x887a0005`, no `nvlddmkm` event, DRED without breadcrumbs) in about half of the world runs, 40–330 s after world entry, on the Series X and the Series S profile, with video memory over the budget or just at it. That looks like the Windows side of the Xid 109 losses at 95–207 s on Linux. Seven open PRs tried on top so far (#2749, #2768, #2782, #2725, #2581, #2422, the two-pass stack #2817) do not change it; reports are on each PR. AI use: Claude Code (Claude Fable 5.2) ran the merge check and the runs and wrote this.
Assisted-by: Codex (GPT-6.2 Sol)
When a placed texture A was superseded by a different-range placement B,
vram::unmap_superseded released A's tiles (and cleared its lazy level
mappings under XCL_TEXTURE_LEVEL_PAGES=1), while LAST_CONTENT retained A's
previous CPU content hash. Once B was released and A uncovered with
A.pending = true, upload_all saw the same CPU hash and skipped both
map_levels_with_texels and texture::upload_batch, leaving A unmapped under
lazy level pages or sampling stale/recycled tiles on plain vram::Pages.

Evict LAST_CONTENT entries under TEXTURES's lock whenever placed textures
are unmapped (register), uncovered for remap (forget), or retired
(retire_overlapping, which also prunes STREAM_RECHECK).

Fixes #2460

Assisted-by: Antigravity (Gemini 4 Carbon)
XCL_DUMP_TARGETS keeps each pipeline's console shaders (512 MiB of them
at most) and translates them again after a dump on a thread of its own.
A frame capture needs the same for the pipelines it names, so the two
pieces are functions of their own: keep_shader (the cap shared by every
switch that keeps shaders) and write_shaders, which now also translates
a compute shader and leaves out HLSL past a size it is given (a note of
the size in its place). The target dump passes no limit and writes what
it wrote before; only the cap's warning names no one switch any more.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A rendering fault is studied by running the title again for every
question (which pass, which pipeline, which barrier). XCL_CAPTURE_FRAME=
<work>[,<after_s>] records what the title calls on its lists and writes
the first frame with at least <work> draws and dispatches (not before
<after_s> seconds after the first present, and not the first frame
recorded, whose lists began before the recording) to
<logs>/capture_<frame>/:

- frame.jsonl: one object per operation in execution order - submits
  in their order, each list's operations in the order the title
  recorded them, whichever thread recorded it - with its place (i),
  the draw or dispatch number (n), the render targets bound, the root
  arguments (the changed ones only where fewer: "delta"), the views of
  the first slots of its tables, and how it went (ran, skipped, PC
  pipeline, stand-in, put off to the submit); barriers as the title
  gave them and as XCL sent them where these differ; indirect arguments
  as the CPU saw them when they are in title memory it can read;
- resources.jsonl, pipelines.jsonl: what the operations name, with how
  each resource was made and each pipeline's state;
- shaders/: the referenced pipelines' console shaders translated again
  and disassembled on a thread of their own (the target dump's writer,
  HLSL past 8 MiB left out with a note);
- summary.txt: counts by kind, pass and pipeline, and warnings.

Lists are recorded by the object the title holds and submits, so a list
XCL split into segments, or submitted in part by KickoffX, is one
recording placed where it ran. XCL's own calls inside a title's call
are not recorded, nor the put-off dispatches a submit records again;
recording only reads, so what goes to the PC does not change. A frame
keeps 2 million operations at most (a list as many), and summary.txt
says what was left out. Unset, each entry point checks one cached value.

Console-shaped lists (XCL_CONSOLE_LISTS), bundles' contents, enhanced
barriers, descriptor copies, CopyTiles, queries and the console's memory
write / wait / cache flush methods are not recorded.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Both sides extended the XCL_DUMP_TARGETS shader files: this branch with
the frame's compute pipelines (compute<k>_cs_<key>.hlsl / .rdna2.txt,
the CS translation, an 8 MB HLSL cap, the running DXIL's path in a CS
file), wm22/capture by moving the dump's shader keeping and writer into
shared helpers for XCL_CAPTURE_FRAME, with a compute translation and an
HLSL cap of its own.

One implementation of each is kept, the shared one:
- targets::write_shaders(dir, files, hlsl_most) writes both dumps'
  shaders. Its CS arm translates with the wave size the pipeline was
  noted with (the target dump notes wave32_only; the capture notes its
  compute pipelines as wave64, as before), and a CS file names the path
  of the running pipeline's DXIL (pso::compute_path) for both dumps.
- The HLSL cap is the hlsl_most argument, with one constant,
  targets::HLSL_BYTES_MOST (8 MB), which the target dump and the
  capture both pass. The target dump's graphics shaders are capped too,
  as on this branch (the other side passed no cap for them). The note
  past the cap is the shared one; the extra log line this branch wrote
  for it is gone.
- targets::ShaderFile is the one shared tuple type; the duplicate is
  gone.
- to_dump collects the target and compute pipelines' files and writes
  them on one thread, logging where they went after writing, as the
  shared writer no longer logs.
- dev_create_compute_pso notes a pipeline's CS for either switch:
  targets::note_pipeline and capture::note_compute each check their own.

XCL_DEBUG_CS_SUB, the compute pipeline list and the frame capture are
unchanged otherwise.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The rule made for 3D render targets holds for every texture whose size
on the console XCL cannot work out (several 2D kinds too): it has the
pages of its first level's texels at its address, by its blocks when it
is block-compressed, and its own tiles for the rest. Sampled textures on
shared pages the same way. Each such kind is logged once.

A captured frame of a title had five pairs of render targets overlapping
by 1 to 8 MiB, and its picture shows square tiles with other textures in
them.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
XCL_VIEW_REACH_MB=n asks for n MiB instead of 64 KiB from the address of
a view the title gives no size for (XCL_VIEW_REACH=bvh,root,mesh: only
those kinds). XCL_BVH_EMPTY=1 gives the shaders every acceleration
structure as an empty one. Both off by default: experiments that tell
what a title's ray tracing shaders read and do.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
A title's ray tracing shaders walk the console structures themselves: from
the top level's root through box and instance nodes, then by each instance's
bottom-level address (@60 << 8) and root (@56) into a bottom level, and back
up through the parent pointers when their short stack runs out (the dword at
base + 4·(n / 64 − (header@52 >> 6 − header@56 >> 2))). XCL asks a GPU view
only for the 64 KiB at the top level's address, so the rest reads as zero.

`bvh::walk_scene` finds what such a traversal can read, through a reader of
the title's memory (whole 64 KiB tiles, 1024 kept; a tile that cannot be
read whole is read for the node only): per structure the header, every node
reached (whole 64 / 128 bytes, the instance's 112..127 too), the parent
pointer of each, and those as 64 KiB tile runs. The structures carry no size
the format here trusts (the 0x28 dword is documented only for compressed
bottom levels in an archive), so they are walked, not sized.

The memory is the title's and may be half written: node ids are checked for
type (top: box32 / box16 / instance; bottom: boxes and triangles), for lying
past the header and within 2 GiB of the base, each node is visited once (a
bit set: no cycle loops), every read is checked, parent pointers further than
2 GiB are left out, and there are caps: 4 Mi nodes a structure, 32 Mi a
walk, 2 GiB read, 65536 bottom levels. A walk that stops says why and keeps
what it found. Not called yet.

Tests: a 600-instance top level (150 KiB) over 3 bottom levels (one neither
tile-aligned nor whole tiles), an unreadable bottom level, cycles, garbage
roots, memory ending inside the structure, each cap, and the parent pointers
(and ones out of range).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
An acceleration-structure view asked for the 64 KiB at the top level's
address only. The title's rays then read past it into tiles with no video
memory (zeros): the rest of the top level, every bottom level (no view is
ever made of one; the shader takes its address from the instance node) and
the parent pointers.

Now the view's creation walks the top level and its bottom levels on the
CPU side of the views (`bvh::walk_scene`, read through `view_want::cpu_run`
and ReadProcessMemory: an uncommitted or vanishing page fails the read, it
does not fault) and asks for every tile reached (`bvh_want`). A small
registry keeps the last walks: 64 top levels, 65536 bottom levels by
address. A bottom level known already is not walked again; its tiles are
asked again only after asks were forgotten (`view_want::generation`).

Staleness: the write-watch pages of each submit are matched against the CPU
tiles each walk read (a hash of tiles); a structure written there is walked
again at the next present, two top levels a frame at most, least lately
walked first (a top level with no node yet, too). A view made again in the
same frame does not walk. A walk logs, at power-of-two counts:
"D3D12.X: acceleration structure at <va>: N nodes, T KiB of top level,
B bottom levels (K KiB) asked for; walk U µs[, truncated: <why>]".

`XCL_BVH_WALK=0`: the 64 KiB ask alone, as before. `XCL_BVH_EMPTY` and
`XCL_VIEW_REACH_MB` are unchanged.

A structure the GPU writes (the title's builder's compute work) is in its
tiles' video memory only: the CPU side the walk reads does not have it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
With `XCL_BVH_EMPTY=1` every acceleration-structure view got an all-zero
descriptor. That is no empty structure: the shader takes base 0 and reads
the root at 0x30 of window 0, whatever lies there, so "rays hit nothing"
held only by chance.

Now the descriptor points at a structure of XCL's own in unified memory
(`bvh::empty`, written once into a 64 KiB block): a 256-byte header whose
root is a box32 node with four invalid children, so a traversal ends at the
root. A root of 0 would be a triangle node over the header's zeros, missed
only because it is degenerate, so the box is used. Without unified memory
the descriptor stays all zero, as before.

Test: `the_empty_structure_has_nothing_to_hit` (a ray right through the
box's zero bounds reaches no child, as a top and a bottom level).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Textures the title places are reserved PC textures whose tiles map onto
video-memory pages keyed by the title's address (`vram`), so two PC
textures placed over the same title pages share video memory. What
handles overlaps is split: `title_textures` shadows an older sampled
texture under a newer one and retires sampled ones under a new target,
but nothing knows about a target that a later placement lies over, and
nothing compares two targets.

One registry now has every placement on the title's pages or in an
arena: the PC texture, its own title pages as `owned_pages` computes
them (or the arena range), its kind (target: render target / depth /
UAV; sampled), a sequence number and when it came. The title's last
Release marks it released (`vram::forget`); it goes when the PC object
goes (`late_release`, or at once without it). Placements are found by
the 2 MiB blocks of the title's addresses they cover: one lookup per
placement.

With XCL_PLACE_CHECK=1 each placement is compared with the live ones
on the same video memory: the same pages (an alias), inside, around or
partly over, by kinds (tt/st/ts/ss, the newer one first). The first 32
cases are logged with both descriptions, ranges, the older one's age in
placements and ms, and whether the title had released it already; the
counts follow at most every 2 s:

  D3D12.X: placements (2 s): N made, A aliases at the same range (S
  sampled over a target), P partial overlaps (tt/st/ts/ss a/b/c/d), I
  one inside the other (tt/st/ts/ss e/f/g/h), K over ones the title
  released (not gone yet)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This reverts commit 28b9d371e1, reversing
changes made to a44abe0925.
DispatchX(x, y, z, flags) dropped its flags. With USE_THREAD_DIMENSIONS
(0x20; 0x8020 with the wave32 bit) x, y, z are thread counts: the console
launches ceil(count / numthreads) groups and leaves the lanes past the count
out of EXEC. XCL launched the counts as groups: 32-64x the groups for the
retail title's BVH builder (its rehydration and reload passes pass node and
primitive counts), past D3D12's 65,535 groups for a large mesh, and every
extra thread of the unguarded Box32/Box16 rehydration shaders wrote outside
its node array.

The flags now reach the dispatch (also one put off to the submit). With
0x20 the counts become whole groups of the pipeline's console numthreads
(kept with its user SGPRs at creation); a pipeline whose group shape is not
known is not launched, skipped and counted as an untranslated one. The
thread count of an axis that does not end on a whole group goes to io
slots 114..116 (IO_THREAD_LIMIT), where the compute prologue will leave
the lanes past it out of EXEC in a following change: until then the last
group still runs whole. Each kind of flags is logged once.

Part of a stack: EXEC masking of the last group follows.

Ported to this branch: the thread limits take io slots 115..117, not
114..116: here 113 is IO_LOOP_BUDGET and 114 IO_GROUP_LIMIT, and 115..117
are the next trap-temp slots no other io value or translated program uses
(a test checks the io slots are distinct and in the trap-temp range).
Dispatch and DispatchX go through dispatch_flags with everything of this
branch's Dispatch kept: the frame capture, the deferral through waits_for
(Deferred::Dispatch now carries the flags to the submit), the target-dump
notes, the loop budget and the folding of more than 65,535 groups in X,
all of them on the converted group counts (a thread-dimension dispatch of
more than 65,535 groups is folded as groups, with the console's group
count in IO_GROUP_LIMIT and the thread count in IO_THREAD_LIMIT). The
capture records a thread-dimension dispatch with its thread counts, its
flags and the groups it launches (null for a pipeline still being built).
The group shape is kept with the user SGPRs in the sharded
PSO_USER_SGPRS, now (user SGPRs, numthreads), recorded at both creation
sites through compute_interface. Thread-dimension dispatches are counted
and logged at powers of two.

(cherry picked from commit a3e820d8e8)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A target (render target, depth, UAV texture) stayed mapped on the
shared pages of its title addresses whatever was placed over part of
them later: a sampled texture's uploads, or another target's draws,
then landed in its tiles. The other directions were handled already: a
sampled texture under a newer sampled one is shadowed and unmapped
(`title_textures::Table::insert`), one under a new target retired
(`retire_overlapping`).

Now a placement whose pages lie partly over, inside or around those of
an older live target the title still holds supersedes it (the same
pages stay shared: one memory under two descriptions, as before; an
arena has no tiles to unmap). Its tiles leave the shared pages once
every queue is past a fence value signalled after the placement
(`late_release::hold_unmap`): work submitted before may still draw to
it or read it. Its pages no other texture uses stay idle for 2 s with
what they hold (`vram::unmap_superseded_target`), so a target mapped
again soon gets them back. It goes back on the shared pages
(`vram::remap_if_unmapped`)
- when the title releases the newer ones over it while it still holds
  it, unless a still newer live one lies over other pages of it (that
  one supersedes it from then on);
- when the title uses it again: a barrier on it or a copy from or to
  it (logged once a pair, the first 64: "a superseded texture is used
  again"). On the console a title may use both over one memory when it
  knows they share it. A use only through descriptors (render-target
  views, shader resources) is not seen.
Registry, unmap and remap are ordered by the registry's lock; the
references XCL takes go outside it (one may be the last).

XCL_PLACE_RETIRE=0 keeps the targets on the shared pages, as before.
The 2 s line of XCL_PLACE_CHECK=1 counts the older ones superseded,
those retired and those used again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
On the Series S profile (XCL_DEVICE_TYPE=lockhart) a retail title stopped on
its own breakpoint right after creating its 1245184-slot view heap: the
memory its allocation hook gave the heap was at window 1 + 0x1400000, and
console_heap refuses title memory outside window 0 (descriptor tables are
32-bit addresses, high half 0, read in window 0), so the heap got XCL's own
slots at sparse VRAM 0x10000 and the title's check that the heap starts at its
memory failed (rax = that start, rbx = its memory).

The Series X run got the same heap at 0xf2e00000 into window 0: the first fit
there right after its first two GPU heaps (1172 + 2199 MB, XCL_COHERENT_HEAPS
sparse). On the Series S profile the title had 664+ MB of physical pages before
the heap (the mapped page's number, 0x29810), and their homes went first-fit
into window 0 beside its 2.9 GB of GPU heaps, leaving less than the heap's
memory needed there. The Series X run's page pool (99776 pages, more than a
window) never went to window 0, and the window plan has no input from the
title memory size: both runs had the same one.

The same happened with the default 4-window layout (window 1 + 0x1400000,
the same page number): it needs the GPU heaps in the sparse windows, not the
16-window layout. With every GPU heap in the coherent window (the default
XCL_COHERENT_HEAPS) window 0 has room for the homes and the heap.

Homes are XCL's backing for the pages, never 32-bit addressed; window 0 stands
for the console's low 4 GiB. They now come from windows 1+ first, as title
reservations do (`Uma::sparse_alloc_above`), and from window 0 only when the
others have no room. Above a window nothing changes (the Series X pool).

The heap's window check is a function of its own (`title_memory_fits`), same
condition, and its warning says how much of window 0 was free (the next
refusal shows whether the title's memory missed it for want of room). Tests pin the Series X run's plan and the addresses of its GPU
heaps and view heap, and check the homes and the window check.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The coherent window is made as large as the title's GPU heaps were in its last
run with the same XCL_COHERENT_HEAPS setting (`<data>\cache\uma_coherent*.txt`).
A switch to the Series S profile in the same data folder kept the Series X
run's size, and a title makes smaller heaps there (a retail game 2.9 GB of
GPU heaps against 4.5 GB): the window was committed for heaps that never
came. The Series S profile now has files of its own (`_lockhart` before
`.txt`); the Series X file names are unchanged.

The idea and the file name are xcl-dev/xcl#1110's, put on this tree's
per-setting files.

Co-authored-by: xroneyaa <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A DispatchX with thread dimensions launches whole groups and writes the
thread count of an axis that ends inside a group to IO_THREAD_LIMIT, but
no translated program read it: the last group ran all its lanes. Per-model
vertex work dispatched as thread counts (840 threads as 14 groups of 64:
8 valid threads in the last group) had the 56 extra lanes write past the
end of one model's output into the next model's first vertices.

The HLSL compute prologue now loads the three limits in one 12-byte load
and takes the launch EXEC as the ballot of the lanes whose console thread
along each axis is below that axis's count: the console's group (unfolded
from a dispatch folded into Y) times the group size plus the thread in
the group, the ids the split wave64 form and 2-D groups give the threads
as their waves arrive. A count of 0 less 1 passes every thread, so there
is no branch and every other dispatch gets the EXEC it had before. The
lanes left out keep running with their bit clear, as lanes do after an
s_and_saveexec: no memory or image stores, no LDS writes, and ballots,
lane reads and DPP see them as out of EXEC. A wave left with no thread
(one wholly past the count in a group of several) leaves, through the
early-exit-safe barrier where the program has one; with a plain group
barrier (XCL_SAFE_BARRIER=0) it stays.

build.rs hashes the translator sources into the translation caches'
identity, so no DXIL cached before this is reused. The direct DXIL
translator and its per-lane form follow in the next change.

Tested: compute_prologues_leave_the_lanes_past_a_thread_limit_out_of_exec
(wave32, wave64, split wave64, a 2-D group, with the safe barrier; each
compiled by DXC).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The HLSL compute prologue leaves the lanes past a dispatch's thread limit
(IO_THREAD_LIMIT) out of EXEC; the direct translator (XCL_DIRECT_DXIL, and
every compute program whose HLSL would be too large for DXC) and its
per-lane form (XCL_PER_LANE) still ran the last, partly filled group whole.

Direct translator (kernel::compute_init / compute_gate): the entry block
loads the three limits at once (each less 1: a count of 0 passes every
thread) and tests each lane's console thread as the HLSL path does: the
console's group, unfolded, times the group size plus the thread id the
entry gives the lane. EXEC is the entry EXEC and the hardware wave's
ballot of those lanes. In the split wave64 form each half also builds the
other half's word without meeting it: lane j tests the other half's j-th
thread (in rounds when a last wave's upper half has fewer lanes than the
lower one has threads). The lanes outside then leave in the block after
the entry, with the groups past a folded count: they store nothing and
take part in no ballot, lane read or exchange, and every lane still there
has its EXEC bit set, so its lane bit of that EXEC folds to true
(Lw::live_exec) and vector writes that had no guard before have none now.
A split half counts the other half's lanes that stay (Lw::xn) when it
waits for them at an exchange. A program with s_barrier keeps the lanes,
out of EXEC, its stores guarded: a group barrier would wait for a lane
that left.

A dispatch chain needs nothing more: the limits are read and applied in
its first piece, a lane that left there ends with the continuation tag 0
that the later pieces take to their end, and EXEC reaches them as any
other value that crosses a cut.

Per-lane form (lower::lower_with): the lanes outside the limits leave with
the groups past a folded count, so every lane that runs is still in EXEC
as the lane-mask analysis assumes; a split IR learns the other half's
lanes that stay (Ir::before_lanes_leave). A compute program with
s_barrier is refused there (#1426's form takes it).

An ordinary dispatch's program runs as before: one load, a compare an
axis and one ballot at the start, the same unguarded writes. The direct
translator's sources (XCL_DIRECT_DXIL_SOURCE_ID) and the per-lane form's
(XCL_PER_LANE_SOURCE_ID) are hashed into the cache identity by build.rs.

Tested (software adapter: no 32- or 64-lane waves, the GPU parts skip):
the_compute_entry_lets_only_the_lanes_below_the_thread_limits_in,
the_lanes_past_a_thread_limit_leave_the_per_lane_form (CPU interpreter:
1-D, folded, 2-D, limit 0, EXEC counts), and the GPU tests
gpu_compute_thread_limits_leave_the_lanes_past_them_out (every form) and
a_dispatch_chain_leaves_the_lanes_past_a_thread_limit_out (its pieces'
structure runs here, the dispatch skips).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A console wave64 runs its instructions in order for all 64 lanes, so an
LDS write by any lane is visible to an LDS read by any lane later in the
program, with no s_barrier. In the split form (one console wave as two
hardware wave32 halves, 32-lane GPUs) the halves only met at exchanges
(ballots, lane reads, coherent scalar loads): between two of them the
lower half could run a ds_read before the upper half ran an earlier
ds_write. A tile classification program (one wave64 per tile: lanes with
a property write an LDS flag, lane 0 reads it later with no exchange
between) lost those writes and left holes in its output.

Both translators now keep a flag, the same in both halves because they
run the same instructions: an LDS write or atomic sets it, every meet of
the halves and every s_barrier clears it, and an LDS read or atomic
meets the other half first when it is set (HLSL: `xcl_x_lw` and
`xcl_x_meet`, either the group barrier or the counters; direct DXIL:
`VAR_XLW`, the meet emitted outright or skipped where the flag is known
while lowering). A half without a partner meets nobody, as before.
Programs that write no LDS, native wave64 and wave32 programs are
unchanged. The per-lane form (`XCL_PER_LANE`) is left as it was: its
LDS accesses run in blocks one half may enter alone.

Not covered: write-after-read and write-after-write ordering between
the halves (a write does not wait for the other half's earlier reads or
writes).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The previous change made an LDS read meet the other half when either
half may have written LDS since they last met. The reverse order was
still open: on the console every lane of a wave reads LDS at an
instruction before any lane writes it at a later one, but in the split
form the lower half could pass the read's meet, reach a later ds_write
and overwrite a dword the upper half had not read yet. The meet at the
read even lined the halves up just before such a race.

The flag is now two bits (written, read since the last meet): a read
meets after a write, a write after a read, an atomic after either; every
meet and s_barrier clears both. Write after write is still not ordered.
Both translators (HLSL `xcl_x_lw`, direct DXIL `VAR_XLW`) do the same.

XCL_X_LDS_ORDER=0 leaves the LDS order out of both translators (the form
before these changes) for comparison runs. It is part of the translated
cache's identity, so the two forms keep separate entries.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A compute program built its sampler with s_movk_i32, s_bfm_b32 s, 12, 12 and
s_mov_b64 of a 32-bit literal. Neither of the last two was followed as a
constant, so the S# was not a static sampler and every tap went through
sampler-heap entry 0 (point, wrap, mip 0). In a temporal upscaler's history
reprojection that point-samples the Catmull-Rom taps of moving pixels; the
history then diverged frame over frame.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
A title can run with its GPU busy nearly the whole frame, and nothing says
which translated programs take that time. XCL_GPU_TIMES=<frames>[,<after_s>]
measures it with D3D12 timestamp queries and logs one table.

What it measures: from the first present after_s seconds after the first
present on, every draw, dispatch, ExecuteIndirect and two-pass DispatchMesh of
console code recorded on a direct or compute PC list gets a timestamp after it
(the first call of a list's recording one before it too). A call's time is its
stamp minus the one before it on its list: one query between two calls, not
two a call. The stamps are resolved into a readback buffer before the list
closes, the list's calls count for the frame of its submit, and the first frame
and frames with fewer than 100 calls measured do not count. The query heap has
65536 timestamps for each frame asked for (16 frames at most) plus two; calls
past it are counted and said not to be measured. After the frames, one table
(INFO, `D3D12.X: GPU times:`): per frame the wall time, the GPU time from the
first stamp to the last, the measured sum, calls not measured, and per-submit
totals; then the 60 programs with the most GPU time per frame, averaged over
the frames, each with its kind (compute, graphics, mesh two-pass, PC pipeline),
its shaders' keys and dump hashes as the target dump prints them, calls, ms per
frame, its longest call and that call's groups, and for compute its wave size
(wave64 split in halves where it is).

Caveats, also in the log: a desktop GPU writes a timestamp once the work
before it is done while later work may already run, so a call's time is coarse
(fine for ranking) and holds what was recorded between the two calls
(barriers, copies, clears, XCL's own passes). The direct and compute queues
overlap, so sums can pass the wall time. Bundles and copy lists get no stamps,
a list submitted twice counts once, and lists recorded before the measuring
began are not measured. Unset, no query heap is made and each hook checks one
cached value; graphics and mesh pipelines note their shaders only with the
switch on.

Tested: cargo test --release -p xcl --lib hle::d3d12x: 479 passed, 0 failed,
1 ignored (the new GPU test ran two dispatches on WARP: two intervals that
share their middle query, both read back in order).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Measured with XCL_GPU_TIMES on an RTX 5090 at 1280x720: two-pass mesh
draws take about 114 ms of a 195 ms frame over about 2,700 calls among
the top 60 programs, 0.02-0.08 ms a call whatever the program; all
compute among them is 23 ms. The cost is the sequence of each call, not
its shaders: every pass is followed by a ResourceBarrier, so the GPU
drains between the compute pass, the mesh pass and the next draw. An
ExecuteIndirect (most of them, max count 1) records six ResourceBarrier
calls: a UAV barrier on all resources, argument block COMMON -> UAV,
the rewrite, UAV -> INDIRECT_ARGUMENT, compute pass, UAV barrier on the
records, mesh pass, UAV barrier on the records, INDIRECT_ARGUMENT ->
COMMON. A DispatchMesh records two.

With XCL_TWO_PASS_BATCH=1 (read once; off by default, and off records
exactly what it did before):
- The records of consecutive two-pass passes go in the two halves of a
  record buffer twice the size the draw would have had (each half holds
  the groups the whole one held; past RECORD_MAX, or when the two-pass
  budget refuses the larger buffer, the draw takes the whole buffer as
  before). A mesh pass then needs no UAV barrier after it: the next
  compute pass writes the other half, and the UAV barrier after that
  compute pass orders the mesh pass before its half is written again.
  What a mesh pass may still be reading is kept per recording, so a draw
  with the whole buffer after one in halves starts with a barrier.
- An ExecuteIndirect's argument block stays in INDIRECT_ARGUMENT after
  the draw; the next rewrite into it takes it from there, in the same
  ResourceBarrier call as the UAV barrier on all resources before the
  rewrite. A block a recording leaves in INDIRECT_ARGUMENT is a buffer
  and decays to COMMON when its ExecuteCommandLists is done, before
  another recording can take it again.

A DispatchMesh then records one ResourceBarrier call instead of two, an
ExecuteIndirect of one command three instead of six. Not done here:
deferring a run of two-pass draws to emit all compute passes, one
barrier, then all mesh passes. Many title calls that set PC state reach
the driver with no XCL code in between, SetPipelineState can record a
depth bias at once, and an ExecuteIndirect's records need up to 32 MiB
a draw, so that needs a flush hook on every list slot and more memory.

Tests: the plan without the switch is the order before; draws in
halves record half the barriers; no sequence of draws in halves and
whole writes records a mesh pass may still read; halves hold the groups
the whole buffer held; the argument block's state across rewrites and
recordings; the GPU test of two-pass commands runs the plan with
records whole and in halves over four consecutive draws.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Measured on an RTX 5090 (XCL_GPU_TIMES, a retail title at 1280x720):
XCL_TWO_PASS_BATCH=1 took two-pass mesh draws from 0.042 to 0.034 ms a
call and the GPU frame from about 190 to 165 ms. Barriers were about a
fifth of the cost; the rest is each draw alternating compute pass and
mesh pass, thousands of times a frame.

With XCL_TWO_PASS_BATCH=2 (1 keeps the previous commit's behaviour,
unset the original) a two-pass DispatchMesh, or ExecuteIndirect of one
command, on a direct list is deferred: what both passes read is written
to unified memory at the draw as the unbatched path writes it (each
stage's io block with the title's root arguments of that moment and its
argument table; the rewrite's constants), and the draw takes a region
of its own, as large as the draw alone would have, in a batch record
buffer of the list (XCL_TWO_PASS_BATCH_MB, 128 MiB). A run is recorded
as: one ResourceBarrier call (a UAV barrier on all resources and the
argument blocks to UNORDERED_ACCESS; with no ExecuteIndirect, a UAV
barrier on the records if the last run's mesh passes may read them),
every argument rewrite, one call taking the blocks to
INDIRECT_ARGUMENT, every compute pass, one UAV barrier on the records,
every mesh pass in the title's order. Root signatures and pipelines are
set where they change; every pass sets all its root views.
XCL_GPU_TIMES times the rewrites and compute passes of a run as one row
and each mesh pass on its program's row.

A run is recorded first:
- before any title call on the list through a slot other than the
  root signature and root argument sets, QueryInterface / AddRef /
  Release / private data / name / device / type, and ExecuteIndirect /
  DispatchMesh at their slots of the title's layout: a hook in front of
  every slot of the command list vtable (guard::make_before), which
  looks at a count of lists with deferred draws first. So pipelines,
  barriers, copies, clears, draws, dispatches, IA / RS / OM state,
  heaps, queries, predication, bundles, markers, Close, Reset and the
  console's own methods all record the run before they run. Calls from
  XCL and the runtime do not.
- at Close (cl_close) and before the PC Closes of list_x's segments;
- before a two-pass draw that is not deferred (ExecuteIndirect of more
  than one command, a bundle or compute list, a capture, records larger
  than the batch buffer, a failed preparation) and before any other
  DispatchMesh or ExecuteIndirect;
- at XCL_TWO_PASS_BATCH_MOST draws (64);
- when the next draw's records do not fit after the run's.
A Reset without Close or a released list drops its deferred draws.

Why it is the unbatched result: between the draws of a run nothing
reaches the PC list (root argument sets are kept by XCL), so each mesh
pass draws with its draw's render targets, viewports and other PC
state, and the title's GPU work cannot change the memory a pass reads.
A compute pass writes only its own region. What moves is a compute pass
of draw k ahead of the mesh pass of draw j < k: the mesh pass writes
render targets, depth and possibly memory through a pixel shader, and a
later draw reading those needs a title barrier on the console too,
which records the run first; the unbatched path did not order render
target writes before a later compute pass either.

A new batch buffer is made only while the two-pass buffers alive leave
half of XCL_TWO_PASS_MB, so batch buffers cannot get the records of the
draws that go at once refused.

The diff is large (about 600 runtime lines and 330 test lines) because
deferral, the flush hook and its flush points only work together.

Tests: a run's command order for N draws with root arguments set
between them, and after a run left open; ExecuteIndirects in a run
(rewrites first, argument blocks once, three ResourceBarrier calls);
every call of a run runs with the pipeline, root signature and root
views the unbatched path gives it; the slots that keep a run on both
console layouts and that every other title call flushes; what is
deferred; regions, the budget and the record groups; a recording that
ends drops its draws; the hook before a call sees the object and
forwards every argument; the XCL_GPU_TIMES label.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
With XCL_TWO_PASS_BATCH=2 a retail title's runs of deferred two-pass
draws were 2.4 draws long (19,272 draws in 8,192 runs) and the frame
rate did not change: the title sets a pipeline before nearly every mesh
draw, and SetPipelineState recorded the run.

Now, on a list with deferred draws, a SetPipelineState to a two-pass
pipeline goes into the run: the title's pipeline becomes the one its
next draws resolve, and the set itself (real::bind_pipeline: the PC
pipeline and what list_x::on_set_pipeline_state records with it, such
as the depth bias) is recorded among the mesh passes where the title
made it, so each mesh pass draws with the dynamic state of its draw.
Each mesh pass sets its own pipeline after such a set; each compute
pass already had its draw's pipeline and root signature. A
SetPipelineState to any other pipeline records the run first and then
binds as before. SetDescriptorHeaps still records the run first.

The log line of runs now counts the pipeline sets in a run and what
ended the runs so far, most first, by the PC method the title's call
runs (slot names from the layout through console_remap) or by the other
ends: Close, a Close of XCL's, XCL_TWO_PASS_BATCH_MOST, the batch
buffer full, a DispatchMesh / ExecuteIndirect not deferred, a pipeline
that is not two-pass.

Tests: a run across two pipelines and back (DispatchMesh and
ExecuteIndirect, root arguments between) gives every mesh pass and
pipeline set the state and order the unbatched path gives them and
every compute pass its draw's pipeline; SetPipelineState binds, goes
into the run or records it first; SetDescriptorHeaps between deferred
draws records the run first; the names of what ended a run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A title's world ran at ~4-5 frames/s with its submitting thread the limit:
ExecuteCommandLists took ~9.2 ms a submit (~19 a frame), and the submit
cost line left ~2 ms a submit (~29-39 ms a frame) outside its stages. The
sparse lock split said each submit waited ~2.1 ms for the sparse state's
lock, but not for whom.

The submit cost line now ends with what lies outside its stages:
the refresh's call around its lock wait and itself (entry), the lists
made ready for the PC, the waits for a list's previous submit, the splits
at Wait32/64BitValueX (the submission but its driver, after and previous
parts; with the waits and the sparse windows' update after each split
apart, and the splits a submit), and the end after the submission.

With XCL_LOOK_STATS=2 the sparse lock split line also says who held the
lock how long (submits, after stages, ranges, copies back settled at
fence looks, the readback thread, put-off mappings, commits, GPU-view
sources, placed buffers, CPU reads), whom each submit's wait was behind
when it began, and the submit's two other waits for the lock (the after
stage's copies back, the ranges' mapped tiles), which "sparse lock wait"
did not count. Both additions follow the existing text of the lines, so
older readers of them still parse them.

Diagnostics only: no behaviour changes. The holder is one relaxed store at
each lock and release; the times are taken only with XCL_LOOK_STATS=2.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A retail title's world (~19 submits a frame, ~4-5 frames/s, the
submitting thread the limit) waited ~2.1 ms in each submit's
before_execute for the sparse state's lock: ~45 ms a frame. Its after
stage (copies back of the lists' memory writes) and its ranges (the
mapped tiles) took the same lock through lock_state, with no priority
and outside that count. Meanwhile title threads looked at fences ~170
times a second, and each look tries the lock in a loop for up to 5 ms
(20 ms from the fence thread) to land copies back; the readback thread
tries it every 0.5 ms, nothing to land or not; put-off mappings are
sent by a thread that tries it for 2 ms. A thread trying the lock as
it is let go takes it before a waiting submit has woken.

With XCL_SUBMIT_LOCK_FIRST=1 (off unless set):
- the after stage and the ranges take the lock as before_execute does
  (lock_first: commits and decommits give way to them);
- a fence look's settle does not try the lock while a submit waits;
  that time does not count against its budget, up to the budget again
  (so it still gives up in the end: it may not wait for the lock);
- the readback thread does not try it with nothing to land or a
  submit waiting;
- put-off mappings are not sent while a before_execute waits: it
  sends them itself (flush_pending) once it has the lock.

Why it is safe: only who gets the lock next changes; every piece of
work is done under it as before, in the same order on each thread.
The GPU's view of title memory is still brought up to date under the
lock before each submit's lists. A settle that gives way gives up after
at most twice its budget instead of once, and lands what it lands as
before; what a settle could not land stays pending, as it did when the
lock was busy. What could break it: a holder that waits, with the lock
held, for a title thread that is giving way here (none: the lock's
holders wait for the GPU and for D3D12 only, which is why these threads
only try it).

Tested: a unit test of the try loop (taken at once with nobody waiting;
not taken while a submit waits, within the budget; given up after the
budget and the time given way when held).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A submit is split before a list whose Wait32/64BitValueX does not hold
yet. After the waits of each split, mapped_after_wait ran a whole
sparse before_execute again (the state's lock with its wait, copies back
landed, put-off mappings and unmappings sent, pools retired, the queue
made to wait for the sparse queue), whether or not anything was waited
for on the CPU. A retail title's world bridges its Wait64BitValueX to
GPU queue waits, and its submit cost line left ~2 ms a submit outside
the timed stages, which is where these splits are (the "sparse lock"
part counted their time, the refresh's "rest" went below 0 by as much).

With XCL_SPLIT_SPARSE=cpu (off unless set) the update after a split is
made only when one of its waits was waited for on the CPU; wait_all_on
now says so. The KickoffX path follows the same rule.

Why it is safe: the update passes no written pages (it never uploaded
CPU writes); it maps memory committed, and unmaps memory decommitted,
since the submit's own before_execute. Without a CPU wait the lists
after the split go out within the same submit call, a millisecond or
so after that before_execute, as an unsplit submit's later lists do: a
commit by another thread in that window was not ordered before them by
the title either. CPU writes made before the submit are uploaded, and
the queue made to wait for them, before its first list, as before. With
a CPU wait (the thread that writes the value may have committed memory
first) the update is made as before. What could break it: a title that
commits memory on another thread during a submit, writes it by the GPU
in a list after a GPU-side wait, and relies on that write landing (an
unmapped tile drops it); an unsplit submit has the same window.

Tested: a unit test (no CPU wait for waits that hold; a CPU wait
reported; the rule with and without the switch).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A mesh stage's root views carry no size and were asked for 64 KiB from their
address on; the rest read as zero. A detailed mesh's vertex and index data is
longer than that: its vertices collapsed onto a few points and the mesh drew as
a slab, on some runs and not on others (when another path had asked for the
same tiles). With 1 MiB the mesh is whole in every run checked. Root views of
other stages keep 64 KiB: with 1 MiB a title's character lighting went black.
XCL_VIEW_REACH_MB=0 gives the old behaviour.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
A mesh stage whose data was asked for at a submit drew with part of it still
unfilled when more than 16 MB was asked for at once (a close-up of a detailed
mesh): the unfilled part read as zero and the mesh drew as shards. Three runs
with 1024 MB: no shards, the frame rate as before. XCL_MIRROR_FILL_MB sets it.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Started without a command line, XCL asks after the game which console it
should be: Xbox Series X or Xbox Series S. The choice is the default of the
next start (last-console.txt in the data folder) and sets XCL_DEVICE_TYPE for
the run; with XCL_DEVICE_TYPE set, the question is not asked. A game sizes its
memory, resolution and detail by the console, and XCL keeps what it learns
about a game's memory per console.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Author
Owner

@⁠throny on GitHub · 2026-11-26 17:23 UTC · original

A picture regression on this branch: single black frames during loading, about every 16th frame, that main does not have. The owner of this machine saw it as a flicker on the loading screens; frame dumps confirm it.

Tested

  • RTX 4080 16 GB (driver 621.40), Windows 11 26300, release; the retail title of #505, first 120–135 s of a run (profile pick, intro, loading artwork); XCL_FRAME_DUMP=2 (every second presented frame as a quarter-size image), then a count of frames whose brightness differs strongly from both neighbours while the neighbours match each other.
build frames looked at such single frames spacing
main 2898511 (25 Nov, 19:47) 1,214 (frames 301–2,727) 0 –
nvidia-dev af2cecc4 + #684 + #2697 915 (1,801–3,629) 25 mostly exactly 16 frames
the same + nine more open PRs (today's test tree) 1,601 (301–3,501) 30 mostly exactly 16 frames
the same tree, three other builds of today 660–921 each 27, 5, 30 16 (one build: 5 only)
  • Looked at directly, each one is a frame that is black or shows only the dark background without the artwork, between two normal frames of the same still image. They start around frame 1,815 (about 60 s in, once the loading artwork is up) and go on through loading.
  • It is in the branch as it is (af2cecc4 with only #684 and the accounting line added), so it is not from the PRs I have been testing on top. I have not bisected the branch's own commits.
  • A fixed period of 16 presented frames suggests something periodic on the present or copy path rather than the title's content.

Not tested

  • Which commit of the branch brings it, AMD, whether it continues in the world (frame dumps time out there on this card).

AI use: Claude Code (Claude Fable 5.2) ran the runs, counted the frames with a script and wrote this.

**@⁠throny** on GitHub · 2026-11-26 17:23 UTC · [original](https://github.com/xcl-dev/xcl/pull/2572#issuecomment-7198931832) **A picture regression on this branch: single black frames during loading, about every 16th frame, that `main` does not have.** The owner of this machine saw it as a flicker on the loading screens; frame dumps confirm it. **Tested** - RTX 4080 16 GB (driver 621.40), Windows 11 26300, release; the retail title of #505, first 120–135 s of a run (profile pick, intro, loading artwork); `XCL_FRAME_DUMP=2` (every second presented frame as a quarter-size image), then a count of frames whose brightness differs strongly from both neighbours while the neighbours match each other. | build | frames looked at | such single frames | spacing | |---|---|---|---| | `main` `2898511` (25 Nov, 19:47) | 1,214 (frames 301–2,727) | **0** | – | | `nvidia-dev` `af2cecc4` + #684 + #2697 | 915 (1,801–3,629) | **25** | mostly exactly 16 frames | | the same + nine more open PRs (today's test tree) | 1,601 (301–3,501) | **30** | mostly exactly 16 frames | | the same tree, three other builds of today | 660–921 each | 27, 5, 30 | 16 (one build: 5 only) | - Looked at directly, each one is a frame that is black or shows only the dark background without the artwork, between two normal frames of the same still image. They start around frame 1,815 (about 60 s in, once the loading artwork is up) and go on through loading. - It is in the branch as it is (`af2cecc4` with only #684 and the accounting line added), so it is not from the PRs I have been testing on top. I have not bisected the branch's own commits. - A fixed period of 16 presented frames suggests something periodic on the present or copy path rather than the title's content. **Not tested** - Which commit of the branch brings it, AMD, whether it continues in the world (frame dumps time out there on this card). AI use: Claude Code (Claude Fable 5.2) ran the runs, counted the frames with a script and wrote this.
Author
Owner

@⁠claudetools-gh on GitHub · 2026-11-26 17:26 UTC · original

@⁠throny we traced the same flicker on our tree: it comes from the hot-block CPU-write looks, 7c18bc41 ("looks for CPU writes take the blocks written lately; a thread walks the rest"). That commit is in nvidia-dev and not in main, which fits your table.

Why. A look before each submit takes only the 2 MiB blocks written in the last hot_for (1,500 ms); a background walk finds writes to the other blocks later. A write to a block that went cold, made just before a submit, reaches that submit unseen, and the GPU reads the stale copy. On the loading art the result is a whole frame of zeros (alpha too) or the background without the character layer.

What we measured (RTX 5070 Ti, retail title, art screens):

  • The bad frames follow a cycle of the title's (216 frames here, with 8- and 16-frame components inside), and the first ~46 frames of each cycle are clean: 1.5 s, i.e. hot_for. With XCL_WATCH_HOT_MS=4000, the bad frames at cycle positions 46–119 fell from 33–34 per run to 2; with XCL_WATCH_HOT_MS=10000, to 0.
  • A 60 fps capture of the window: 96–97 black flashes in 50 s with hot looks, 0 in 85 s with XCL_WATCH_HOT=0. Not the page budget, XCL_LOOK_SKIP or resource lifetime (each A/B'd).
  • So one run with XCL_WATCH_HOT=0 should confirm it on your 4080. @⁠MacieGx's lab already turned hot looks off by default (240037e7).

What we run instead, to keep the cheaper looks: write guards on cold blocks. When a block leaves the hot set, a guard thread makes it read-only (VirtualProtect, whole 2 MiB block, only blocks that are fully committed and plain read-write), and the next look reads its write-watch bits once more (Windows keeps them across the protection change; a test checks that first). The first CPU write then faults; a vectored handler that takes no lock and does not allocate makes the block writable, puts it back in the hot set and lets the write retry. XCL's own writers into title memory (DirectStorage, file reads, decompression) and the title's own VirtualProtect/VirtualAlloc/VirtualFree hold a pin across the call; a synchronous ReadFile into a guarded block retries after opening it. With hot looks on: 0 flashes in 85 s, 0 writes missed, ~85 µs per protect, about 1,000 faults a minute on the loading screens and 4,000 in 5 min of world.

AI-assisted.

**@⁠claudetools-gh** on GitHub · 2026-11-26 17:26 UTC · [original](https://github.com/xcl-dev/xcl/pull/2572#issuecomment-7199023624) @⁠throny we traced the same flicker on our tree: it comes from the hot-block CPU-write looks, `7c18bc41` ("looks for CPU writes take the blocks written lately; a thread walks the rest"). That commit is in `nvidia-dev` and not in `main`, which fits your table. **Why.** A look before each submit takes only the 2 MiB blocks written in the last `hot_for` (1,500 ms); a background walk finds writes to the other blocks later. A write to a block that went cold, made just before a submit, reaches that submit unseen, and the GPU reads the stale copy. On the loading art the result is a whole frame of zeros (alpha too) or the background without the character layer. **What we measured** (RTX 5070 Ti, retail title, art screens): - The bad frames follow a cycle of the title's (216 frames here, with 8- and 16-frame components inside), and the first ~46 frames of each cycle are clean: 1.5 s, i.e. `hot_for`. With `XCL_WATCH_HOT_MS=4000`, the bad frames at cycle positions 46–119 fell from 33–34 per run to 2; with `XCL_WATCH_HOT_MS=10000`, to 0. - A 60 fps capture of the window: 96–97 black flashes in 50 s with hot looks, **0 in 85 s with `XCL_WATCH_HOT=0`**. Not the page budget, `XCL_LOOK_SKIP` or resource lifetime (each A/B'd). - So one run with `XCL_WATCH_HOT=0` should confirm it on your 4080. @⁠MacieGx's lab already turned hot looks off by default (`240037e7`). **What we run instead, to keep the cheaper looks**: write guards on cold blocks. When a block leaves the hot set, a guard thread makes it read-only (`VirtualProtect`, whole 2 MiB block, only blocks that are fully committed and plain read-write), and the next look reads its write-watch bits once more (Windows keeps them across the protection change; a test checks that first). The first CPU write then faults; a vectored handler that takes no lock and does not allocate makes the block writable, puts it back in the hot set and lets the write retry. XCL's own writers into title memory (DirectStorage, file reads, decompression) and the title's own `VirtualProtect`/`VirtualAlloc`/`VirtualFree` hold a pin across the call; a synchronous `ReadFile` into a guarded block retries after opening it. With hot looks on: 0 flashes in 85 s, 0 writes missed, ~85 µs per protect, about 1,000 faults a minute on the loading screens and 4,000 in 5 min of world. AI-assisted.
Author
Owner

@⁠throny on GitHub · 2026-11-26 18:17 UTC · original

@⁠claudetools-gh confirmed on the RTX 4080, thanks: with XCL_WATCH_HOT=0 the black frames are gone here too.

  • Same tree as the 30-frame row of my table above, one loading run with XCL_FRAME_DUMP=2: 0 single black frames in 1,650 frames (301–3,599), against 25–30 with the hot looks on.
  • Three world runs with XCL_WATCH_HOT=0 on the same tree: the device is still removed in 3 of 3 (0x887a0005, after 422 s, 110 s and 384 s of world), so the stale blocks are not what removes the device on this card; the removal is a separate problem.
  • Cost of the full looks in the world here: "look" is 9.5–13.5 ms of each ExecuteCommandLists (it was about 2.9 ms with the hot looks earlier today), at 3–4 submits per second, so it is not what limits this card either way; on a card that is not waiting for the GPU it will matter more.

AI use: Claude Code (Claude Fable 5.2) ran this and wrote it.

**@⁠throny** on GitHub · 2026-11-26 18:17 UTC · [original](https://github.com/xcl-dev/xcl/pull/2572#issuecomment-7200286425) @⁠claudetools-gh confirmed on the RTX 4080, thanks: **with `XCL_WATCH_HOT=0` the black frames are gone here too.** - Same tree as the 30-frame row of my table above, one loading run with `XCL_FRAME_DUMP=2`: **0** single black frames in 1,650 frames (301–3,599), against 25–30 with the hot looks on. - Three world runs with `XCL_WATCH_HOT=0` on the same tree: the device is still removed in 3 of 3 (`0x887a0005`, after 422 s, 110 s and 384 s of world), so the stale blocks are not what removes the device on this card; the removal is a separate problem. - Cost of the full looks in the world here: "look" is 9.5–13.5 ms of each `ExecuteCommandLists` (it was about 2.9 ms with the hot looks earlier today), at 3–4 submits per second, so it is not what limits this card either way; on a card that is not waiting for the GPU it will matter more. AI use: Claude Code (Claude Fable 5.2) ran this and wrote it.
CLZERO is AMD's; on an Intel CPU each clzero raises an illegal-instruction
exception that XCL answers by emulating the loop it starts
(insn::ConsoleOnly::ClzeroLoop): one exception for every run of the loop. A
retail title's memset is such a loop. While its world loaded on an Intel CPU
one of its threads was in that exception at every thread dump (300, 360 and
400 s of several runs), and XCL_GPU_TIMES measured 0.17 to 0.51 s of GPU
work in world frames that took 17 to 43 s: the card stood idle while the
CPU side crawled.

When an image is mapped on a CPU without CLZERO, each such loop (12 bytes)
becomes a call of a stand-in next to the image that zeroes the same whole
lines with rep stosb and leaves rax, the flags and every other register as
the loop does. XCL_CLZERO_PATCH=0 keeps the emulation. A lone clzero is
still emulated.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
With a wait budget (XCL_GFX_PSO_WAIT_MS, XCL_CS_PSO_WAIT_MS) a bind gives up
on a pipeline after its budget and the build is no longer wanted, so its
huge driver compile waits at the gate for the full commit headroom (3 GB).
On a machine with 4.5 GB of commit left (44.6 of 49.1 GB) 33 such builds
stood there, one for 129 s, while 44,596 draws of a retail title's world
were left out for want of them and 2 frames were presented in 200 s.

A late build now waits for half the headroom: 1.5 GB for the class from
256 KB, what one such compile takes. Builds ahead of first use and builds
nobody used wait as before.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
An indirect dispatch of a split compute program runs its whole form, which
was built at its first use on the title's thread (Chain::whole, under
build_whole). On a retail title's first world frame a render thread stood in
bind::execute_indirect -> dispatch_chain::whole behind that lock (thread
dumps at 240, 300, 360 and 400 s of a run on an RTX 3060 Ti) while the
driver compiled 1.1 MB of DXIL: no present and no submit from 224 s to the
end of the run at 420 s.

Where compute dispatches go on without a pipeline still being built
(XCL_CS_PSO_WAIT_MS), the whole form is now built once by a thread of its
own, and until it is there the program's indirect dispatches are left out
and counted as skipped, as those of any late compute pipeline. Unset, as
before.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
A title that commits a pool up front gets a video-memory tile for every
page at once (Series S profile of a retail title: 70,724 tiles in 2 s).
The line says how many of the windows' own tiles never had a CPU write
sent to them, so the cost of mapping at commit can be read from a log.
No behaviour change.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Target pages grew from 1,910 MB at a retail title's menu to 6,408 MB while its
world loaded (Series S profile, RTX 3060 Ti 8 GB), and the memory line gives
one figure for them. The new line splits them into textures with all their
pages and sampled textures with pages by level (XCL_TEXTURE_LEVEL_PAGES), a
shared page counted for each texture on it, and counts the idle pages waiting
to go back to the pools. Logged next to the memory line, only when there are
target pages. No behaviour change.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A tile the title commits in a sparse window got a pool tile at the commit
(State::commit_range -> ensure_mapped). A retail title on the Series S
profile commits a page pool of 63,632 pages of 64 KiB in a sparse window up
front: 4.3 GB of video memory at once, 3,751 MB of it in tiles the CPU never
wrote, on an 8 GB card.

With XCL_SPARSE_LAZY=1 a committed tile is listed with no pool tile (LAZY)
and gets one when it is first used:
- the CPU's first bytes for it at an upload (upload_dirty); a pool tile used
  before is cleared right behind its mapping, before those bytes go up;
- a memory write recorded on a list (immediates, fills, copies, timestamps:
  will_write), before the list runs;
- a buffer placed on it (buffer_tiles); a tile that finds no video memory is
  left out of the buffer's mapping instead of naming pool u32::MAX;
- bytes that found no video memory at an upload are owed (starved) and go
  up whole once there is some.
A copy back of a tile with no memory copies nothing. The switch is left out
on a device whose unmapped tiles do not read zeros (tiled resources tier
under 2). Off by default.

Measured on an RTX 3060 Ti 8 GB, 60 s with no input, Series S profile:
local video memory 7,503 MB without the switch, 3,022 MB with it; 542
frames against 376; 0 draws skipped either way.

Tests (sparse::tests, real GPU, skipped without tiled resources tier 2): a tile's first
bytes reach the GPU and are still there two submits later; bytes that found no
memory go up once there is some; a recorded write gives memory and a buffer never
maps the sentinel; a decommitted tile frees and parks nothing, and with the switch
off a commit maps at once.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
D3D12.X: XCL_SPARSE_LAZY=1 gives a committed sparse-window tile video memory at its first use
D3D12.X: the activity log says who holds the target pages
PE loader: a title's CLZERO loops run as native code on a CPU without CLZERO
D3D12.X: a build the title already draws without waits for half the commit headroom
D3D12.X: an indirect dispatch does not build a split program's whole form in the call
Options::default() is wave64, so the "HLSL wave32" form of
gpu_compute_thread_limits_leave_the_lanes_past_them_out was the native wave64
form: on a GPU without wave64 (every NVIDIA card) CreateComputePipelineState
refused it with E_INVALIDARG and the test failed before it checked anything.
The test only ever ran on the software adapter, where it skips. With wave64
off it passes on an RTX 5090 in all six forms that card runs (HLSL, direct and
per-lane; wave32 and split wave64).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Owner

@⁠throny on GitHub · 2026-11-26 23:00 UTC · original

eae01502 on an RTX 4080 16 GB (driver 621.40): the first launch's shader preparation hung the GPU at its very last record, and Windows restarted with bugcheck 0x116.

  • Tree: nvidia-dev eae01502 + #684 + #2794 (the preparation workers also build split programs' whole forms). All records translated offline before, and --precompile --only cs --pipelines --used-only done (4,825 pipelines made, 0 refused).
  • First launch with the title's own preparation (compute pipelines in 20 worker processes, those an earlier run used, 2,482 used shaders): it ran 1,637 s and its last line is 26502 of 26503 records checked for pipelines. Five seconds later the machine was down: VIDEO_TDR_FAILURE (the registry here turns a GPU hang into a restart), no nvlddmkm line before it, and no title frame had been shown yet. So the hang came from a worker building a compute pipeline, not from the title.
  • Slow before that, too: the last 500 records took about 2 minutes, with stretches of 10–15 s with no progress.
  • The workers' own logs are gone with the restart, so I can't name the record. If the preparation kept a line per record a worker starts (flushed), a hang like this would name its program.

What I do now: the runs on this head go on with XCL_PREPARE=0 (nearly everything is built and cached after those 27 minutes), so the A/B numbers I announced in #2688 still come tonight. I am not repeating the launch with the preparation on unattended; if someone wants it repeated to see whether it is the same record every time, say so.

AI use: Claude Code (Claude Fable 5.2) ran this and wrote it.

**@⁠throny** on GitHub · 2026-11-26 23:00 UTC · [original](https://github.com/xcl-dev/xcl/pull/2572#issuecomment-7205177976) **`eae01502` on an RTX 4080 16 GB (driver 621.40): the first launch's shader preparation hung the GPU at its very last record, and Windows restarted with bugcheck `0x116`.** - Tree: `nvidia-dev` `eae01502` + #684 + #2794 (the preparation workers also build split programs' whole forms). All records translated offline before, and `--precompile --only cs --pipelines --used-only` done (4,825 pipelines made, 0 refused). - First launch with the title's own preparation (`compute pipelines in 20 worker processes, those an earlier run used`, 2,482 used shaders): it ran **1,637 s** and its last line is `26502 of 26503 records checked for pipelines`. Five seconds later the machine was down: `VIDEO_TDR_FAILURE` (the registry here turns a GPU hang into a restart), no `nvlddmkm` line before it, and no title frame had been shown yet. So the hang came from a worker building a compute pipeline, not from the title. - Slow before that, too: the last 500 records took about 2 minutes, with stretches of 10–15 s with no progress. - The workers' own logs are gone with the restart, so I can't name the record. If the preparation kept a line per record a worker *starts* (flushed), a hang like this would name its program. What I do now: the runs on this head go on with `XCL_PREPARE=0` (nearly everything is built and cached after those 27 minutes), so the A/B numbers I announced in #2688 still come tonight. I am not repeating the launch with the preparation on unattended; if someone wants it repeated to see whether it is the same record every time, say so. AI use: Claude Code (Claude Fable 5.2) ran this and wrote it.
Author
Owner

@⁠throny on GitHub · 2026-11-27 00:35 UTC · original

On our card, a compute pipeline created from its stored driver blob takes as long as a fresh compile (RTX 4080 16 GB, driver 621.40, Windows 11 26300; nvidia-dev eff3bcab + #684 + #2794, XCL_DIRECT_DXIL=1, exe named xcl.exe with the 1 GiB heap profile of #2590).

This explains two things we kept seeing on this head: the shader preparation takes 7-8 minutes at every launch (also directly after a launch that completed it), and the world shows no frame for the first 10 minutes.

Measured with a local timing line in the preparation workers (one line per pipeline over 1 s; two launches, 192 lines):

DXIL size cache hits average time to create from the blob
under 250 KB 78 1.7 s
250-500 KB 14 5.5 s
500-750 KB 2 12.3 s
750 KB-1 MB 74 14.9 s
1-1.25 MB 17 19.7 s
over 1.25 MB 1 32.0 s
  • 186 of the 192 are hits by the workers' own rule (the pipeline's blob has the size of the stored one); only 6 were rebuilt. So the blobs are kept and accepted; the driver just needs about 17 s per MB of DXIL again.
  • Same in the title: in the world part of one 700 s run, 43 compute pipelines of 0.8-1 MB were created on title threads one after another, each logged with "driver blob supplied", 12-19 s each, 536 s in all. In those 10 minutes there were 0 presents (no device loss; video memory 0.7 GB over the budget). A second run with XCL_TEXTURE_LEVEL_PAGES=1 shows the same pattern.
  • It is not contention between workers: in the title they run one at a time and take the same time.

So for these large programs the stored blob saves nothing here. Questions for the other NVIDIA testers: do you see "driver blob supplied" followed by a finish line over 10 s for compute pipelines on your driver version? If someone on an older driver sees them load in under a second, this is a driver regression and worth knowing before anyone tunes around it.

What I can try next, unless someone already has: the same launch with the profile at 2048 MB; one launch with the NVIDIA cache folder for this exe cleared and rebuilt (in case the driver's own cache entry for these programs is rejected each time); and splitting, i.e. whether the pieces of a split program load fast where the whole form does not. Tell me which is most useful.

Numbers are from logs of real runs on the hardware above. AI use: Claude Code (Claude Fable 5.2) ran the tests and wrote this; the timing line is a local diagnostic, not a PR.

**@⁠throny** on GitHub · 2026-11-27 00:35 UTC · [original](https://github.com/xcl-dev/xcl/pull/2572#issuecomment-7206593402) **On our card, a compute pipeline created from its stored driver blob takes as long as a fresh compile** (RTX 4080 16 GB, driver 621.40, Windows 11 26300; `nvidia-dev` eff3bcab + #684 + #2794, `XCL_DIRECT_DXIL=1`, exe named `xcl.exe` with the 1 GiB heap profile of #2590). This explains two things we kept seeing on this head: the shader preparation takes 7-8 minutes at **every** launch (also directly after a launch that completed it), and the world shows no frame for the first 10 minutes. Measured with a local timing line in the preparation workers (one line per pipeline over 1 s; two launches, 192 lines): | DXIL size | cache hits | average time to create from the blob | |---|---|---| | under 250 KB | 78 | 1.7 s | | 250-500 KB | 14 | 5.5 s | | 500-750 KB | 2 | 12.3 s | | 750 KB-1 MB | 74 | 14.9 s | | 1-1.25 MB | 17 | 19.7 s | | over 1.25 MB | 1 | 32.0 s | - 186 of the 192 are hits by the workers' own rule (the pipeline's blob has the size of the stored one); only 6 were rebuilt. So the blobs are kept and accepted; the driver just needs about 17 s per MB of DXIL again. - Same in the title: in the world part of one 700 s run, 43 compute pipelines of 0.8-1 MB were created on title threads one after another, each logged with "driver blob supplied", 12-19 s each, 536 s in all. In those 10 minutes there were 0 presents (no device loss; video memory 0.7 GB over the budget). A second run with `XCL_TEXTURE_LEVEL_PAGES=1` shows the same pattern. - It is not contention between workers: in the title they run one at a time and take the same time. So for these large programs the stored blob saves nothing here. Questions for the other NVIDIA testers: do you see "driver blob supplied" followed by a finish line over 10 s for compute pipelines on your driver version? If someone on an older driver sees them load in under a second, this is a driver regression and worth knowing before anyone tunes around it. What I can try next, unless someone already has: the same launch with the profile at 2048 MB; one launch with the NVIDIA cache folder for this exe cleared and rebuilt (in case the driver's own cache entry for these programs is rejected each time); and splitting, i.e. whether the pieces of a split program load fast where the whole form does not. Tell me which is most useful. Numbers are from logs of real runs on the hardware above. AI use: Claude Code (Claude Fable 5.2) ran the tests and wrote this; the timing line is a local diagnostic, not a PR.
Author
Owner

@⁠ettehn on GitHub · 2026-11-27 01:03 UTC · original

Re your question about other NVIDIA versions: in earlier runtime logs from a 12 GB RTX 5070 Ti Laptop on 621.24, 141 of 147 compute PSO calls of at least 750,000 B DXIL with driver blob supplied finished in under 1 s. The longest took 1.713 s, and none of the 211 logged completed compute calls with a supplied blob took 10 s.

DXIL bytes Blob supplied: calls / median driver time Blob absent: calls / median driver time
750,000–999,999 127 / 0.583 s 22 / 76.847 s
1,000,000–1,249,999 18 / 0.790 s 10 / 123.001 s
1,250,000 and up 2 / 0.962 s 0 / —

I paired start/finish lines by compile ID and verified matching thread and DXIL size. These are the title-runtime calls from the same release run on Windows 11: nvidia-dev af2cecc4 + #2815–#2817 (c1bf0e8), plus #684, #2749, #2729 and #2794 locally, XCL_DIRECT_DXIL=1, seeded cache. The two columns contain different shader records. supplied means XCL passed a blob to the driver and does not independently verify acceptance. The log covers runtime, while the preparation workers' per-PSO timings are unavailable. This gives the requested under-one-second data point on another configuration, but differs in GPU and build as well as driver, so it cannot isolate a driver regression. OpenAI Codex (6.2sol) assisted with log analysis.

**@⁠ettehn** on GitHub · 2026-11-27 01:03 UTC · [original](https://github.com/xcl-dev/xcl/pull/2572#issuecomment-7206981556) Re your question about other NVIDIA versions: in earlier runtime logs from a **12 GB RTX 5070 Ti Laptop on 621.24**, 141 of 147 compute PSO calls of at least 750,000 B DXIL with `driver blob supplied` finished in under 1 s. The longest took 1.713 s, and none of the 211 logged completed compute calls with a supplied blob took 10 s. | DXIL bytes | Blob supplied: calls / median driver time | Blob absent: calls / median driver time | | --- | ---: | ---: | | 750,000–999,999 | 127 / 0.583 s | 22 / 76.847 s | | 1,000,000–1,249,999 | 18 / 0.790 s | 10 / 123.001 s | | 1,250,000 and up | 2 / 0.962 s | 0 / — | I paired start/finish lines by compile ID and verified matching thread and DXIL size. These are the title-runtime calls from the [same release run on Windows 11](https://git.gtahub.st/github/xcl-dev--xcl/issues/505): `nvidia-dev` `af2cecc4` + #2815–#2817 (`c1bf0e8`), plus #684, #2749, #2729 and #2794 locally, `XCL_DIRECT_DXIL=1`, seeded cache. The two columns contain different shader records. `supplied` means XCL passed a blob to the driver and does not independently verify acceptance. The log covers runtime, while the preparation workers' per-PSO timings are unavailable. This gives the requested under-one-second data point on another configuration, but differs in GPU and build as well as driver, so it cannot isolate a driver regression. OpenAI Codex (6.2sol) assisted with log analysis.
Author
Owner

@⁠throny on GitHub · 2026-11-27 01:10 UTC · original

Follow-up to the stored-blob timing above: I posted a plan on #2088 for a small PR that lets the shader preparation skip records whose blob it has already verified (marker with driver identity and blob length), which should cut the 7-8 minutes per launch on NVIDIA to seconds: #2088 (latest comment). Starting now in a branch off nvidia-dev; say so if it overlaps with #2906, #2794 or other work here. AI use: Claude Code (Claude Fable 5.2).

**@⁠throny** on GitHub · 2026-11-27 01:10 UTC · [original](https://github.com/xcl-dev/xcl/pull/2572#issuecomment-7207069301) Follow-up to the stored-blob timing above: I posted a plan on #2088 for a small PR that lets the shader preparation skip records whose blob it has already verified (marker with driver identity and blob length), which should cut the 7-8 minutes per launch on NVIDIA to seconds: https://git.gtahub.st/github/xcl-dev--xcl/issues/2088 (latest comment). Starting now in a branch off `nvidia-dev`; say so if it overlaps with #2906, #2794 or other work here. AI use: Claude Code (Claude Fable 5.2).
Author
Owner

@⁠throny on GitHub · 2026-11-27 01:15 UTC · original

@⁠ettehn thank you, that is exactly the comparison I needed: under 1 s with a supplied blob on 621.24, against 15-20 s here on 621.40 for the same size class. So the blobs can load fast and something on this machine prevents it.

What differs here besides the driver version: xcl.exe runs in the NVIDIA profile of #2590 (1 GiB shader heap), and the driver's own cache folder for it has grown to 18 GB. Next I time the same preparation under another exe name (no profile; the driver's cache cold at the first launch and warm at the second), which separates "profile" and "driver cache state" from "driver version". If both are slow, the remaining suspect is 621.40 itself and I will say so here. The marker PR offered on #2088 stays useful either way, since it removes the re-creation from every launch.

AI use: Claude Code (Claude Fable 5.2).

**@⁠throny** on GitHub · 2026-11-27 01:15 UTC · [original](https://github.com/xcl-dev/xcl/pull/2572#issuecomment-7207142010) @⁠ettehn thank you, that is exactly the comparison I needed: under 1 s with a supplied blob on 621.24, against 15-20 s here on 621.40 for the same size class. So the blobs can load fast and something on this machine prevents it. What differs here besides the driver version: `xcl.exe` runs in the NVIDIA profile of #2590 (1 GiB shader heap), and the driver's own cache folder for it has grown to 18 GB. Next I time the same preparation under another exe name (no profile; the driver's cache cold at the first launch and warm at the second), which separates "profile" and "driver cache state" from "driver version". If both are slow, the remaining suspect is 621.40 itself and I will say so here. The marker PR offered on #2088 stays useful either way, since it removes the re-creation from every launch. AI use: Claude Code (Claude Fable 5.2).
Author
Owner

@⁠throny on GitHub · 2026-11-27 02:46 UTC · original

Six tests fail on the clean nvidia-dev head ecc0bb57 on this machine (RTX 4080 16 GB, driver 621.40, Windows 11 26300, Rust 1.100.0, debug, no game running; cargo test --workspace --no-fail-fast -- --test-threads=4: 1825 passed, 8 failed counts over 42 test binaries, 48 ignored, 27 SKIPPED lines, most of them "no wave64"). Each was rerun alone on the clean tree with the same result:

  • hle::d3d12x::texture_upload::tests::gpu_parts_of_a_texture_go_up_and_the_rest_stays and …::pieces_hold_the_texels_of_their_levels (both panic at texture_upload.rs:1002)
  • gpu_compute_e2e: split_compute_prefers_the_offline_whole_pipeline (the child's compiled.dispatch_chain.is_some() at line 119) and async_compute_pso_registers_real_pso_and_not_standin (line 535: the released async compute pipeline is still in the translated table)
  • gpu_two_pass_cache_e2e: two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs (line 574)
  • d3d12_mesh_stream: console_ms_in_as_slot_and_ms_with_as_are_refused_cleanly (expects the AS-slot refusal, gets "MS: no NGG hardware variant")

I have not looked into causes; posting so that nobody takes them for regressions of a PR tested on NVIDIA. If they pass for others on this head, tell me and I will dig into what differs here. AI use: Claude Code (Claude Fable 5.2) ran the tests and wrote this.

**@⁠throny** on GitHub · 2026-11-27 02:46 UTC · [original](https://github.com/xcl-dev/xcl/pull/2572#issuecomment-7208423689) Six tests fail on the clean `nvidia-dev` head `ecc0bb57` on this machine (RTX 4080 16 GB, driver 621.40, Windows 11 26300, Rust 1.100.0, debug, no game running; `cargo test --workspace --no-fail-fast -- --test-threads=4`: 1825 passed, 8 failed counts over 42 test binaries, 48 ignored, 27 SKIPPED lines, most of them "no wave64"). Each was rerun alone on the clean tree with the same result: - `hle::d3d12x::texture_upload::tests::gpu_parts_of_a_texture_go_up_and_the_rest_stays` and `…::pieces_hold_the_texels_of_their_levels` (both panic at texture_upload.rs:1002) - `gpu_compute_e2e`: `split_compute_prefers_the_offline_whole_pipeline` (the child's `compiled.dispatch_chain.is_some()` at line 119) and `async_compute_pso_registers_real_pso_and_not_standin` (line 535: the released async compute pipeline is still in the translated table) - `gpu_two_pass_cache_e2e`: `two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs` (line 574) - `d3d12_mesh_stream`: `console_ms_in_as_slot_and_ms_with_as_are_refused_cleanly` (expects the AS-slot refusal, gets "MS: no NGG hardware variant") I have not looked into causes; posting so that nobody takes them for regressions of a PR tested on NVIDIA. If they pass for others on this head, tell me and I will dig into what differs here. AI use: Claude Code (Claude Fable 5.2) ran the tests and wrote this.
Author
Owner

@⁠throny on GitHub · 2026-11-27 04:15 UTC · original

Follow-up on the slow blob loads (RTX 4080, driver 621.40): the 1 GiB profile is not the cause. The same build under another exe name (no profile), second launch, so with the driver's own cache for that name warm: 67 creations from stored blobs at 750 KB-1 MB of DXIL took 19.7 s on average, 13 above 1 MB took 28.2 s (with the profile: 14.9 s and 19.7 s). The first launch under that name, with the driver's cache cold, took 50 s and 74 s for the same size classes, like a compile without a blob.

So on this machine the stored blob never makes creation fast; whatever speed there is comes from the driver's own cache, and for the large programs that is 15-30 s each. @⁠ettehn measured under 1 s on 621.24 and @⁠andrewDoing milliseconds on 616.92 (small synthetic programs, on #2951), which leaves the driver version as the main suspect here. A rollback to 621.24 would settle it; that needs the machine's owner, so it will not happen tonight.

AI use: Claude Code (Claude Fable 5.2) ran the tests and wrote this.

**@⁠throny** on GitHub · 2026-11-27 04:15 UTC · [original](https://github.com/xcl-dev/xcl/pull/2572#issuecomment-7209648536) Follow-up on the slow blob loads (RTX 4080, driver 621.40): **the 1 GiB profile is not the cause.** The same build under another exe name (no profile), second launch, so with the driver's own cache for that name warm: 67 creations from stored blobs at 750 KB-1 MB of DXIL took 19.7 s on average, 13 above 1 MB took 28.2 s (with the profile: 14.9 s and 19.7 s). The first launch under that name, with the driver's cache cold, took 50 s and 74 s for the same size classes, like a compile without a blob. So on this machine the stored blob never makes creation fast; whatever speed there is comes from the driver's own cache, and for the large programs that is 15-30 s each. @⁠ettehn measured under 1 s on 621.24 and @⁠andrewDoing milliseconds on 616.92 (small synthetic programs, on #2951), which leaves the driver version as the main suspect here. A rollback to 621.24 would settle it; that needs the machine's owner, so it will not happen tonight. AI use: Claude Code (Claude Fable 5.2) ran the tests and wrote this.
Reverts accee0a5 (mesh stage views reach 1 MiB by default) and 4ac75585
(tiles asked for at a submit are filled within 1024 MB). With both, the scenes
behind a title's full-screen title cards were not drawn at all; with the old
values (XCL_VIEW_REACH_MB=0, XCL_MIRROR_FILL_MB=16) on the same binary they
were. Neither change had fixed the heads it was meant for. Both values stay
reachable through their switches.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
With XCL_TEXTURE_LEVEL_PAGES=1 a streamed texture's level gets video
memory pages at the first upload with texels for it, and kept them for
as long as the texture lived. A streaming title takes the memory from
under the large levels of textures it no longer shows at that size (its
GPU-view pages unmapped), and the texture is uploaded again with those
levels all zeros: the pages stayed, holding zeros. In a retail title's
world on an 8 GB card the target pages grew from 2.7 GB to 4.2 GB in
four minutes with 0 MB idle, more than the title's whole texture pool
(63,632 pages, 3.98 GB), and video memory reached 10.2 GB on a 7.1 GB
budget.

Before such an upload a group of levels that has pages and is all zeros
now gives them back (vram::unmap_levels: its tiles unmapped on the
mapping queue, its pages released as a released texture's are, idle and
then back to the pools when no other texture uses them). Tiles without
memory read as zeros (tiled resources tier 2), as the zero texels the
upload would have written; the level gets pages again with its next
texels (map_levels).

Test: the level-pages GPU test goes on: the title decommits mip 0 again,
the next upload gives back mip 0's pages (86 -> 22 tiles with pages; 86
without this change), mip 0 reads zeros and the other levels keep their
texels, the other texture on the same pages keeps them, and mip 0 gets
them back with its texels.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review note on #2927: unmap_levels searched the texture's page keys and
swap_removed one for each key given back, under PAGES: quadratic in the
pages of a large level. remove_once_each counts the keys to drop and
takes one occurrence of each in a single retain.

Test: remove_once_each_takes_one_occurrence_for_each_naming (duplicates,
keys not named, nothing to take); the level-pages GPU test still passes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A pipeline stream with a console mesh shader returns from translated_mesh_stream
before note_pipeline_for_dump, so a dumped target drawn by mesh pipelines (a
title's whole G-buffer) listed them as "not known" and their pixel shaders were
not written. After the stream is made, its MS (also from the AS slot) and PS,
render target 0's blend and the formats are noted as a graphics desc's are.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A title's G-buffer target is drawn by about 30 pipelines; with 12 the rest were
cut off as "and N more", their shaders not written.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
With 16 MB a submit, a close-up of a detailed mesh was drawn while part of the
mesh data it asked for was still unfilled (it reads zero): heads came out as
shards and slabs, on some runs and not others. A/B on one binary as a Series S:
16 MB, shards in 3 of 3 runs that reached the close-ups; 256 MB, none in 5 runs,
the scenes behind full-screen title cards drawn, no change in frame rate. (1024
MB went out with build 16 together with a longer mesh view reach; the reach was
what blanked those scenes, not the fill.)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Owner

@⁠throny on GitHub · 2026-11-27 11:27 UTC · original

Bisect result for the black world on our Intel + RTX 4080 machine: it is #2892 (CLZERO loops as native code on a CPU without CLZERO); 71b9f7b2 shows the world, 7e63fc6d and everything after is black. Table and details: #2892 (latest comment). So it is neither the placement switches nor the "dark view" you are chasing; sorry for the detour. A confirmation run with XCL_CLZERO_PATCH=0 on the head is in progress. AI use: Claude Code (Claude Fable 5.2).

**@⁠throny** on GitHub · 2026-11-27 11:27 UTC · [original](https://github.com/xcl-dev/xcl/pull/2572#issuecomment-7217094310) Bisect result for the black world on our Intel + RTX 4080 machine: it is #2892 (CLZERO loops as native code on a CPU without CLZERO); `71b9f7b2` shows the world, `7e63fc6d` and everything after is black. Table and details: https://git.gtahub.st/github/xcl-dev--xcl/pulls/2892 (latest comment). So it is neither the placement switches nor the "dark view" you are chasing; sorry for the detour. A confirmation run with `XCL_CLZERO_PATCH=0` on the head is in progress. AI use: Claude Code (Claude Fable 5.2).
This pull request has changes conflicting with the target branch.
  • README.md
  • crates/xcl/src/hle/d3d12x/mod.rs
  • crates/xcl/src/hle/d3d12x/present/preparation.rs
  • crates/xcl/src/hle/d3d12x/real.rs
  • crates/xcl/src/hle/d3d12x/title_textures.rs
  • crates/xcl/src/shaders.rs
  • crates/xcl/tests/e2e.rs
  • crates/xcl/tests/gpu_two_pass_cache_e2e.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2572/head:github-bot/gh-2572'
git switch 'github-bot/gh-2572'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2572'
git switch 'github-bot/gh-2572'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2572'
git switch 'github-bot/gh-2572'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2572'
git switch 'main'
git merge --squash 'github-bot/gh-2572'
git switch 'main'
git merge --ff-only 'github-bot/gh-2572'
git switch 'main'
git merge 'github-bot/gh-2572'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.