xcl run: shader preparation in worker processes, only what earlier runs used; upstream main; sampler fix #2624

Manually merged
github merged 178 commits from github-bot/gh-2624 into nvidia-dev 2026-11-26 06:14:18 +00:00 AGit
Owner

@⁠theaustinayers on GitHub · 2026-11-26 02:56 UTC · original
xcl-dev:shader-prep → nvidia-dev · +12724 −690 · 83 files · 178 commits · merged 2026-11-26 06:10 UTC

Brings nvidia-dev up to upstream main (through #2371) and adds the faster shader preparation before a title starts.

What is in it

  • Upstream main merged in (b49be183, includes #2338, #174, #2371), with the fork's fixes kept.
  • Upstream #2555 (draft): shaders are prepared in the game window before the title runs.
  • Preparation in worker processes (crates/xcl/src/shaders.rs): the stages are translated in the host; a pack's compute pipelines are built by worker processes, each on its own slice of the records. The driver builds about two pipelines at a time for one process, so one process stood for minutes on each stretch of large compute programs. Workers: logical processors less four, 3 GB of free commit each (XCL_PREPARE_WORKERS; 1 = one process as before). A worker that fails is logged and the title starts; a worker ends when the host does.
  • Only what earlier runs used, or everything (shaders.rs, hle/d3d12x/pso_async.rs): a run keeps the shaders of the pipelines it uses in used-shaders.txt beside the DXIL cache. With that list the preparation translates only those records, and the pipeline pass builds only the compute pipelines an earlier run used. XCL_PREPARE_ALL=1 prepares every record. XCL_PREPARE=0 skips preparation: the title builds what it uses as it goes.
  • Progress (hle/d3d12x/present/preparation.rs): each pass has its own heading and count, a worker reports every record, the host logs progress every 5 s.
  • Sampler fix (gpu/recomp/mod.rs): an S# set before a branch or a loop is recognised as a static sampler after it. Before, those samples went through sampler-heap entry 0 (point, wrap, mip 0): banded gradients, stepped glows. XCL_ZERO_SAMPLER_LINEAR=1 is a diagnostic for that entry.
  • Upstream #2377 (one-wave groups meet at a group barrier; XCL_WAVE64_SPIN=1 restores the counters).
  • Taken out again after runs on a title: #2385, #2437, #2547 (suspects for blurry texture patches, exploded geometry and a stall; each still to be confirmed).

Tested

  • RTX 5090 (driver 621.14), Ryzen 9 9950X3D, Windows 11 26300, release build.
  • Software adapter, cargo test --release -p xcl --lib -- --test-threads=4 at fbfac4d0: 1538 passed, 0 failed, 25 ignored; 59 tests that open the hardware GPU not run. The four tests added after it (the_shaders_of_a_used_set_are_kept_for_the_next_run, the_key_of_one_shader_is_the_key_of_a_set_of_it, preparation_workers_leave_two_processors_and_follow_the_commit_left, static_sampler_set_before_a_branch_is_a_constant_after_it) pass at the head.
  • Retail title, preparation with 28 workers: a cold pipeline pass in 929 s, 0 of 28 workers failed; with warm caches the whole preparation in 43 s (translation 14 s, pipelines 29 s). One process before: 84 % of one pass after several minutes, then about two pipelines a minute.
  • Retail title, 16 minutes in the world without a device removal on the build before the sampler fix.

Not tested

  • The full suite at the head commit, the hardware-GPU tests and the integration tests.
  • The sampler fix and the used-shader list on a title: the first run with them is in progress.
  • Any GPU other than the RTX 5090.

AI use

  • Claude Code, Claude Fable 5.2: wrote the code, the tests and this description; ran the tests and the title runs.

🤖 Generated with Claude Code

**@⁠theaustinayers** on GitHub · 2026-11-26 02:56 UTC · [original](https://github.com/xcl-dev/xcl/pull/2624) `xcl-dev:shader-prep` → `nvidia-dev` · +12724 −690 · 83 files · 178 commits · merged 2026-11-26 06:10 UTC Brings `nvidia-dev` up to upstream main (through #2371) and adds the faster shader preparation before a title starts. **What is in it** - Upstream main merged in (`b49be183`, includes #2338, #174, #2371), with the fork's fixes kept. - Upstream #2555 (draft): shaders are prepared in the game window before the title runs. - **Preparation in worker processes** (`crates/xcl/src/shaders.rs`): the stages are translated in the host; a pack's compute pipelines are built by worker processes, each on its own slice of the records. The driver builds about two pipelines at a time for one process, so one process stood for minutes on each stretch of large compute programs. Workers: logical processors less four, 3 GB of free commit each (`XCL_PREPARE_WORKERS`; `1` = one process as before). A worker that fails is logged and the title starts; a worker ends when the host does. - **Only what earlier runs used, or everything** (`shaders.rs`, `hle/d3d12x/pso_async.rs`): a run keeps the shaders of the pipelines it uses in `used-shaders.txt` beside the DXIL cache. With that list the preparation translates only those records, and the pipeline pass builds only the compute pipelines an earlier run used. `XCL_PREPARE_ALL=1` prepares every record. `XCL_PREPARE=0` skips preparation: the title builds what it uses as it goes. - **Progress** (`hle/d3d12x/present/preparation.rs`): each pass has its own heading and count, a worker reports every record, the host logs progress every 5 s. - **Sampler fix** (`gpu/recomp/mod.rs`): an S# set before a branch or a loop is recognised as a static sampler after it. Before, those samples went through sampler-heap entry 0 (point, wrap, mip 0): banded gradients, stepped glows. `XCL_ZERO_SAMPLER_LINEAR=1` is a diagnostic for that entry. - Upstream #2377 (one-wave groups meet at a group barrier; `XCL_WAVE64_SPIN=1` restores the counters). - Taken out again after runs on a title: #2385, #2437, #2547 (suspects for blurry texture patches, exploded geometry and a stall; each still to be confirmed). **Tested** - RTX 5090 (driver 621.14), Ryzen 9 9950X3D, Windows 11 26300, release build. - Software adapter, `cargo test --release -p xcl --lib -- --test-threads=4` at `fbfac4d0`: 1538 passed, 0 failed, 25 ignored; 59 tests that open the hardware GPU not run. The four tests added after it (`the_shaders_of_a_used_set_are_kept_for_the_next_run`, `the_key_of_one_shader_is_the_key_of_a_set_of_it`, `preparation_workers_leave_two_processors_and_follow_the_commit_left`, `static_sampler_set_before_a_branch_is_a_constant_after_it`) pass at the head. - Retail title, preparation with 28 workers: a cold pipeline pass in 929 s, 0 of 28 workers failed; with warm caches the whole preparation in 43 s (translation 14 s, pipelines 29 s). One process before: 84 % of one pass after several minutes, then about two pipelines a minute. - Retail title, 16 minutes in the world without a device removal on the build before the sampler fix. **Not tested** - The full suite at the head commit, the hardware-GPU tests and the integration tests. - The sampler fix and the used-shader list on a title: the first run with them is in progress. - Any GPU other than the RTX 5090. **AI use** - Claude Code, Claude Fable 5.2: wrote the code, the tests and this description; ran the tests and the title runs. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A placement sweeps pages belonging to unrelated targets idle for two seconds. Comparing device-wide bytes before and after the second cube can therefore fail when those old targets expire. Snapshot the mapped title-page and extra-page pool/tile identities for the cube and require the new and original resources to share all of them. Keep the existing placement-growth, reclamation and pixel-readback checks.
The existing PendingWait checks construct the comparison directly, and the submission check manually pushes a 32-bit wait. Exercise wait64_x itself so interpreting the trailing flags slot as a mask cannot return unnoticed. Check high counter bits, garbage flag upper halves, unfinished and equal counters, and the unchanged Wait32 mask; an already satisfied Wait64 must keep the submitted batch together.

The production correction from Sr-0w PR #218 is already in upstream d4f17ca. This commit ports only the two original synthetic controls from42297943db3cfd4cf14ee37a7a0a53b8888d0d2c, byte-identical. Earlier separate negative controls captured both incorrect stored mask and a 2000ms false timeout/batch split with the old behavior. Fresh release focused run on official508a0c7 plus these tests:2passed,0failed,0ignored. Broader validation follows on this clean head.

Assisted-by: OpenAI Codex (exact model variant not exposed)
The title-texture and VRAM tests serialise on TEST_LOCK and VRAM_TEST_LOCK
and took them with .lock().unwrap(). When one holder panics (on main,
placed_title_textures_share_vram_and_preserve_pixels fails on RDNA2, the
packed-mip case #470 fixes), the mutex is poisoned and every later test
that takes it fails with PoisonError, though it passes alone:
transitions_apply_when_their_list_is_submitted and
d32s8_targets_take_their_own_size_of_video_memory.

The locks guard no data, so take them the way the crate's other test
locks already do (ASYNC_TEST_LOCK, READING_CB_TEST_LOCK):
unwrap_or_else(|e| e.into_inner()). Test code only.

Measured on an RX 6650 XT, cargo test --workspace -- --test-threads=4:
lib tests 647 passed, 3 failed before; 649 passed, 1 failed after.

AI-assisted.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The device-wide page count also drops when unrelated idle pages are swept, so this check compares that resource's extra-page tiles instead. The cubemap check in the same test stays with #447.

Assisted-by: Grok Build (Grok 4.7)
A DPP instruction's text stopped at its registers too: the control that
says which lane each lane's first source comes from (quad_perm, row_shl
/ shr / ror, row_mirror, row_half_mirror, row_share, row_xmask), the row
and bank masks, bound_ctrl, fi, the sources' neg / abs and the DPP8 lane
selects were left out, so `v_mov_b32_dpp v5, v1` stood for every one of
them. The recompiler reads all of these; only the printed line dropped
them.

The text follows LLVM's: all 2229 lines of its gfx10 DPP16 and DPP8
tests in tests/data/llvm-amdgpu now read the same (none did), apart from
the implicit vcc operands and the `_dpp8` suffix this disassembler has.
A control RDNA2 has no name for is printed as `dpp_ctrl:<number>`.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
D3DMetal (macOS, CrossOver) has no WARP adapter: EnumWarpAdapter
returns 0x887A0004 (DXGI_ERROR_UNSUPPORTED), and the unwrap panics.
The test uses WARP to exercise write_frame's decoder without a
physical GPU, so it now reports "no WARP" through
runner::skip_test, like the other d3d12x tests that need a device,
and returns. Windows has WARP, so nothing changes there. (#258)

Assisted-by: Claude Code (Claude Opus 4.6 wrote the change; Claude Opus 5.5 rebased it onto 077ce40 and switched it to skip_test)
gpu_depth_buffer_created_for_unordered_access_is_placed (#1353) first checks
that a depth buffer without the UAV flag can't be placed in
UNORDERED_ACCESS. Microsoft's D3D12 runtime refuses that state;
vkd3d-proton under Wine does not validate it and creates the resource, so
the test failed on every Linux run although the state XCL asks for
(DEPTH_WRITE, from pc_initial_state) is accepted there too. The refusal is
now asserted only when not under Wine; the rest of the test is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Add integration contract tests for the raw x64 thunks emitted by
crates/xcl/src/hle/d3d12x/guard.rs (make_guard, make_split,
make_layout_split, make_tracer, make_call_tracer) using a mapped
executable call trampoline so game-image caller paths are exercised
alongside non-game runtime callers.

Verified 3x via cargo test -p xcl --test d3d12x_guard_contract -- --test-threads=2 (5 passed, 0 failed, 0 ignored).
Adds host-driver parity integration tests for ID3D12Device::CreateCommittedResource (slot 27, Part of #480) comparing buffers, 2D/3D/RT/DS textures, invalid descriptors, and unknown console IID fallback against the unhooked PC driver on the same adapter.

Verified with cargo test -p xcl --test d3d12_create_committed_resource -- --test-threads=1 (2 passed, 0 failed on NVIDIA GeForce GTX 1660 SUPER).

Assisted-by: Antigravity (Gemini 4 Neon)
Adds host-driver parity integration tests for ID3D12Device::CreateDescriptorHeap (slot 14), GetDescriptorHandleIncrementSize (slot 15), and CreateFence (slot 36) (Part of #480) comparing descriptor layouts, increment sizes, fence values/Signal, ppv == null, invalid descriptor handling, and console IID fallback against the unhooked PC driver.

Verified with cargo test -p xcl --test d3d12_descriptor_heap_and_fence -- --test-threads=1 (3 passed, 0 failed on NVIDIA GeForce GTX 1660 SUPER).

Assisted-by: Antigravity (Gemini 4 Neon)
D3D12CreateDevice gives every test the process's one device. Once another
test adopted it (gpu_placed_console_depth_target_with_clear_value and
others), the buffer coherent_buffer_sanitizes_console_flags_and_state
places on its imported heap is adopted too, and its last Release goes to
late_release::hold. While a queue of a test running in parallel still has
work, the buffer is held, the heap pins the pages, and VirtualFree fails
with ERROR_INVALID_PARAMETER (87). The test now retries VirtualFree for up
to 10 s and still asserts that it succeeds.

Part of #1487.

Assisted-by: Claude Code (Claude Opus 5.5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Add host D3D12 parity integration tests for ID3D12Device::CreatePlacedResource
(slot 29), extending #480 without requiring retail game files or console DLLs:

- Compare DEFAULT/UPLOAD/READBACK placed buffers (with Upload Map/Unmap write-read)
  against the unhooked PC driver on the same adapter.
- Compare non-RT/DS textures (R8G8B8A8, BC1) and RT/DS textures (RTV/DSV with clear
  values) against the host driver.
- Verify misaligned/out-of-bounds offset and null descriptor error parity, plus
  unknown console IID fallback to ID3D12Resource.

Verified locally with:
cargo test -p xcl --test d3d12_create_placed_resource -- --test-threads=1
(3 passed, 0 failed)

Assisted-by: Antigravity (Gemini 4 Neon)
Add host D3D12 parity integration tests for ID3D12Device::CreateQueryHeap
(slot 39) and ID3D12Device::CreateCommandSignature (slot 41), extending #480
without requiring game files or console DLLs:

- Compare OCCLUSION, TIMESTAMP, PIPELINE_STATISTICS, and SO_STATISTICS query
  heaps against the unhooked PC driver, plus invalid descriptors and unknown
  console IID fallback to ID3D12QueryHeap.
- Compare DRAW, DRAW_INDEXED, and DISPATCH command signatures against the
  host driver, plus invalid strides/argument counts/node masks and unknown
  console IID fallback to ID3D12CommandSignature.

Verified locally with:
cargo test -p xcl --test d3d12_query_and_command_signature -- --test-threads=1
(2 passed, 0 failed)

Assisted-by: Antigravity (Gemini 4 Neon)
Add host D3D12 parity integration tests for CreateCommandQueue (slot 8),
CreateCommandAllocator (slot 9), CreateCommandList (slot 12), CreateCommandList1
(slot 51), and CreateRootSignature (slot 16), extending #480 without requiring
retail game files or console DLLs:

- Compare DIRECT/COMPUTE/COPY queues and allocators against the host driver,
  including invalid descriptor parity and unknown console IID fallbacks.
- Compare CreateCommandList and ID3D12Device4::CreateCommandList1 across queue
  types, mismatched-allocator failure parity, and console IID fallbacks.
- Compare empty and parameterized serialized root signatures, console IID
  fallback, and XCL's empty root-signature fallback on malformed bytecode.

Verified locally with:
cargo test -p xcl --test d3d12_command_objects_and_root_sig -- --test-threads=1
(3 passed, 0 failed)

Assisted-by: Antigravity (Gemini 4 Neon)
Register a synthetic title caller to exercise the console path at slot 8.
Compare queue descriptions against the native call on the same device,
including console flag stripping and DMA-to-copy translation.

Part of xcl-dev/xcl#480.

Assisted-by: OpenAI Codex (GPT-6.2 Sol)
Add an integration test suite over the generated d3d12_layout.rs table and its layout.rs helpers: unique names/iids, non-empty parent/method lists with the IUnknown head, IID round-trip through parse_guid/guid_string, chain() most-derived-first ordering with no non-versioned siblings, slot() for known methods and rejected for unknown/misspelled, and find/slot/chain consistency. A generator regression (bad IID, duplicate slot, chain leaking a non-versioned sibling) now fails in CI instead of silently misaligning D3D12.X slots.
Pin the public contract of the console descriptor heaps from a new non-runtime test file (register / start / slot / words_at / write / copy_words / unregister): window-0 placement, per-slot arithmetic for non-shared view heaps (index 2k, pc_srv base+2k*inc, pc_uav base+(2k+1)*inc, pc_gpu_uav +1 slot), sampler slot arithmetic (one 16-byte slot per index), T# image copy renumbering (word 0 = destination index), buffer V# kept verbatim, sampler S# index-in-word-3-[11:0] renumbering, end-of-heap bounds, start stability across slot calls, unregister forgets the heap, and non-shader-visible heaps report no GPU UAV.
a_new_list_takes_no_copy_scratch_of_an_earlier_one asserted while it held
COPY_SCRATCH. When an assert failed, the lock was poisoned; the test's
command list was then dropped during unwinding, its Release hook
(real::cl_release -> on_release -> release_copy_scratch) panicked on the
poisoned lock, and a panic there is non-unwinding, so the whole lib test
binary aborted ("thread caused non-unwinding panic. aborting.", exit
status 9). Every test result of that process was lost.

Measured under Wine 11.22 + vkd3d-proton v3.1 on an RTX 5060 Ti, where
gpu_more_atomics_sub_dword_scratch_valu hangs the GPU and the device is
removed for later tests (the fence then reads as complete, so this test's
"stays until the fence" check fails): main aborted in 2 of 2 runs; with
this change the binary runs to the end and reports the failures.

The checks are now read under the lock and asserted after it is released.

Assisted-by: Claude Code (Claude Opus 5.5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
gpu_raw_window_view_reaches_its_top compiles a cs_6_6 shader that indexes
ResourceDescriptorHeap, but checked only for a GPU and DXC. On a device
without SM 6.6 (Windows 10's inbox D3D12, no Agility SDK) the pipeline is
refused and the test failed with 0x80070057 at CreateComputePipelineState
instead of skipping like the runner's GPU tests. It now checks the shader
model first and skips with the same message (agility::format_no_sm66_message).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A panic was printed to stderr only. One of XCL's own threads that
panics is gone for the rest of the run, and `xcl.log`, the file a
report carries, had no line of it: in a retail title's run under Wine
(RTX 4060 Ti) `xcl-sync-watchdog` panicked as it started (the race
#1926 fixes) and the log reads like any other stall.

The host installs a panic hook that writes the thread's name, the place
and the message as an ERROR line, then calls the hook that was there.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
v_dot2_f32_f16 applied only NEG[2] to SRC2 and ignored NEG_HI[2]. SRC2
is an f32 operand, and for an f32 operand of a VOP3P instruction the
NEG_HI bit is its ABS modifier, as v_fma_mix* already decodes it:

- LLVM SIDefines.h, SISrcMods: "NEG_HI = ABS"
- AMDGPUISelDAGToDAG.cpp, SelectVOP3PModsF32 calls SelectVOP3Mods, which
  folds fabs into the ABS bit
- llvm.amdgcn.fdot2.ll, v_fdot2_abs_c: fabs(c) selects to
  "v_dot2_f32_f16 v0, v0, v1, v2 neg_hi:[0,0,1]"

So |c| was read as c, and -|c| as -c. With v1 = v2 = 0x3C003C00 and
v3 = -5.0, neg_hi:[0,0,1] gives 7.0 (was -3.0) and neg_lo:[0,0,1]
neg_hi:[0,0,1] gives -3.0 (was 7.0). ABS is applied before NEG, as in
v_fma_mix*.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The direct DXIL translator (XCL_DIRECT_DXIL=1) ignored NEG_HI[2] of
v_dot2_f32_f16, the ABS of its f32 accumulator, as the HLSL path did
before #1286. Apply it before NEG[2], as #1286 does in the HLSL path.

#1286's GPU test failed with XCL_DIRECT_DXIL=1 on an RTX 5070 Ti
(neg_hi:[0,0,1] with c = -5.0 gave -3.0, not 7.0) and passes with this
change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Covers GetResourceAllocationInfo (slot 25) and GetCustomHeapProperties
(slot 26) through both the C++ and C ABIs, using a synthetic title-image
caller so the console hooks are reached. The zero-width buffer is compared
with the host's answer rather than UINT64_MAX, which vkd3d-proton does not
return.

Part of #480.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Compares XCL's hooked ID3D12Device::CreateReservedResource (slot 30) with
the unhooked driver slot on the same adopted device, so both paths use one
adapter even when XCL_ADAPTER selects a non-default GPU. Covers buffers and
2D/3D textures (GetDesc and GetResourceTiling, including a range starting at
subresource 1), invalid descriptors, the console IID fallback, clear values
and a null ppv. Skips go through runner::skip_test.

Part of #480.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
detect_wave64 tells the wave size from the code: 32-bit EXEC writes and no
64-bit ones mean wave32, anything else wave64. A wave32 program that never
writes EXEC has nothing in its code to tell, so it was translated as wave64:
its cross-lane reads (v_readfirstlane, v_readlane, permutes) then span 64
threads instead of 32.

The FSSM header has the answer: bit 5 of the flags word at +0xD4. Measured
on a retail shader pack (26 698 programs): the bit is set for all 2 608
programs the code shows to be wave32 and clear for all 24 036 the code takes
for wave64, except 54 compute programs with the bit set and no EXEC write in
their code. 27 of those 54 have cross-lane instructions (v_readfirstlane,
v_readlane, permutes, LDS). As wave32 all 54
translate completely and compile with DXC.

fssm_wave64 takes wave32 from the header and leaves everything else to
detect_wave64, so only those programs change. An unused field (0xDEADBEEF)
and other FSSM versions say nothing.

A compute program through the PSO hook (gpu_compute_e2e) shows the effect:
64 threads store v_readfirstlane of their thread id; with the flag threads
32..63 read thread 32, without it they read thread 0.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
In crates/xcl/src/gpu/dxil/lower.rs, Lw::salu unconditionally called read64 on _b64 saveexec/wrexec forms even in wave32 (!self.wave64) and unconditionally read sreg(127) (EXEC_HI) before branching on (!self.wave64 || name.ends_with("_b32")). On 32-bit-only source encodings such as m0 (SSRC0 = 124), wave32 S_AND_SAVEEXEC_B64 failed translation with Err("...: op"), and on SGPR sources it spuriously touched s[n+1] and EXEC_HI (s127).

Move source reads and EXEC_HI handling inside the wave32/_b32 vs wave64 _b64 branches to mirror HLSL (#191), and add unit/disassembly and wave32 RTX 4060 GPU regression tests in lower.rs.

Part of #1269

Assisted-by: Google Antigravity (Gemini 4 Neon)
In `crates/xcl/src/gpu/dxil/lanes.rs`, `Lw::ballot` called plain
`WaveActiveBallot` even in pixel shaders (`self.gfx` with `ps: Some(_)`).
Under SM 6.6, `WaveActiveBallot` excludes helper lanes, whereas `Lw::rla`
already uses quad reads for pixel shader helper lanes and the HLSL path
uses `ballot_px` / `quad_bits` + `ballot_px_quad` (PR #134 / #105 item 1).
After `s_wqm_b32`/`s_wqm_b64`, dropping helper-lane bits from compare
masks corrupted `v_cndmask` / `s_and_saveexec` values read via DPP quad
derivatives and caused `v_readfirstlane` waterfall loops to spin until
the loop budget.

Port both parts of #105 item 1 and #134 to the direct DXIL translator:
- Split `Lw::ballot_ps_quad(q)` out of `Lw::ballot_ps(cond)` in
  `crates/xcl/src/gpu/dxil/lanes.rs`: four `WaveActiveBallot` passes
  spread each quad member's bit `p` from live lanes back to bit `4k + p`,
  preserving the wave32-in-wave64 `gfx_half` select, constant-false
  `(0, 0)` short-circuit, and live-lanes-only entry `EXEC` (`setup_pixel`
  calls `gfx_common_init` before setting `self.gfx`). Non-VOPC PS masks
  (such as `v_add_co_u32` carries) route through `ballot_ps` ->
  `ballot_ps_quad`.
- In `crates/xcl/src/gpu/dxil/lower_valu.rs`, evaluate plain pixel-shader
  VOPC compares per quad member (`p in 0..4`) by quad-reading VGPR source
  operands with `QuadReadLaneAt` (leaving SGPRs such as `v_readfirstlane`
  results and constants wave-uniform) and feeding the 4-bit quad mask to
  `Lw::ballot_ps_quad`, avoiding `QuadReadAcross*` on compare predicates
  that crash AMD RDNA2/3/4 `amdxc64` (#134).

Add CPU/DXIL-validator and CI-WARP-safe GPU draw regression tests in
`lanes.rs` (384/1024 wrong pixels pre-fix on RTX 4060 -> 0/1024 post-fix
for both wave64 and wave32 pixel shaders, with zero `dx.op.quadOp` in
VOPC pixel shaders).

Part of #1269

Assisted-by: Google Antigravity (Gemini 4 Neon)
The stream reader's payload table (subobject_payload) had no test: a wrong
size or alignment silently mis-parses every pipeline stream. Pin each known
type to the windows crate's constant and the header struct's own size and
alignment, and pin that 23 is unknown - the console's mesh numbering puts AS
there and mesh at 24 (the PC's AS), the shape real.rs takes as a mesh-only
pipeline. Part of the validation line claimed on #1269.

Co-Authored-By: Claude Code <[email protected]>
`frexp_mant` returned HLSL frexp()'s mantissa, which is unsigned: a
negative input gave a positive mantissa (-10.125 -> +0.6328125) and -0
gave +0. The ISA keeps the sign, as XCL's f64 path (`frexp_mant_d`)
already does. The helper now ORs the input's sign bit back in;
v_frexp_mant_f16 goes through the same helper. Fix and diagnosis by
joeypercia in #580.

The test runs v_frexp_mant_f32 (also with the NEG modifier),
v_frexp_exp_i32_f32 and v_frexp_mant_f16 on negative inputs, -0, +0 and
-inf: before, it failed on the first negative input (+0.6328125 for
-10.125); after, it passes.

Fixes #580

Co-authored-by: joeypercia <[email protected]>
Assisted-by: Claude Code (Claude Opus 5.5)
frexp_mant took its mantissa from frexp_dxc, which, like DXC's frexp,
drops the sign, so a negative input came back positive (0xC1220000 gave
0x3F220000, not 0xBF220000). The ISA's mantissa keeps the sign, as
frexp_mant_d already does for f64 and as #587 makes the HLSL path do.
The sign bit is ORed back in; ┬▒inf and NaN still return the input.

gpu_frexp_mant_f32_f16_keep_the_sign now passes with XCL_DIRECT_DXIL=1.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YPhfiWsdJcDBLYSS8edLyS
Every FSSM stage record (at the stage descriptor - 0x40) points at two
tables of 20-byte entries: the root layout (where each root argument, static
sampler and descriptor-heap address sits in the program's user data) and the
resources the program uses. `xbox::root_layout` reads them with every offset
and count bounds-checked, and `xcl disasm` prints them under each hardware
stage. Nothing else calls it yet: binding and translation are unchanged.

The layout was worked out from every stage of a retail title's shader pack
with a standalone decoder: all counts read in bounds, no
entry type outside 0/1/3/4/5/6, and every used resource agrees with the root
entry of its slot. User-data dword i is s(i) in CS, VS and PS and s(i+8) in
NGG stages, checked against the disassembly of a few programs. That these
tables exist and what their fields mean was first learned by reading the
VIctory project's container parser (GPL-3.0) as a reference; no code was
taken from it.

Part of #697.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The README describes precompiling shaders, but users looking at xcl --help cannot discover that workflow. List its stage filter, compute pipeline cache and used-only option, and check the flags in the CLI output. Fixes #2216.
In HLSL 2021 pixel shaders (#define XCL_PIXEL 1), PRELUDE::rla() indexed
uint4 xcl_lv with a runtime index xcl_lv[min(h >> 5, 3u)] and used scalar
ternary/if chains. DXC lowered every rla() call site into a [4 x i32]
alloca local array plus conditional branches; across the retail pixel
shader corpus (12,056 unique PS), 7,634 shaders call rla() (up to 212
calls / 212 local arrays in a single pixel shader).

Replace xcl_lv[min(h >> 5, 3u)] with inline branchless select() over
xcl_lv.{x,y,z,w} (self-contained inside PRELUDE without depending on
PRELUDE_MEM::pick4) and replace the scalar ?: and if chains in rla() with
select() and and().

Part of #2088
Part of #1269

Assisted-by: Google Antigravity (Gemini 4 Neon)
Read the existing i1 and destination type instead of creating unrelated integer types. Retain the i32 intermediate for the affected i1-to-i64 sign extension and cover both behaviors with CPU unit tests.

Assisted-by: OpenAI Codex (GPT-6.2 Sol)
Follow-up to #1991 (shared shader-visible PC sampler heap `GLOBAL_SAMPLER`)
fixing three bugs in `crates/xcl/src/hle/d3d12x/console_heap.rs`:

1. `release_global_sampler` pushed raw `(first, count)` entries into `s.free`
   without guarding `count == 0` or coalescing via `merge_release` (unlike
   `release_global`). Freeing adjacent small sampler pages (< 8 slots) left
   unmerged shards that could not satisfy an 8-slot `SAMPLER_PAGE_SLOTS`
   request, prematurely exhausting the 2048-descriptor `GLOBAL_SAMPLER` heap
   and dropping new pages onto reserved zero-sampler slot 0. Guard `count == 0`
   and coalesce through `merge_release(&mut s.free, first, count)`.
2. `in_global(obj)` checked `h.obj == obj && !h.pages.is_empty()` without
   `!h.sampler`, so shared sampler heaps (which now populate `h.pages`) falsely
   reported true for the shared view heap. Add `&& !h.sampler`.
3. `census()` compared sampler `w[3] & 0xFFF == k` instead of the shared
   sampler page index, misreporting live shared samplers as "with another" in
   `XCL_TRACE_FRAME`. Extract `sampler_own_index(&h.pages, k)` (matching
   `slot()` and view-heap `own_index`) and use it in `census()`.

Assisted-by: Google Antigravity (Gemini 4 Neon)
Replace the single-queue `(retire_fence, retire_value, retiring)` state on
`Pages` with a per-device `RetireQueue` that signals a per-queue fence on every
known live queue of the device (`before_execute` queue, `present::known_queues`,
`title_textures::upload_queues`, `sparse::queue`) before queueing a sealed batch
of reclaimed heaps. Completed batches (including their fence refs) and pruned
fences for dead queues are dropped outside all locks.

Also track `dev` on `Arena<H>` so `Arenas::take_for` and `sweep_dropped_for`
isolate devices and return expired arena heaps instead of dropping them
synchronously inside `ARENAS.lock()`, retiring them via `RetireQueue` outside
all locks.

Part of #1773
Assisted-by: Google Antigravity (Gemini 4 Neon)
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]>
AMD's driver returns x | bfrev(x) for Bfrev.i32(trunc(mul i64)) when the
product is the same on every lane. The i64 Bfrev lowering reverses each
32-bit half after a trunc / lshr of the i64 value, so a Bfrev of an i64
product hit it: fuzz seed 817 (#2115) read 0xfe53ffff for 0x4a43fdeb on an
RX 7800 XT. Reduced to Bfrev.i64(mul i64 3, 5).

The halves are now reversed with five shift-and-mask steps. The i64 case
is the only one that goes through trunc of an i64 value; Bfrev.i32 on a
plain i32 is unchanged. The new test fails without the change on the
RX 7800 XT (low word 0xf000000f, expected 0) and passes with it.

Part of #2115. Seed 783 is a separate driver bug (IMax.i64 after an i64
udiv); the compare / select lowering in #1946 fixes it.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Follow-up to #1988 and #1991 fixing three D3D12.X resource/format bugs in
`crates/xcl/src/hle/d3d12x/device_x.rs` and `crates/xcl/src/hle/d3d12x/real.rs`:

1. Clear-value format mismatch on promoted B5G6R5 / B8G8R8X8 RT+UAV textures:
   #1991 promoted B5G6R5_UNORM (85) + UAV -> R8G8B8A8_UNORM (28) and
   B8G8R8X8_UNORM (88) + UAV -> B8G8R8A8_UNORM (87) in `pc_resource_desc`,
   but resource creation still mapped `clear.Format` via `pc_clear` (leaving
   85/88 unchanged), causing D3D12 `CreateCommittedResource`/`CreatePlacedResource`
   to fail with `E_INVALIDARG`. Add `pc_clear_format` / `pc_clear_for_desc` to
   align `(28, 85) => 28` and `(87, 88) => 87` (preserving native 85/88 on
   RT-only textures without UAV) across `create_placed_resource_x`,
   `dev_create_committed_resource_x`, `dev_create_placed_resource_x` fallback,
   and `own_memory_if_larger_on_the_pc`.
2. Pointer-ABA stale cache in `device_format_supports_uav`:
   `UAV_FORMAT_SUPPORT` keyed by raw `device as usize` pointer without eviction
   on release; reusing a freed device address on another adapter returned stale
   UAV support. Key `UAV_FORMAT_SUPPORT` by `((luid.LowPart, luid.HighPart), format)`
   via `ID3D12Device::GetAdapterLuid()` (matching `TYPED_UAV_SUPPORT`).
3. Device-unaware retry in `get_copyable_footprints_x`:
   Retry used `pc_resource_desc(&x)` instead of `pc_resource_desc_for_device(this, &x)`,
   leaving device-unsupported `ALLOW_UNORDERED_ACCESS` intact so
   `GetCopyableFootprints` still returned `UINT64_MAX`. Switch to
   `pc_resource_desc_for_device(this, &x)`.

Assisted-by: Google Antigravity (Gemini 4 Neon)
XCL_RUN_SECONDS, XCL_ACTIVITY, XCL_THREAD_DUMP_AT, XCL_TRACE_FAULTS, XCL_TRACE_MEM,
XCL_TRACE_IMPORTS and XCL_D3D12_TRACE are read by the runtime and used in bug
reports and in the issue threads, and none of them was in the README. Each entry
says what lands in xcl.log and what the accepted values are, as read from the code.
XCL_SKIP_BINK, XCL_MUTE_TTS, XCL_FRAME_INTERVAL_US, XCL_WAIT_TIMEOUT_MS and
XCL_GPU_WAIT_TIMEOUT_MS change how a title runs and were only described in code
comments. Each entry gives the values the code accepts and the default, as read
from bink.rs, xgameruntime/api.rs, d3d12x/frame.rs and d3d12x/list_x.rs.
A compute pipeline that is not built yet was waited for at its bind: the
title's thread stood in SetPipelineState, built the pipeline itself, and
only then reached the next one. A title that binds many unbuilt compute
pipelines in one frame got them one after another.

SetPipelineState now binds what is there. A Dispatch, or an
ExecuteIndirect that dispatches, whose pipeline is still being built
ends the list's segment, as a mid-list Wait after a Write64 does, and
gets a closed segment of its own between that one and the next: a
translated dispatch sets everything it needs itself (root signature,
the six views, the pipeline), so it can be recorded later than the
calls around it. The title's threads go on recording, and the pipelines
the frame binds next reach the workers while this one is built. At
ExecuteCommandLists (and KickoffX) each such segment is reset and its
call recorded through the same wait the bind made (XCL_PSO_WAIT_MS
still bounds it). A dispatch whose pipeline fails to build is skipped
and counted, as before.

While a submit stands in that wait, the lists it carries and their
Write64 signals are not on the queue yet, and another queue's GPU wait
for one of them ran into the 5 s watchdog and was released on the CPU
(3 lines a run). The watchdog's clock now stands while a bind or submit
is held for a build.

A put-off pipeline goes before the workers' queue: behind a start-up
backlog the submit thread would build them itself, one after another,
where several title threads built at once before (a debug build on
Windows stopped presenting on its first screen that way).

At the submit the next four of its put-off pipelines are marked wanted
as it goes, the leave a title thread's own build has today, so about as
many are in the driver at once as the title's threads had there before.

The segments of a title list record on an allocator of that list's own,
because the title's may be recording another list by the submit; it is
not released while the GPU may still run from it. They share one
argument arena: a block each filled the coherent window.

A recording takes 256 extra segments (32 before), two for each such
call. Past that, on a list that cannot be split, and under predication
the call waits where it is, as before. The console-list replay, Reset,
ClearState and KickoffX's re-open wait where they did.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
A put-off dispatch takes two segments of its list, and a list had 256. The
retail title's first world frame records lists that put off 207 and 209
dispatches (Linux, RTX 4060 Ti): past the 128th the dispatch waited in the
bind again, and both recording threads stood in execute_indirect for the rest
of a 300 s run. With 1024 the same frame put off 1,392 dispatches, none
waited in a bind, and the submit recorded all of them.

The segments are command lists the title list keeps: 1,000 more of them cost
55 MB in the test under Wine.

The test puts off 210 dispatches on one list; with 256 the 129th waits.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The review of #2313 found two inexact lines. The import trace compares a word with the
lower-cased "<dll file name>!<Function>", extension included, so the example's
`-kernelx!GetTickCount` excluded nothing and is now `-kernelx.dll!GetTickCount`. And
XCL_TRACE_MEM is read with var_os in gpu/uma.rs as well, where any value also logs XCL's own
allocations of 1 MB or more in the committed window and the ones that fail.
Track `frame: Option<u64>` and `frame_since: Option<Instant>` on `PcCalls` so
monotonic frame advances (`frame > prev`) record `frame_since = Some(now)` and
clamp call start timestamps in `end()` and `holds()` (while advancing frame in
`begin()` too, reading `present::presents()` under `PC_CALLS.lock()`). A long
PC call that started on frame N and ends after frame N+1 is presented no longer
charges pre-frame-N+1 duration into frame N+1's `PC_CALL_HOLDS_AFTER` budget,
stale lower frame numbers never rewind `frame` or clear `spent`, and calls
stuck >= 250 ms after a frame still hold the title.

Also drop unstarted orphaned `Job` closures immediately in `released()` (outside
`PENDING`, `done`, and `job` locks via `drop_unstarted_job`), waking any
concurrent waiter when taking an unstarted job, and mirror that cleanup in the
`preload()` and normal worker orphan checks so captured COM objects and shader
bytecode are not pinned until workers drain deep queues.

Assisted-by: Google Antigravity (Gemini 4 Neon)
Persist deterministic negative cache markers (.err) alongside positive shader cache entries so repeated boots do not re-lower refused programs or re-invoke DXC on deterministically failing HLSL:

- dxc.rs: cache deterministic DXC compiler rejections (raw error starting with 'dxc: ') in {key:016x}.err (keyed by crate version, DXC toolchain identity, profile, entry, and HLSL source). Subsequent runs return the identical error text with zero DXC invocations. Transient/missing-DLL errors and cached_only deferrals are never cached.
- pso.rs: cache translator refusals and compile errors in translated/v2/{ident:016x}/...err (keyed by XCL_TRANSLATOR_SOURCE_ID, DXC toolchain identity, blob hashes/length, stage, sampler_base, windows, and split_wave64). Updating translator sources, DXC DLLs, or wave mode automatically invalidates prior markers; debug/capability env overrides bypass the cache via cache_allowed.

Fixes #1412.

Assisted-by: Antigravity (Gemini 4 Neon)
The ExecuteIndirect regression used D3D12CreateDevice(None), ignoring
XCL_ADAPTER and the Agility device path before compiling a cs_6_6 shader.
On this hybrid laptop the isolated main test failed PSO creation with
0x80070057 even with XCL_ADAPTER=nvidia.

Select the requested adapter through the existing helpers, create its
device through Agility, and report missing DXC or SM 6.6 as explicit skips.
The Quadro RTX 3000 now executes all 40 existing cases successfully. The
shader, barriers, expected counts and assertions are unchanged.

Assisted-by: Codex (exact model identifier unavailable)
Track `(bound_heaps, has_sampler_heap)` across `HEAPS_MARKER` records in
`console_list::close()` (clearing both via `SetDescriptorHeaps(&[])` when
`n == 0` to match `list_x::set_descriptor_heaps_x`) and call
`ensure_dispatch_heaps` before translated compute dispatches.

`ensure_dispatch_heaps` mirrors `list_x::default_bound_heaps` via a pure
`default_dispatch_heaps` helper, lazily creates `shared_sampler_heap` via
`list.GetDevice()` when missing (filtering heaps to the list's device), binds
both view and sampler heaps when 0 heaps are bound (or sampler alone when
`!heap_windows()`), and upgrades 1-heap bindings missing a view or sampler heap
so directly-indexed translated pipelines (`SAMPLER_HEAP_DIRECTLY_INDEXED`) never
dispatch with 0 sampler heaps bound.

Assisted-by: Google Antigravity (Gemini 4 Neon)
Automatic Direct DXIL reroutes previously shared a translated-cache identity across explicit nesting policies. Include the nesting tag in the rerouted identity and cover separate hits while preserving the HLSL namespace.

Assisted-by: OpenAI Codex (GPT-6.2 Sol)
Fixes #2238.

`gpu::texture::tests::gpu_large_mixed_upload_keeps_tight_staging_and_exact_pixels` was the only `IDXGIFactory6` call site using DXGI 1.1 `CreateDXGIFactory1().expect("DXGI factory")`, which panics with `DXGI_ERROR_UNSUPPORTED` (`0x887A0004`) or `E_FAIL` on Wine/DXGI prefixes that reject `IDXGIFactory6` on `CreateDXGIFactory1` and ignored `XCL_ADAPTER=warp`.

- Switch to `CreateDXGIFactory2::<IDXGIFactory6>(DXGI_CREATE_FACTORY_FLAGS(0))` matching the rest of the crate, handle `Selector::Warp` via `EnumWarpAdapter`, fall back to `agility::create_device(None, D3D_FEATURE_LEVEL_11_0)` only when factory creation fails under `Selector::Auto`, preserve headless-CI `no GPU` skips when factory enumeration yields no hardware adapters (and never ignore explicit `XCL_ADAPTER` filters), and call `runner::skip_test` instead of panicking when no factory/device is available.
- Add pure-CPU unit test `large_upload_device_selection_handles_factory_fallback_and_selectors` covering all five selection and fallback paths.

Assisted-by: Google Antigravity (Gemini 4 Neon)
Add translation for the three remaining quad-byte SAD VOP3 instructions:
v_qsad_pk_u16_u8, v_mqsad_pk_u16_u8, and v_mqsad_u32_u8. Previously
the packed u16 forms routed into the 16-bit VALU path because of '_u16'
in their mnemonics and v_mqsad_u32_u8 failed on 64/128-bit operands.

- Add Em::valu_qsad in emit.rs before the 16-bit VALU dispatch, reusing
  sad_u8, msad_u8, and sat_u32 plus a pk_sad_u16 prelude helper.
- Capture 64-bit SRC0 and 32-bit SRC1 in temporaries before writing
  destinations so overlapping VDST/SRC registers and EXEC masking stay
  exact across wave32 and wave64, and reject out-of-range VGPR spans or
  non-VGPR SRC2 on v_mqsad_u32_u8.
- Add translation/validation and D3D12 GPU tests covering window
  shifts, zero-byte masking, CLAMP wrap vs saturation, SGPR/VCC/inline
  sources, overlapped registers, and EXEC masks (ISA coverage VOP3
  287/298 -> 290/298, overall 1042 -> 1045 / 1157).

Assisted-by: Antigravity (exact model name not exposed to agent)
v_qsad_pk_u16_u8, v_mqsad_pk_u16_u8 and v_mqsad_u32_u8 now lower in the
direct DXIL translator too, following valu_qsad in recomp/emit.rs: the
four 4-byte windows of the 64-bit SRC0 against SRC1 (mqsad skips SRC1's
zero bytes), each added to its 16- or 32-bit element of SRC2, saturating
per element with CLAMP. The same operand checks are refused.

gpu_qsad_and_mqsad now runs both backends, in wave32 and wave64.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
`gpu::effects::of` previously stopped scanning on the first undecodable
dword after any `S_ENDPGM`, accepted programs without a terminator or
whose decoded tail could fall through into undecoded bytes, and ignored
indirect jumps and out-of-range branches. If a live branch jumped past
an early `S_ENDPGM` and undecodable gap (or an indirect/out-of-range
transfer targeted code outside the decoded slice), memory writes beyond
the stopped decode point were missed and `big_and_image_only` could
misclassify a memory-writing compute shader as image-only.

`compute_code` also accepted hardware-CS FSSM entries whose `f.error`
was populated (e.g. XBCH `rsize` mismatch, where `xbox::parse_xbch`
records `f.error` and still populates `f.programs`).

Resolve static far jumps (`rdna2::resolve_far_jumps`), require a
decoded `F_TERMINATOR` and a non-fallthrough tail, fail closed (`None`)
on any unresolved indirect transfer or branch targeting outside the
decoded instruction PCs, treat trailing `S_CODE_END` after a terminator
as padding, and reject `f.error.is_some()` in `compute_code`.

Part of #2088
Part of #1452

Assisted-by: Google Antigravity (Gemini 4 Neon)
When direct DXIL translation splits a large compute program into a
dispatch chain (#2080, under XCL_DIRECT_DXIL=1 or automatically for
enormous compute shaders), the runtime builds each piece under
dispatch_chain_root_signature and caches its driver blob as .chain.pso.

xcl shaders --precompile --pipelines ignored Compiled::dispatch_chain
and instead built only the unsplit whole shader under
abi_root_signature_with (.pso), which neither the split runtime path
nor the Chain::whole() fallback loads. On two split retail compute
shaders (RTX 3060, XCL_DIRECT_DXIL=1, XCL_PIPELINE_THREADS=4), prebuild
wall time dropped from 117.0 s (0/16 .chain.pso blobs) to 9.2 s cold
and 0.4 s warm (16/16 .chain.pso blobs reused).

Part of #1833, #2088.

Assisted-by: Google Antigravity (Gemini 4 Neon)
When shared stand-ins (standin::shell, commit 625a0f3) are enabled,
dev_create_compute_pso records the title-facing shell pointer in
CONSOLE_COMPUTE, while pso_async::resolve_wait returns the shared
driver pipeline after a failed background build. ind::execute_indirect
checked is_console_compute only on the resolved pointer, allowing a
failed console compute dispatch to reach PC ExecuteIndirect with XCL's
ABI compute root signature still bound (debug layer 953 / GPU hang).

Check both the title-facing pointer and the resolved pointer in
ind::execute_indirect, and cover failed shared stand-ins in unit
tests.

Assisted-by: Google Antigravity (Gemini 4 Neon)
Root cause (XCL-BT-009 in #1488): State::flush_parked queued tile
unmappings on self.queue, signaled self.fence, and immediately pushed
unpinned pool tiles to self.free without waiting for the unmap fence or
in-flight title command queues to complete. A following take_tile could
remap and clear a tile while earlier GPU work or unmap operations still
referenced it.

Fix: track same-device title queues with per-queue fences via
State::note_queue and super::present::known_queues, move unmapped
unpinned tiles into State::quarantined paired with completion marks from
self.fence and every tracked title queue, exclude quarantined tiles in
release_if_unused, and move them to self.free in drain_quarantined only
after all marked fences complete. Add synthetic unit tests covering both
sparse-queue unmap in-flight gating and title-queue in-flight gating.

Part of #1488

Assisted-by: Antigravity (Gemini 4 Hydrogen)
Add Shader::dot4_add_u8_packed (dx.op.dot4AddPacked, opcode 164) and
lower unclamped v_dot8_u32_u4 by splitting even and odd 4-bit nibbles
into two packed byte quads and chaining two Dot4AddU8Packed calls.
Leave clamped v_dot8_u32_u4 on the 64-bit saturating dot_n path.

Part of #1269

Assisted-by: Antigravity (Gemini 4 Neon)
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)
Shaders: xcl disasm prints DPP controls, masks and source modifiers
dxil: support 64-bit typed image_atomic_* via SM 6.6 heap atomics
Shaders: list offline precompile options in CLI help
xcl run: a panic on any thread is written to xcl.log
Tests: avoid poisoning SYNC_GRAPH with an unmapped fake fence in queue_tests (#1978)
D3D12.X: fence reclaimed VRAM heaps across all live queues and isolate arenas by device
Direct DXIL: sign-extend i1 to i64 through i32
Tests: add inspect_e2e integration tests for CLI text and json output
D3D12.X: clamp PcCalls across frame boundaries and drop orphaned PSO jobs immediately
D3D12.X: align promoted UAV clear values, key UAV support by adapter LUID, and use device-aware footprints fallback
D3D12.X: coalesce released shared sampler ranges and fix view/census checks in console_heap
D3D12.X: ensure view and sampler descriptor heaps before console-list dispatches
Direct DXIL: guard dp_mask in s_setreg_b32 when writing MODE[1:0]
Shaders: reverse the halves of an i64 Bfrev with shifts and masks on AMD
Recompiler: an S# word written with s_brev_b32 is a constant too
GPU: fail closed on unresolved control flow and errored FSSMs in effects
GPU: use CreateDXGIFactory2 and clean fallback/skip in large texture upload test
Direct DXIL: skip read64 and EXEC_HI for wave32 and b32 saveexec/wrexec
DXIL: lower unclamped v_dot8_u32_u4 using Dot4AddU8Packed
CLI: reject unknown options and invalid values in xcl rpf and xcl shaders (#2266)
README: the switches for how a title runs
Shaders: cache translator refusals and DXC compile failures by capability
Recompiler: direct DXIL applies NEG_HI as ABS on v_dot2_f32_f16's accumulator (stacked on #1286)
Recompiler: v_frexp_mant_f32 / _f16 keep the input's sign (#580)
Recompiler: the FSSM header's wave32 flag decides a program's wave size
Direct DXIL: include pixel shader helper lanes in ballots and VOPC masks
D3D12.X: quarantine unmapped parked sparse tiles behind GPU fences
D3D12.X: ExecuteIndirect skips failed shared compute stand-ins
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]>
In direct DXIL root-UAV window mode (`XCL_DIRECT_DXIL=1`, `XCL_HEAP_WINDOWS=0`),
every scalar/buffer/flat read previously went through `with_mem_many_tys`,
emitting a per-load `switch i32` + guard CFG and `phi` nodes over all
4 root-UAV windows (`u2..u5`). Compute shaders with hundreds of loads grew
thousands of basic blocks, triggering multi-second to multi-minute cold
NVIDIA driver compiles and high compiler commit memory.

Replace multi-window direct DXIL read-only raw loads on non-graphics stages
(`self.gfx.is_none()`, `self.heap_mem.is_none()`) with branchless straight-line
loads via `with_mem_raw_loads`:
- Resolve the effective window `w_eff = sel(guard, w, n)` once and compare
  `w_eff == k` across windows `0..n`, reading offset `0` on unselected
  windows/lanes and merging with `select`.
- Preserve `#1693` semantics: out-of-range window indices and inactive lanes
  select `0` while emitting only valid offset-0 reads on bound windows.
- Ensure `bind.rs` (`u2..u5`, filtering `v != 0`) and `runner::dispatch_with`
  always bind valid non-null buffers for all 4 root-UAV window slots.
- Exclude graphics stages (`VS`/`PS`, `self.gfx.is_some()`), where flattening
  root-UAV loads regressed straight-line PS cold NVIDIA compile time by 5.64x
  (1,632 -> 9,203 ms on `0829441`).
- Keep stores/atomics (`#2288`), `bvh_intersect`, `XCL_HEAP_WINDOWS`
  (`#1695`), and HLSL emission (`#1380`/`#2191`) unchanged.

Measured on RTX 5090 (driver 621.01, Windows 11, release) against `3f4495a`
(including PR #2346 non-coherent compute windows, 3 paired interleaved
trials per spec with cold root-signature keys and fresh exe copies):
- `cs-500-raw-w32` (non-coherent / coherent): 5,133 -> 1,748 ms (2.94x) /
  5,129 -> 1,751 ms (2.93x); peak commit 309 -> 191 MiB
- `cs-1000-raw-w32` (non-coherent / coherent): 19,742 -> 5,156 ms (3.83x) /
  19,767 -> 5,132 ms (3.85x); peak commit 993 -> 259 MiB (-73.9%)
- `cs-1000-raw-w64` (split wave64): 19,709 -> 5,171 ms (3.81x); peak 994 -> 259 MiB
- `cs-1000-w32` (mixed w/ 33% FormatLoad, non-coherent / coherent):
  49,431 -> 17,977 ms (2.75x) / 49,944 -> 18,058 ms (2.77x); peak 1.34 GiB -> 464 MiB
- Synthetic GPU dispatch (128 loads/lane, uniform & mixed, w32 & split w64):
  1.84x to 4.68x faster (3.296-6.688 us vs 9.696-22.608 us), 100% readback match.

Assisted-by: T3 Code (gemini-pro-orchestrator-neon)
Assisted-by: Codex in T3 Code (gpt-6.2-sol)
Shaders: read the per-stage root layout of console shader containers
Recompiler: translate v_qsad_pk_u16_u8 and v_mqsad_{pk_u16,u32}_u8 in both backends (takes over #909)
Recompiler: fold shift-masks, nested masks, double-xor, and all-ones or in direct DXIL opt
Recompiler: lower V_MIN_U32, V_MAX_U32, V_MIN_I32, and V_MAX_I32 in p…
Recompiler: specialize constant-mask v_cmp_class_f32 in direct DXIL
Recompiler: coalesce GS header and vertex attribute stores in direct DXIL
Tests: check divergent block barriers in a_bridged_mask_write
Shaders: prebuild split compute dispatch-chain pieces under --pipelines
Recompiler: key rerouted DXIL by compact nesting policy
Recompiler: eliminate local array and branches in pixel-shader PRELUDE::rla()
When XCL_HEAP_WINDOWS=1 is active with multiple memory windows, mem_windows() populates lw.mems with placeholder i32 0 handles so all memory accesses route through heap_raw_buffer_uav(). geom_init() bypassed this and called raw_load(lw.mems[0], ...), failing DXIL generation for any direct-DXIL geometry shader that reads pre-fetched ES vertex inputs (v9..v255).

Load window 0 from ResourceDescriptorHeap[MEM_HEAP_BASE] lazily when lw.heap_mem is set, and add a validation + GPU execution test.

Assisted-by: Antigravity (Gemini 4 Neon)
main 2898511. Two files conflicted, three hunks:

- bind.rs, execute_indirect: main (5983162) keeps the title-facing
  pipeline as raw_pso so that a failed build behind a shared stand-in is
  still skipped. The put-off test of this branch and need_by_submit take
  raw_pso (the pending builds and the console-compute set are keyed by the
  object the title holds, not by the shared driver pipeline), then
  pso = resolve_wait(raw_pso) and main's code as it is.
- pso_async.rs: NEEDED / next_needed (this branch) and drop_unstarted_job
  (main, 5b97e22) both stay. build_queued uses drop_unstarted_job for a
  pipeline the title released meanwhile, so a waiter is woken on the queue
  path and on the path where a worker takes a needed pipeline first.

Nothing else was changed. Resolved for the author by a maintainer.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
With several memory windows every access is a switch between them. DXC
inlines the accessors before it optimises, so a program gets one switch per
access and its time grows much faster than their number. Compute programs
with 100 accesses or more are now compiled with the accessors only declared
and linked with them afterwards (IDxcLinker inlines them): 1600 accesses
36 s -> 4.4 s, the same DXIL size and GPU time. The generated HLSL is
unchanged. XCL_LINK_MEM=0 turns it off; a program that cannot be linked is
compiled whole.
Two points of the review of the linked form. The kept accessor library was looked up under
the map's lock and inserted under it again after the compile, so two programs that asked for
the same library together compiled it twice (shdann): each key now has its own cell, the
first caller compiles outside the map's lock, the others of that key wait for it, and a
failure is not kept. And only the warning was behind a Once, so with a DXC that cannot link
(before 1.8 it refuses [WaveSize] on a library entry) every program with enough accesses paid
a failed attempt before the whole compile (Kalmarv, ryosen0): the first failure now closes the
gate for the rest of the process. The README says the linker needs DXC 1.8 or newer.
Tests: check cubemap tile reuse independently of idle page reclamation
Tests: a panicking title-texture test no longer poisons the others
Tests: skip the WARP frame-dump test where WARP is unavailable
Tests: skip the raw heap-window view test on a device without SM 6.6
Tests: cover Wait64 recording and satisfied batch submission
Add correctness-gate tests for XCL_HEAP_WINDOWS=1 in heap_window_tests.rs:
- divergent per-lane window indexing (NonUniformResourceIndex: w0, w1, OOB)
  comparing HLSL switch/heap and direct DXIL switch/heap bit-for-bit on GPU,
- 64-bit atomics (GLOBAL_ATOMIC_ADD_X2 carry, GLOBAL_ATOMIC_CMPSWAP_X2, OOB),
- 4- and 16-window HEAP_WINDOWS validation across VS, PS, and MS stages.

Assisted-by: Antigravity (Gemini 4 Neon)
Tests: compare CheckFeatureSupport hook against host D3D12 driver
Tests: verify CreateHeap console fallback and IID retry against host driver
Tests: compare GetResourceAllocationInfo and GetCustomHeapProperties against host D3D12 driver
Tests: compare CreateQueryHeap and CreateCommandSignature against hos…
Tests: compare CreatePlacedResource against the host D3D12 driver
Tests: compare CreateCommittedResource against the host D3D12 driver
Tests: compare CreateDescriptorHeap, increment size and CreateFence a…
Tests: compare command objects and CreateRootSignature against host D…
Tests: console descriptor heap slot/copy/unregister contract
Tests: pin the generated D3D12 layout table invariants
Tests: a failed copy scratch check no longer aborts the lib test binary
Tests: wait for the late release before freeing the coherent buffer test's heap (#1487)
Tests: honor the selected adapter in the indirect argument test
Tests: assert the refused depth-buffer UAV state on Windows only
Tests: pin the pipeline stream subobject table to the PC headers
Tests: compare CreateReservedResource against the host D3D12 driver
Tests: verify D3D12.X console queue descriptor translation
Tests: verify D3D12.X guard, split, and tracer thunks for game callers
The host-driver tests of #1612, #1578 and #1613 required the driver to
refuse invalid descriptions. vkd3d-proton accepts some of them, and XCL
answers as it does, so the tests failed under Wine on the driver's answer
and not on XCL's. They now compare XCL with the driver, and still require
the refusal on Windows. The null-description step of #1608 does not run
under Wine, where vkd3d-proton dereferences it and the process ends.

The console heap tests of #1687 returned in silence without unified
memory; they report a skip now.
Tests: host comparisons take the driver's own answer under Wine
Tests: compare extra-page tiles when an unaligned va is placed again (#718)
Since 0829441 the chains of one PC list share a scratch, and all
recordings together are bounded by XCL_SPLIT_SCRATCH_TOTAL_MB. Each
dispatch put off to the submit records on a PC list of its own, so each
made a new buffer: up to 256 MiB while the total had room, then 2 MiB
each, past the bound. They stayed under the list's own allocator until
the next submit that put a call off reset it.

The segment recorded after another at the submit now goes on in its
scratch, as a chain after a chain on one list does (with the UAV barrier
that chain records), and the list's own allocator is reset at its next
Reset once the GPU is done with it.

Found by pvfreis, reading #2118 on main 68a284a.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Tests: verify heap-window GPU equivalence and graphics validation
Recompiler: load direct DXIL geometry ES inputs from the heap window
D3D12.X: a dispatch waits for its pipeline at the submit, not in the bind
Recompiler: flatten direct DXIL root-UAV loads for compute
README: the switches for a bug report's diagnostics
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.
DXC: compute programs are linked with their memory accessors (window switches no longer dominate DXC time)
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]>
Shaders: reuse offline compute PSOs and compact repeated atomic shaders
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]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:35:07 +00:00
Author
Owner

@⁠GodlyBDS on GitHub · 2026-11-26 03:29 UTC · original · edited 2026-11-26 03:43 UTC

RTX 3090 Ti / 621.40 / Windows 10 / 32 GiB follow-up on e877812e. I used two local startup compatibility changes already tested on the older NVIDIA branch (Agility host-path scope and the XG extra argument), and the same per-executable 1 GiB shader heap reserve. The release build and six focused startup tests passed. This arm uses on-demand compilation (XCL_PREPARE=0, background PSO preload off) and starts from 8,426 prior native entries. The translated cache is regenerated so that the refreshed shader paths use their current outputs.

  • A separate earlier build with the 32 MiB two-pass record allocation path reached 3,737 MiB of tracked mesh buffer widths, 2,185 MiB waiting for allocator reset. It eventually stopped on low physical RAM. In the new run the highest logged mesh total through 630 s was 1,459 MiB, with 367 MiB waiting for reset, and zero refusals at the 4,096 MiB diagnostic mesh budget. These are different builds and rendering progress points, so the figures are allocation observations rather than a paired benchmark.
  • This run passed the device-removal point of the older NVIDIA branch, without a matching device removal or Windows driver reset through the sample. The transition went black after the loading artwork. At 630 s the scheduler still reported newly completed work. I left it running. Visible 3D remains unverified here. I have not tested this PR's worker-process preparation path in this arm.

The independent timing of PSO worker gate waits is in #2628. AI use: OpenAI Codex (GPT-6) ran the comparison and drafted the report.

Long-run update. One recording thread completed 37 large, cache-missing compute PSO builds in sequence between 773.010 and 1,443.620 s. Their logged driver durations total 670.124 s of that 670.610 s interval. The runtime stack samples caught the thread in nvgpucomp64.dll. There were no Presents in that interval and the run remained active. The verified seed held 8,426 native entries and the live cache had 10,565 files at this sample. The foreground sequence is separate from the worker-gate pressure described on #2628. This supports warming the demanded native PSOs on this GPU. It does not show that precompilation resolves the full world transition.

**@⁠GodlyBDS** on GitHub · 2026-11-26 03:29 UTC · [original](https://github.com/xcl-dev/xcl/pull/2624#issuecomment-7181766840) · edited 2026-11-26 03:43 UTC RTX 3090 Ti / 621.40 / Windows 10 / 32 GiB follow-up on `e877812e`. I used two local startup compatibility changes already tested on the older NVIDIA branch (Agility host-path scope and the XG extra argument), and the same per-executable 1 GiB shader heap reserve. The release build and six focused startup tests passed. This arm uses on-demand compilation (`XCL_PREPARE=0`, background PSO preload off) and starts from 8,426 prior native entries. The translated cache is regenerated so that the refreshed shader paths use their current outputs. - A separate earlier build with the 32 MiB two-pass record allocation path reached **3,737 MiB** of tracked mesh buffer widths, **2,185 MiB** waiting for allocator reset. It eventually stopped on low physical RAM. In the new run the highest logged mesh total through 630 s was **1,459 MiB**, with **367 MiB** waiting for reset, and **zero refusals** at the 4,096 MiB diagnostic mesh budget. These are different builds and rendering progress points, so the figures are allocation observations rather than a paired benchmark. - This run passed the device-removal point of the older NVIDIA branch, without a matching device removal or Windows driver reset through the sample. The transition went black after the loading artwork. At 630 s the scheduler still reported newly completed work. I left it running. Visible 3D remains unverified here. I have not tested this PR's worker-process preparation path in this arm. The independent timing of PSO worker gate waits is in [#2628](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2628). AI use: OpenAI Codex (GPT-6) ran the comparison and drafted the report. **Long-run update.** One recording thread completed 37 large, cache-missing compute PSO builds in sequence between 773.010 and 1,443.620 s. Their logged driver durations total **670.124 s of that 670.610 s interval**. The runtime stack samples caught the thread in `nvgpucomp64.dll`. There were no Presents in that interval and the run remained active. The verified seed held 8,426 native entries and the live cache had 10,565 files at this sample. The foreground sequence is separate from the worker-gate pressure described on #2628. This supports warming the demanded native PSOs on this GPU. It does not show that precompilation resolves the full world transition.
Author
Owner

@⁠pickles976 on GitHub · 2026-11-26 04:02 UTC · original

Blocker for 16 GiB / capped Wine hosts (source-verified at exact head 82e4a9bbf3be583418b9df7825dd1430fd8b06d6): the default worker budget has a byte/MB mismatch.

crates/xcl/src/host.rs:13-22 documents and returns system_commit() total/limit in bytes (K32GetPerformanceInfo × PageSize). crates/xcl/src/shaders.rs:1683-1694 forwards limit.saturating_sub(used) unchanged to workers_for(cores, free_mb), which divides by 3072 assuming its input is MiB. On this laptop nproc=16; for an illustrative 6 GiB free commit, the intended three-GiB-per-worker rule is 2 workers, but the head's expression selects 12 (all 16-4 allowed CPU slots). Under the local 9 GiB Wine cgroup and 16 GiB physical RAM, this can trigger the external 2 GiB MemAvailable guard or an OOM before the title starts. XCL_PREPARE_WORKERS=1 avoids this risky default for local trials, not a shipping fix. Please make the argument explicitly bytes and divide by 3 * 1024 * 1024 * 1024 (or convert bytes to MiB before calling), add a regression with 6 GiB in bytes, and respect a smaller applicable process/cgroup memory limit if the application is launched within one; global commit alone does not enforce a 9 GiB scope cap.

I attempted the focused Windows-MSVC Wine test preparation_workers_leave_two_processors_and_follow_the_commit_left, but the head does not reach the test on this build setup: transitive windows-future 0.3.2 fails compilation against windows-core 0.62.2 / windows-threading (IMarshal, marshaler, submit missing), exit 101. Local log .compat-xcl/logs/verify-pr2624-wine-worker-budget.log. The existing synthetic workers_for cases pass fake numbers labeled MB and would not catch the bytes passed from the real caller. No worker processes or retail title were launched; the source-level unit mismatch is independent of the dependency build failure. Machine: RTX 4060 Laptop 8 GiB, Wine 11.0, 16 GiB host RAM.

**@⁠pickles976** on GitHub · 2026-11-26 04:02 UTC · [original](https://github.com/xcl-dev/xcl/pull/2624#issuecomment-7182236787) **Blocker for 16 GiB / capped Wine hosts (source-verified at exact head `82e4a9bbf3be583418b9df7825dd1430fd8b06d6`): the default worker budget has a byte/MB mismatch.** `crates/xcl/src/host.rs:13-22` documents and returns `system_commit()` total/limit in **bytes** (`K32GetPerformanceInfo` × PageSize). `crates/xcl/src/shaders.rs:1683-1694` forwards `limit.saturating_sub(used)` unchanged to `workers_for(cores, free_mb)`, which divides by **3072** assuming its input is **MiB**. On this laptop `nproc=16`; for an illustrative **6 GiB free commit**, the intended three-GiB-per-worker rule is **2 workers**, but the head's expression selects **12** (all 16-4 allowed CPU slots). Under the local 9 GiB Wine cgroup and 16 GiB physical RAM, this can trigger the external 2 GiB MemAvailable guard or an OOM before the title starts. `XCL_PREPARE_WORKERS=1` avoids this risky default for local trials, not a shipping fix. Please make the argument explicitly bytes and divide by `3 * 1024 * 1024 * 1024` (or convert bytes to MiB before calling), add a regression with 6 GiB **in bytes**, and respect a smaller applicable process/cgroup memory limit if the application is launched within one; global commit alone does not enforce a 9 GiB scope cap. I attempted the focused Windows-MSVC Wine test `preparation_workers_leave_two_processors_and_follow_the_commit_left`, but the head **does not reach the test on this build setup**: transitive `windows-future 0.3.2` fails compilation against `windows-core 0.62.2` / `windows-threading` (`IMarshal`, `marshaler`, `submit` missing), exit 101. Local log `.compat-xcl/logs/verify-pr2624-wine-worker-budget.log`. The existing synthetic `workers_for` cases pass fake numbers labeled MB and would not catch the bytes passed from the real caller. No worker processes or retail title were launched; the source-level unit mismatch is independent of the dependency build failure. Machine: RTX 4060 **Laptop** 8 GiB, Wine 11.0, 16 GiB host RAM.
github manually merged commit 1b8884cb9e into nvidia-dev 2026-11-26 06:14:18 +00:00
Author
Owner

@⁠LocranKing on GitHub · 2026-11-26 05:13 UTC · original

Independent NVIDIA test report on exact head 82e4a9bbf3be583418b9df7825dd1430fd8b06d6 (clean detached checkout, no local changes), compared against nvidia-dev (c044dc6d).

Tested

  • Hardware: NVIDIA GeForce RTX 3060 Ti 8 GB (Ampere, wave32, driver 32.0.16.2140 / 621.40), AMD Ryzen 5 5500 (6c/12t), 32 GB RAM, Windows 11 Home (build 26300), Rust 1.100.0 (stable-x86_64-pc-windows-msvc), Windows SDK 10.0.26100.0.
  • cargo build --workspace + cargo test --workspace --no-fail-fast -- --test-threads=4 (debug):
    • nvidia-dev (c044dc6d): 1560 passed, 6 failed, 47 ignored (xcl --lib: 1490 passed, 2 failed, 27 ignored), 28 SKIPPED.
    • #2624 (82e4a9bb): 1721 passed, 6 failed, 48 ignored (xcl --lib: 1594 passed, 2 failed, 28 ignored), 28 SKIPPED.
    • 0 new failures vs nvidia-dev (+161 passing tests). All 6 failures match nvidia-dev:
      • hle::d3d12x::texture_upload::tests::{gpu_parts_of_a_texture_go_up_and_the_rest_stays, pieces_hold_the_texels_of_their_levels} (texture_upload.rs:990:17: attempt to multiply with overflow in debug)
      • d3d12_mesh_stream::console_ms_in_as_slot_and_ms_with_as_are_refused_cleanly (expected AS-slot refusal in translation_errors: ["MS: no NGG hardware variant"])
      • gpu_compute_e2e::async_compute_pso_registers_real_pso_and_not_standin
      • gpu_two_pass_cache_e2e::two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs (both test runs fail with disabled:)
    • 28 SKIPPED GPU tests on this adapter: 21 wave64-only (no wave64), 3 wave32 per-lane f16/f32 semantics, 1 no heap windows, 1 no heap windows (opt-in: XCL_HEAP_WINDOWS=1), 1 no D3D12 debug layer (0x887A002D), 1 cannot disable driver cache without Developer Mode (0x887A002D).
  • Shader preparation check (with used-shaders.txt = 11 shaders from the prior XCL_PREPARE=0 run):
    • Launched 8 worker processes on the 12-thread CPU (0 of 8 workers failed), checked 26,503 records and finished compute pipeline preparation in 6 s (total_elapsed_s=72.5 including the 60 s run), presentation window worked cleanly.

Regression run
scripts/smoke.ps1 -Seconds 60, release builds of nvidia-dev (c044dc6d) and #2624 (82e4a9bb):

nvidia-dev (c044dc6d):

xcl-smoke v1
commit: c044dc6d48d2b46a8ae77852df275c534681f3df
gpu: NVIDIA GeForce RTX 3060 Ti
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1552 (PresentX 1552)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15485 MB

PR (XCL_PREPARE=0):

xcl-smoke v1
commit: 82e4a9bbf3be583418b9df7825dd1430fd8b06d6
gpu: NVIDIA GeForce RTX 3060 Ti
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1566 (PresentX 1566)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15475 MB

PR (with worker preparation over used-shaders.txt, 8 workers, 6 s prep):

xcl-smoke v1
commit: 82e4a9bbf3be583418b9df7825dd1430fd8b06d6
gpu: NVIDIA GeForce RTX 3060 Ti
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1576 (PresentX 1576)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15585 MB

Not tested

  • Cold XCL_PREPARE_ALL=1 full-pack compute precompile pass; AMD / Intel / Linux GPUs; XCL_SAMPLE_* tests; the 60 s smoke run covers boot/intro/menus and does not enter the 3D world.

AI use

  • Antigravity (Gemini 4 Hydrogen) ran the builds, test suite, and smoke.ps1 commands on this machine and drafted this report from the captured outputs.
**@⁠LocranKing** on GitHub · 2026-11-26 05:13 UTC · [original](https://github.com/xcl-dev/xcl/pull/2624#issuecomment-7183286973) Independent NVIDIA test report on exact head `82e4a9bbf3be583418b9df7825dd1430fd8b06d6` (clean detached checkout, no local changes), compared against `nvidia-dev` (`c044dc6d`). **Tested** - Hardware: NVIDIA GeForce RTX 3060 Ti 8 GB (Ampere, wave32, driver `32.0.16.2140` / 621.40), AMD Ryzen 5 5500 (6c/12t), 32 GB RAM, Windows 11 Home (build 26300), Rust 1.100.0 (`stable-x86_64-pc-windows-msvc`), Windows SDK `10.0.26100.0`. - `cargo build --workspace` + `cargo test --workspace --no-fail-fast -- --test-threads=4` (debug): - `nvidia-dev` (`c044dc6d`): 1560 passed, 6 failed, 47 ignored (`xcl --lib`: 1490 passed, 2 failed, 27 ignored), 28 `SKIPPED`. - `#2624` (`82e4a9bb`): 1721 passed, 6 failed, 48 ignored (`xcl --lib`: 1594 passed, 2 failed, 28 ignored), 28 `SKIPPED`. - **0 new failures vs `nvidia-dev` (+161 passing tests).** All 6 failures match `nvidia-dev`: - `hle::d3d12x::texture_upload::tests::{gpu_parts_of_a_texture_go_up_and_the_rest_stays, pieces_hold_the_texels_of_their_levels}` (`texture_upload.rs:990:17`: `attempt to multiply with overflow` in debug) - `d3d12_mesh_stream::console_ms_in_as_slot_and_ms_with_as_are_refused_cleanly` (`expected AS-slot refusal in translation_errors: ["MS: no NGG hardware variant"]`) - `gpu_compute_e2e::async_compute_pso_registers_real_pso_and_not_standin` - `gpu_two_pass_cache_e2e::two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs` (both test runs fail with `disabled:`) - 28 `SKIPPED` GPU tests on this adapter: 21 wave64-only (`no wave64`), 3 wave32 per-lane f16/f32 semantics, 1 `no heap windows`, 1 `no heap windows (opt-in: XCL_HEAP_WINDOWS=1)`, 1 no D3D12 debug layer (`0x887A002D`), 1 cannot disable driver cache without Developer Mode (`0x887A002D`). - **Shader preparation check (with `used-shaders.txt` = 11 shaders from the prior `XCL_PREPARE=0` run):** - Launched 8 worker processes on the 12-thread CPU (`0 of 8 workers failed`), checked 26,503 records and finished compute pipeline preparation in **6 s** (`total_elapsed_s=72.5` including the 60 s run), presentation window worked cleanly. **Regression run** `scripts/smoke.ps1 -Seconds 60`, release builds of `nvidia-dev` (`c044dc6d`) and `#2624` (`82e4a9bb`): nvidia-dev (`c044dc6d`): ``` xcl-smoke v1 commit: c044dc6d48d2b46a8ae77852df275c534681f3df gpu: NVIDIA GeForce RTX 3060 Ti title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1552 (PresentX 1552) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15485 MB ``` PR (`XCL_PREPARE=0`): ``` xcl-smoke v1 commit: 82e4a9bbf3be583418b9df7825dd1430fd8b06d6 gpu: NVIDIA GeForce RTX 3060 Ti title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1566 (PresentX 1566) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15475 MB ``` PR (with worker preparation over `used-shaders.txt`, 8 workers, 6 s prep): ``` xcl-smoke v1 commit: 82e4a9bbf3be583418b9df7825dd1430fd8b06d6 gpu: NVIDIA GeForce RTX 3060 Ti title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1576 (PresentX 1576) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15585 MB ``` **Not tested** - Cold `XCL_PREPARE_ALL=1` full-pack compute precompile pass; AMD / Intel / Linux GPUs; `XCL_SAMPLE_*` tests; the 60 s smoke run covers boot/intro/menus and does not enter the 3D world. **AI use** - Antigravity (Gemini 4 Hydrogen) ran the builds, test suite, and `smoke.ps1` commands on this machine and drafted this report from the captured outputs.
Author
Owner

@⁠itsSio on GitHub · 2026-11-26 05:29 UTC · original

Dual-PC NVIDIA full-workspace test run (debug) and RTX 5080 retail smoke (release) at exact head 82e4a9bbf3be583418b9df7825dd1430fd8b06d6, covering the full suite, hardware-GPU tests, integration tests, and non-5090 NVIDIA hardware listed under Not tested.

Tested

  • Commit 82e4a9bbf3be583418b9df7825dd1430fd8b06d6 (base nvidia-dev), clean checkouts on both PCs, XCL_ADAPTER=NVIDIA, cargo build --workspace before running cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture.
  • PC 1: NVIDIA GeForce RTX 5080 (driver 32.0.16.1088), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11 Pro build 26200.9974, rustc 1.97.0 (stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5, debug build.
    • Full workspace: 1720 passed, 6 failed, 48 ignored (lib: 1594 passed, 2 failed, 28 ignored; raw lines also print 3 single-test child reruns and a duplicate gpu_two_pass_cache print, excluded from totals).
    • SKIPPED: 27 lines (no-wave64 group, 3 refused wave32 per-lane f16 forms, no heap windows).
  • PC 2: NVIDIA GeForce RTX 2080 SUPER (driver 32.0.16.1088), AMD Ryzen 5 5600X, 16 GB RAM, Windows 11 Pro build 26200.8653, rustc 1.99.1 (stable-x86_64-pc-windows-msvc), Windows SDK 10.0.26100 DXC 1.8.2502.11, debug build.
    • Full workspace: 1721 passed, 5 failed, 48 ignored (lib: 1594 passed, 2 failed, 28 ignored).
    • SKIPPED: 30 lines (18 distinct tests: PC 1 skips plus pso_measurement_compiles_an_exact_synthetic_record, uploads_start_from_each_subresources_state, and 2 lower:: wave64 tests).
  • All 4 new #2624 tests pass on both PCs: the_shaders_of_a_used_set_are_kept_for_the_next_run, the_key_of_one_shader_is_the_key_of_a_set_of_it, preparation_workers_leave_two_processors_and_follow_the_commit_left, static_sampler_set_before_a_branch_is_a_constant_after_it.
  • Failures (5 pre-existing on nvidia-dev, reproduced on both PCs):
    1. texture_upload::tests::pieces_hold_the_texels_of_their_levels & gpu_parts_of_a_texture_go_up_and_the_rest_stays (texture_upload.rs:990:17, debug multiply overflow in test LCG).
    2. d3d12_mesh_stream::console_ms_in_as_slot_and_ms_with_as_are_refused_cleanly (:96, expected AS-slot refusal, got ["MS: no NGG hardware variant"]).
    3. gpu_compute_e2e::async_compute_pso_registers_real_pso_and_not_standin (:535, TRANSLATED_COMPUTE cleanup vs late_release).
    4. gpu_two_pass_cache_e2e::two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs (:649, two-pass state release left 3, right 0 vs late_release).
  • New failure on PC 1 only (e2e::test_title_runs_and_game_folder_is_untouched, e2e.rs:168):
    • The game folder snapshot gains empty NVIDIA Corporation\ and NVIDIA Corporation\umdlogs\ directories.
    • A/B on the same RTX 5080 and driver: #2624 (82e4a9bb) failed 4/4 runs; nvidia-dev (c044dc6d) passed 3/3 runs (where the VFS redirects those driver writes to the overlay because D3D12 init happens after VFS install, whereas preparation::before_guest opens D3D12 before VFS install while cwd is the game root). Passing on PC 2 (RTX 2080 SUPER does not create umdlogs).
  • Retail 60 s smoke on PC 1 (RTX 5080, release build, XCL_PREPARE=0, XCL_DXC_DIR = DXC 1.9.2609.5):
xcl-smoke v1
commit: 82e4a9bbf3be583418b9df7825dd1430fd8b06d6
gpu: NVIDIA GeForce RTX 5080
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1677 (PresentX 1677)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14970 MB

Not tested

  • Worker-process shader preparation (XCL_PREPARE=1) and used-shaders.txt reuse on a retail title, visual verification of the static sampler fix in 3D world rendering, AMD / Intel GPUs, and retail smoke on the RTX 2080 SUPER.

AI use
Ran via Samaritan:

  • Google Antigravity CLI (Claude Opus 5.5 (High)): ran the dual-PC workspace test suites, the e2e A/B check against c044dc6d, and the release build, and traced the before_guest cwd vs VFS ordering behind the umdlogs failure.
  • Google Antigravity CLI (Gemini 4 Neon (High)): ran the 60 s RTX 5080 retail smoke test and wrote this test report.
**@⁠itsSio** on GitHub · 2026-11-26 05:29 UTC · [original](https://github.com/xcl-dev/xcl/pull/2624#issuecomment-7183532520) Dual-PC NVIDIA full-workspace test run (debug) and RTX 5080 retail smoke (release) at exact head `82e4a9bbf3be583418b9df7825dd1430fd8b06d6`, covering the full suite, hardware-GPU tests, integration tests, and non-5090 NVIDIA hardware listed under **Not tested**. **Tested** - Commit `82e4a9bbf3be583418b9df7825dd1430fd8b06d6` (base `nvidia-dev`), clean checkouts on both PCs, `XCL_ADAPTER=NVIDIA`, `cargo build --workspace` before running `cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture`. - PC 1: NVIDIA GeForce RTX 5080 (driver `32.0.16.1088`), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11 Pro build 26200.9974, `rustc 1.97.0` (`stable-x86_64-pc-windows-msvc`), DXC `1.9.2609.5`, debug build. - Full workspace: **1720 passed, 6 failed, 48 ignored** (lib: `1594 passed, 2 failed, 28 ignored`; raw lines also print 3 single-test child reruns and a duplicate `gpu_two_pass_cache` print, excluded from totals). - `SKIPPED`: 27 lines (no-wave64 group, 3 refused wave32 per-lane f16 forms, no heap windows). - PC 2: NVIDIA GeForce RTX 2080 SUPER (driver `32.0.16.1088`), AMD Ryzen 5 5600X, 16 GB RAM, Windows 11 Pro build 26200.8653, `rustc 1.99.1` (`stable-x86_64-pc-windows-msvc`), Windows SDK 10.0.26100 DXC `1.8.2502.11`, debug build. - Full workspace: **1721 passed, 5 failed, 48 ignored** (lib: `1594 passed, 2 failed, 28 ignored`). - `SKIPPED`: 30 lines (18 distinct tests: PC 1 skips plus `pso_measurement_compiles_an_exact_synthetic_record`, `uploads_start_from_each_subresources_state`, and 2 `lower::` wave64 tests). - All 4 new `#2624` tests pass on both PCs: `the_shaders_of_a_used_set_are_kept_for_the_next_run`, `the_key_of_one_shader_is_the_key_of_a_set_of_it`, `preparation_workers_leave_two_processors_and_follow_the_commit_left`, `static_sampler_set_before_a_branch_is_a_constant_after_it`. - **Failures (5 pre-existing on `nvidia-dev`, reproduced on both PCs):** 1. `texture_upload::tests::pieces_hold_the_texels_of_their_levels` & `gpu_parts_of_a_texture_go_up_and_the_rest_stays` (`texture_upload.rs:990:17`, debug multiply overflow in test LCG). 2. `d3d12_mesh_stream::console_ms_in_as_slot_and_ms_with_as_are_refused_cleanly` (`:96`, expected AS-slot refusal, got `["MS: no NGG hardware variant"]`). 3. `gpu_compute_e2e::async_compute_pso_registers_real_pso_and_not_standin` (`:535`, `TRANSLATED_COMPUTE` cleanup vs `late_release`). 4. `gpu_two_pass_cache_e2e::two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs` (`:649`, two-pass state release `left 3, right 0` vs `late_release`). - **New failure on PC 1 only (`e2e::test_title_runs_and_game_folder_is_untouched`, `e2e.rs:168`):** - The game folder snapshot gains empty `NVIDIA Corporation\` and `NVIDIA Corporation\umdlogs\` directories. - A/B on the same RTX 5080 and driver: `#2624` (`82e4a9bb`) failed **4/4** runs; `nvidia-dev` (`c044dc6d`) passed **3/3** runs (where the VFS redirects those driver writes to the overlay because D3D12 init happens after VFS install, whereas `preparation::before_guest` opens D3D12 before VFS install while cwd is the game root). Passing on PC 2 (RTX 2080 SUPER does not create `umdlogs`). - **Retail 60 s smoke on PC 1 (RTX 5080, release build, `XCL_PREPARE=0`, `XCL_DXC_DIR` = DXC `1.9.2609.5`):** ``` xcl-smoke v1 commit: 82e4a9bbf3be583418b9df7825dd1430fd8b06d6 gpu: NVIDIA GeForce RTX 5080 title: retail-title seconds: 60 exit: 0x0 frames shown: 1677 (PresentX 1677) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14970 MB ``` **Not tested** - Worker-process shader preparation (`XCL_PREPARE=1`) and `used-shaders.txt` reuse on a retail title, visual verification of the static sampler fix in 3D world rendering, AMD / Intel GPUs, and retail smoke on the RTX 2080 SUPER. **AI use** Ran via Samaritan: - Google Antigravity CLI (Claude Opus 5.5 (High)): ran the dual-PC workspace test suites, the `e2e` A/B check against `c044dc6d`, and the release build, and traced the `before_guest` cwd vs VFS ordering behind the `umdlogs` failure. - Google Antigravity CLI (Gemini 4 Neon (High)): ran the 60 s RTX 5080 retail smoke test and wrote this test report.
Author
Owner

@⁠luckyteagirl on GitHub · 2026-11-26 04:50 UTC · original · reviewed

With XCL_PREPARE_WORKERS=2, XCL_ADAPTER unset, and a title config such as d3d12_adapter = "1" on a two-GPU host, the parent captures progress.adapter but this child Command does not pass it on. Each worker enters the CLI shaders --precompile path with startup=None, so Pipelines::for_adapter("auto") selects the default adapter; the title runtime still selects adapter 1. That means the workers can warm driver PSOs for the wrong device, and matching-DXIL cache entries can later be rejected and rebuilt on the title's adapter. Could the spawn pass the resolved adapter to children (for example via XCL_ADAPTER only when no explicit environment override exists) and test the config-only secondary-adapter case? This is source review; I did not run a two-GPU preparation test, and this point concerns the worker pipeline path rather than all translation-only preparation.

**@⁠luckyteagirl** on GitHub · 2026-11-26 04:50 UTC · [original](https://github.com/xcl-dev/xcl/pull/2624#pullrequestreview-6068712499) · **reviewed** With `XCL_PREPARE_WORKERS=2`, `XCL_ADAPTER` unset, and a title config such as `d3d12_adapter = "1"` on a two-GPU host, the parent captures `progress.adapter` but this child `Command` does not pass it on. Each worker enters the CLI `shaders --precompile` path with `startup=None`, so `Pipelines::for_adapter("auto")` selects the default adapter; the title runtime still selects adapter 1. That means the workers can warm driver PSOs for the wrong device, and matching-DXIL cache entries can later be rejected and rebuilt on the title's adapter. Could the spawn pass the resolved adapter to children (for example via `XCL_ADAPTER` only when no explicit environment override exists) and test the config-only secondary-adapter case? This is source review; I did not run a two-GPU preparation test, and this point concerns the worker pipeline path rather than all translation-only preparation.
Author
Owner

@⁠KDenKC on GitHub · 2026-11-26 06:20 UTC · original

+1 to @⁠pickles976's byte/MB finding above (7182236787). I didn't see it before posting, sorry for the repeat. One new data point: it is still there at the current nvidia-dev head af2cecc4 (shaders.rs:1727 passes system_commit() bytes to workers_for, which divides by 3072). So on a 16-thread CPU the default is still 12 workers, whatever commit is free. We'll set XCL_PREPARE_WORKERS explicitly when we run the branch.

AI use: Claude Code (Claude Opus 5.5) checked the source at af2cecc4 and wrote this.

**@⁠KDenKC** on GitHub · 2026-11-26 06:20 UTC · [original](https://github.com/xcl-dev/xcl/pull/2624#issuecomment-7184328534) +1 to @⁠pickles976's byte/MB finding above (7182236787). I didn't see it before posting, sorry for the repeat. One new data point: it is still there at the current `nvidia-dev` head `af2cecc4` (`shaders.rs:1727` passes `system_commit()` bytes to `workers_for`, which divides by 3072). So on a 16-thread CPU the default is still 12 workers, whatever commit is free. We'll set `XCL_PREPARE_WORKERS` explicitly when we run the branch. AI use: Claude Code (Claude Opus 5.5) checked the source at `af2cecc4` and wrote this.
Author
Owner

@⁠pr1sm-dev on GitHub · 2026-11-26 06:27 UTC · original

@⁠pickles976 confirmed by reading the current nvidia-dev head af2cecc: prepare_workers (crates/xcl/src/shaders.rs:1727-1728) still passes host::system_commit(), which is in bytes (host.rs:11-12), to workers_for(cores, free_mb), which divides by 3072 as MiB (shaders.rs:1732-1733). So the commit bound never applies, and the count is always the logical processors less four (capped at 32).

I'm taking the fix, as a small PR against nvidia-dev: convert at the call site, leave workers_for and its tests as they are, and add a regression test with byte values (6 GiB free on 16 threads → 2 workers). A process or cgroup memory cap that the commit figures do not show stays out of scope; I'll say so in the PR.

AI use: Claude Code (Claude Opus 5.5) read the source and wrote this comment.

**@⁠pr1sm-dev** on GitHub · 2026-11-26 06:27 UTC · [original](https://github.com/xcl-dev/xcl/pull/2624#issuecomment-7184450517) @⁠pickles976 confirmed by reading the current `nvidia-dev` head `af2cecc`: `prepare_workers` (`crates/xcl/src/shaders.rs:1727-1728`) still passes `host::system_commit()`, which is in bytes (`host.rs:11-12`), to `workers_for(cores, free_mb)`, which divides by 3072 as MiB (`shaders.rs:1732-1733`). So the commit bound never applies, and the count is always the logical processors less four (capped at 32). I'm taking the fix, as a small PR against `nvidia-dev`: convert at the call site, leave `workers_for` and its tests as they are, and add a regression test with byte values (6 GiB free on 16 threads → 2 workers). A process or cgroup memory cap that the commit figures do not show stays out of scope; I'll say so in the PR. AI use: Claude Code (Claude Opus 5.5) read the source and wrote this comment.
Author
Owner

@⁠KDenKC on GitHub · 2026-11-26 08:53 UTC · original

nvidia-dev af2cecc4, all cold, RTX 5090. Preparation works and removes the graphics stall on a relaunch. The wall left is about 20 split programs' whole forms, which the worker processes do not build.

RTX 5090 (621.24), Ryzen 7 9800X3D (16 threads), Windows 11, release, XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_PSO_TRACE=1 XCL_NETWORK=0, XCL_PREPARE_WORKERS=6 (set by hand, see the byte/MB note above), 600 s of title time, the retail title. Each arm used a fresh exe name (empty NVIDIA cache) and a fresh XCL_DXIL_CACHE. One run per arm:

  • M: main b49be18.
  • N1: this branch, no history.
  • N2: this branch, a cache holding only N1's used-shaders.txt, used-pipelines.txt and used-graphics-pipelines.bin.
M N1 N2
preparation before the title none 64.5 min: translate 33.0 + compute 31.5 (all 26,503 records, 0 of 6 workers failed) 9.4 min: translate 48 s (1,233 used) + compute 8.0 min + graphics 33 s (142 made, 0 failed)
graphics PSO driver compile time in the title 124 s 155 s 5 s
compute compiles of 500 KB+ DXIL in the title (count, total time) 14, 262 s 39, 488 s 42, 546 s
frames shown / last frame 2,004 / +120 s 2,153 / +108 s 2,199 / +108 s
peak commit / removals 32.6 GB / 0 35.7 GB / 0 35.6 GB / 0

None of the three reached the world in 600 s. Each one sat on the world loading screen from about +110 s, while large compute pipelines kept compiling.

Where N2's time went. Joining driver compile start/finish with the binds:

  • The compute compiles with no driver blob that a bind actually waited for took 491 s.
  • 468.5 s of that (95%) was 20 whole forms of split programs, plus one 805 KB whole form still compiling at the cap. Their programs were in used-pipelines.txt, and Pass 2 had built their pieces.
  • The other compiles with no blob were background preloads of pipelines no run bound.

The reason is in shaders.rs (af2cecc4, around line 2172): p.make_one(&c.dxil, …, true, None) for a program with a dispatch_chain runs only if startup.is_some(). Pass 2's workers run precompile with startup = None, so they build the pieces but never the whole form. Building it when XCL_PRECOMPILE_PARENT is set too (or passing a flag to the workers) looks like it would take most of that remaining wait into preparation.

Not tested: the default worker count; more than one run per arm; whether the title reaches the world with whole forms prepared; AMD. nvidia-dev is the whole branch, so M vs N differences are not only #2624's.

AI use: Claude Code (Claude Opus 5.5) ran the three arms. Gemini (Antigravity) joined the trace lines and found the startup gate. Claude Code checked the gate in the source and wrote this.

**@⁠KDenKC** on GitHub · 2026-11-26 08:53 UTC · [original](https://github.com/xcl-dev/xcl/pull/2624#issuecomment-7187143204) **`nvidia-dev` `af2cecc4`, all cold, RTX 5090.** Preparation works and removes the graphics stall on a relaunch. The wall left is about 20 split programs' whole forms, which the worker processes do not build. RTX 5090 (621.24), Ryzen 7 9800X3D (16 threads), Windows 11, release, `XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_PSO_TRACE=1 XCL_NETWORK=0`, `XCL_PREPARE_WORKERS=6` (set by hand, see the byte/MB note above), 600 s of title time, the retail title. Each arm used a fresh exe name (empty NVIDIA cache) and a fresh `XCL_DXIL_CACHE`. One run per arm: - **M:** `main` `b49be18`. - **N1:** this branch, no history. - **N2:** this branch, a cache holding only N1's `used-shaders.txt`, `used-pipelines.txt` and `used-graphics-pipelines.bin`. | | M | N1 | N2 | |---|---:|---:|---:| | preparation before the title | none | 64.5 min: translate 33.0 + compute 31.5 (all 26,503 records, 0 of 6 workers failed) | 9.4 min: translate 48 s (1,233 used) + compute 8.0 min + graphics 33 s (142 made, 0 failed) | | graphics PSO driver compile time in the title | 124 s | 155 s | 5 s | | compute compiles of 500 KB+ DXIL in the title (count, total time) | 14, 262 s | 39, 488 s | 42, 546 s | | frames shown / last frame | 2,004 / +120 s | 2,153 / +108 s | 2,199 / +108 s | | peak commit / removals | 32.6 GB / 0 | 35.7 GB / 0 | 35.6 GB / 0 | None of the three reached the world in 600 s. Each one sat on the world loading screen from about +110 s, while large compute pipelines kept compiling. **Where N2's time went.** Joining `driver compile start/finish` with the binds: - The compute compiles with no driver blob that a bind actually waited for took 491 s. - 468.5 s of that (95%) was 20 whole forms of split programs, plus one 805 KB whole form still compiling at the cap. Their programs were in `used-pipelines.txt`, and Pass 2 had built their pieces. - The other compiles with no blob were background preloads of pipelines no run bound. The reason is in `shaders.rs` (`af2cecc4`, around line 2172): `p.make_one(&c.dxil, …, true, None)` for a program with a `dispatch_chain` runs only `if startup.is_some()`. Pass 2's workers run `precompile` with `startup = None`, so they build the pieces but never the whole form. Building it when `XCL_PRECOMPILE_PARENT` is set too (or passing a flag to the workers) looks like it would take most of that remaining wait into preparation. **Not tested:** the default worker count; more than one run per arm; whether the title reaches the world with whole forms prepared; AMD. `nvidia-dev` is the whole branch, so M vs N differences are not only #2624's. AI use: Claude Code (Claude Opus 5.5) ran the three arms. Gemini (Antigravity) joined the trace lines and found the `startup` gate. Claude Code checked the gate in the source and wrote this.
This discussion has been locked. Commenting is limited to contributors.
No description provided.