Bmjask/ultra performance redesign #2778

Open
github-bot wants to merge 387 commits from github-bot/gh-2778 into main AGit
Owner

@⁠bmjask on GitHub · 2026-11-26 12:00 UTC · original
bmjask:bmjask/ultra-performance-redesign → main · +37139 −4042 · 76 files · 387 commits · draft

What is in it

Tested

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

Regression run

main:

PR:

Not tested

AI use

  • none / tool and model, and what it did
**@⁠bmjask** on GitHub · 2026-11-26 12:00 UTC · [original](https://github.com/xcl-dev/xcl/pull/2778) `bmjask:bmjask/ultra-performance-redesign` → `main` · +37139 −4042 · 76 files · 387 commits · draft <!-- What changes and why, in a few sentences. "Fixes #N" / "Part of #N". Stacked: "Stacked on #N". --> **What is in it** - **Tested** - hardware (GPU + driver, CPU), Rust version, debug / release: - `cargo test --workspace -- --test-threads=4`: N passed, N failed, N ignored (SKIPPED GPU tests: …) **Regression run** <!-- Required when the PR changes crates/xcl/src outside tests: `scripts/smoke.ps1` on a real title, built from main and from this PR's head commit (no uncommitted changes); paste both blocks. Rerun the PR's after every push. Not needed for docs / tests / scripts only. --> main: PR: **Not tested** - **AI use** - none / tool and model, and what it did
title_textures::refresh runs on the title's thread before each of its
submits and uploaded the CPU's writes to its textures on XCL's own queue,
then waited on the CPU until the GPU had run them (texture::upload_batch).
While a retail title streams its world with video memory past the card,
those waits are long: thread dumps show its submit thread blocked in
fence::wait under refresh, presents drop to a few per 20 s, and the title's
watchdog ends it on the loading screen.

When the submitting queue is a DIRECT queue on the texture's device, the
upload list now runs on that queue, ahead of the title's lists, so the GPU
orders the copies before the work that samples them, with no cross-queue
wait. A fence on that queue retires each batch's allocator, list and staging
buffers at later submits; over 512 MB in flight the oldest batches are waited
for, and a batch whose wait fails or times out stays in flight. Compute and
copy queues, and a queue of another device, keep the upload queue and its
wait. texture::submit_batch is upload_batch without the wait.
With uploads on the title's queue (the commit before), the copies of a
batch went out on that queue without the wait for texture page mappings
that XCL's own upload queue makes (vram::before_execute). A texture made
on another thread after refresh_once's wait, or its levels mapped just
before the upload by map_levels_with_texels, could then be copied into
tiles whose UpdateTileMappings had not run on the page queue yet.

On an RTX 3080 (driver 621.40) with a retail title that was a copy-engine
write page fault (DmaPageFaultWrite, EngineResetRequired, 4.6 ms before
VidSchErrorHardwarePageFault in a DxgKrnl trace) and a hung device
(0x887a0006 with nvlddmkm 153) in 3 of 4 runs of the world load; with
the wait, 0 of 7.

submit_on_title_queue now waits first, so every title-queue upload does.
The test fails without it (the queue never waits for the mapping).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Establish shared, bounded stall accounting before instrumenting runtime paths. Disabled spans perform one relaxed enable check and avoid clocks, allocation, locking, and counters.

Assisted-by: Codex (GPT-5.6-sol)
Replace capped approximate write ranges with canonical tree-backed intervals. This preserves unwritten gaps without the quadratic insertion cost of an unbounded sorted vector.

Assisted-by: Codex (GPT-5.6-sol)
Add a preparation-only queue with stable job identities, monotonic promotion, FIFO priority ordering, pre-start cancellation, and panic-safe completion. Runtime paths are not activated yet.

Assisted-by: Codex (GPT-5.6-sol)
Separate shader translation, DXC queue and memory-admission time, and actual DXC execution in the opt-in stall recorder. Structured translation fallback remains one attributed operation.

Assisted-by: Codex (GPT-5.6-sol)
Capture waits, signals, sparse writes and deferred CPU writes once before submission. Split execution and post-submit consumers use the immutable snapshot instead of repeatedly reading mutable list state.

Assisted-by: Codex (GPT-5.6-sol)
Move job, completion, demand and result ownership into a distinct Build shared by the title-visible Pending object. Every stand-in still has a unique build, preserving scheduling behavior while establishing safe ownership for later coalescing.

Assisted-by: Codex (GPT-5.6-sol)
Add an optional versioned stall summary to report.json while keeping tracing-disabled reports and existing text output unchanged. The schema contains bounded category timings only and remains backward-compatible through serde defaults.

Assisted-by: Codex (GPT-5.6-sol)
Name split reasons and collect continuation state in one carry object while preserving existing wait and deferred-dispatch behavior. This creates a tested seam for later CPU-mediated ordering without changing when lists split.

Assisted-by: Codex (GPT-5.6-sol)
Route normal and preload PSO work through worker bands in the shared build queue. Foreground demand promotes queued work without duplicating it, while caller stealing, wait budgets, and result ownership remain unchanged.

Assisted-by: Codex (GPT-5.6-sol)
Separate writes completed by the submitted GPU segment from writes applied by the CPU after that segment. Snapshot producer ranges per physical segment while retaining cumulative recording knowledge, without changing the existing wait policy.

Assisted-by: Codex (GPT-5.6-sol)
Build a clean locked release and run one workload against fresh ephemeral XCL caches, then the exact same workload against those caches warm. Preserve only logs, reports, and a versioned environment manifest while explicitly leaving the driver cache uncontrolled.

Assisted-by: Codex (GPT-5.6-sol)
Capture every semantic input to translated compute preparation before work begins, while excluding title root-signature, cached-blob, and padding noise. Retain the identity inertly on each build so coalescing can be added as a separate change.

Assisted-by: Codex (GPT-5.6-sol)
Validate that baseline and candidate runs describe the same workload, environment, system, GPU, driver, and schedule. Report raw cold/warm duration and structured stall deltas without inventing percentages or statistical significance.

Assisted-by: Codex (GPT-5.6-sol)
Split a command list when a memory wait depends on a CPU-after-segment producer, submit the producer segment, and wait for its exact deferred-store completion before evaluating the continuation. Preserve in-segment GPU and Write64 ordering while leaving unrelated CPU writes asynchronous.

Assisted-by: Codex (GPT-5.6-sol)
Keep descriptor bytecode pointers stable with Arc-backed shader allocations and let canonical compute keys share those exact bytes. This avoids retaining a second full shader copy for every lazy or in-flight build.

Assisted-by: Codex (GPT-5.6-sol)
Share one in-flight translated compute build across independent title-visible stand-ins with equal canonical identities. Preserve per-stand-in metadata, priority promotion, lazy scheduling, failure wakeups, and a single COM owner released only after the last pending owner.

Assisted-by: Codex (GPT-5.6-sol)
Track keyed submissions, coalescing hits, unique builds, and current and peak in-flight identities with relaxed atomics. Serialize a versioned preparation summary without taking pipeline registries during report generation.

Assisted-by: Codex (GPT-5.6-sol)
Identify a workload from a deterministic metadata inventory instead of only its folder name, verify the inventory around each paired run, and require matching identity algorithms in comparisons. Persist no paths or file names and document that the fingerprint is not a content hash.

Assisted-by: Codex (GPT-5.6-sol)
Measure only unresolved blocking pipeline waits, driver admission/headroom waits, and the actual CreatePipelineState driver calls. Keep translation, scheduling, injected failures, and nonblocking resolves outside those scopes.

Assisted-by: Codex (GPT-5.6-sol)
Read versioned compute-build coalescing counters from performance reports and emit their raw values and deltas. Preserve missing and unsupported summaries as explicit states instead of treating them as zero.

Assisted-by: Codex (GPT-5.6-sol)
Hash full shader bytes once when capturing a canonical compute identity and reuse its digest for registry operations. Keep exact byte equality after all cheap fields so hash collisions cannot coalesce different programs.

Assisted-by: Codex (GPT-5.6-sol)
Measure individual filesystem reads, writes, publishes, and cleanup operations in the DXC, translated-shader, and driver-blob caches. Keep hashing, translation, driver compilation, and memory hits outside the cache I/O scope.

Assisted-by: Codex (GPT-5.6-sol)
Measure caller-blocking fence and sparse upload-slot waits, plus interprocess DXC cache mutex contention. Keep fast completion, event setup, queued GPU dependencies, background workers, and timeout diagnostics outside those scopes.

Assisted-by: Codex (GPT-5.6-sol)
Measure only the blocking IDXGISwapChain3::Present call so removal diagnostics and post-present bookkeeping are not charged to the driver stall.\n\nAssisted-by: Codex (GPT-5.6-sol)
Preserve first-use order from the previous-run pipeline inventory and use it only within the preload priority band. Ranked ties and unranked jobs remain FIFO, while promotions and cancellations invalidate their old heap tickets.\n\nThe standalone build-queue test suite passed 11 tests. The Windows-only XCL crate was not built in this Linux environment.\n\nAssisted-by: Codex (GPT-5.6-sol)
Preflight a closed standby and all split bookkeeping before committing the producer. Close the producer before resetting the continuation onto its allocator, and route failures through a closed standby while permanently quarantining lists whose Close failed.\n\nThe Windows-only XCL crate was not built in this Linux environment.\n\nAssisted-by: Codex (GPT-5.6-sol)
Accumulate exact prior CPU-after-segment write intervals once while capturing an immutable submission plan. Execution consumes the prepared per-segment dependency instead of rescanning earlier segment effects, while same-segment writes and external Kickoff waits retain their ordering semantics.\n\nThe XCL tests could not run on Linux because retour uses unsupported stdcall and fastcall ABIs.\n\nAssisted-by: Codex (GPT-5.6-sol)
Measure immutable submission-plan construction separately from pipeline waits, execution synchronization, and driver submission. Attribute CPU-write completion waits at the blocking receive seam without overlapping worker GPU waits.\n\nThe Windows-only XCL crate was not built in this Linux environment.\n\nAssisted-by: Codex (GPT-5.6-sol)
Measure only fallback CPU polling after the satisfied fast path and GPU-side wait handling. End the span before timeout diagnostics so synchronization time remains separate from reporting work.\n\nThe Windows-only XCL crate was not built in this Linux environment.\n\nAssisted-by: Codex (GPT-5.6-sol)
Count accepted ranked preloads, jobs started in the preload band, and jobs promoted before preload execution. Publish the privacy-safe counters in preparation schema v2 and teach the comparator to preserve v1 while validating and comparing v2.\n\nThe standalone build-queue suite passed 11 tests. PowerShell comparator tests could not run because PowerShell is unavailable in this Linux environment.\n\nAssisted-by: Codex (GPT-5.6-sol)
Normalize reserved closed standbys to allocator-unknown, effect-empty state so forwarded Kickoff calls cannot treat stale state as recordable. During Reset recovery, replace an in-flight failed standby instead of immediately reusing the same PC list object.\n\nFocused XCL tests could not run on Linux because retour uses unsupported stdcall and fastcall ABIs.\n\nAssisted-by: Codex (GPT-5.6-sol)
Measure the exact original MakeResident, Evict, SetResidencyPriority, and EnqueueMakeResident calls. Fence waiting, submission preparation, and DirectStorage remain in their own attribution categories.\n\nThe Windows-target check stopped before XCL compilation because this Linux host lacks MSVC headers.\n\nAssisted-by: Codex (GPT-5.6-sol)
Describe opt-in stall summaries and the ranked-preload counters emitted by the reproducible comparison tooling.\n\nAssisted-by: Codex (GPT-5.6-sol)
Replace FIFO DXC admission with a queue that rechecks dynamic demand at dequeue. The oldest wanted compile runs before background work while FIFO is preserved within both classes; running work, memory admission, and worker counts remain unchanged.\n\nFocused XCL tests could not run on Linux because retour uses unsupported stdcall and fastcall ABIs.\n\nAssisted-by: Codex (GPT-5.6-sol)
Measure non-empty batch handoff and only the Close path that actually waits for the queue worker. Asynchronous request lifetime, decompression, file I/O, and fence activity remain outside this category.\n\nThe Windows-target check stopped before XCL compilation because this Linux host lacks MSVC headers.\n\nAssisted-by: Codex (GPT-5.6-sol)
Detach a reserved destination's old UMA blocks during split preflight and hold them under their original allocator before the producer commit. Installing prepared bind state after Close now performs only lookup, moves, assignments, and drops.\n\nFocused XCL tests could not run on Linux because retour uses unsupported stdcall and fastcall ABIs.\n\nAssisted-by: Codex (GPT-5.6-sol)
Expose the monotonic title-wait signal to DXC admission through an atomic instead of taking each Build demand mutex while the shared compile queue is locked. Keep submit demand and preload worker priority coordination under the existing mutex.\n\nFocused XCL tests could not run on Linux because retour uses unsupported stdcall and fastcall ABIs.\n\nAssisted-by: Codex (GPT-5.6-sol)
Preflight a known-closed standby and failure bookkeeping before a wrapped Kickoff mutates recording state. Defer effect consumption until Close succeeds; on failure route the wrapper to the standby and quarantine the producer without issuing later list calls.\n\nFocused XCL tests could not run on Linux because retour uses unsupported stdcall and fastcall ABIs.\n\nAssisted-by: Codex (GPT-5.6-sol)
Keep the preflighted closed standby through submission and target Reset. Return it only after Reset succeeds; on failure route the wrapper through it without marking the successfully closed and submitted target permanently unresettable.\n\nFocused XCL tests could not run on Linux because retour uses unsupported stdcall and fastcall ABIs.\n\nAssisted-by: Codex (GPT-5.6-sol)
Retain upload allocators, command lists, fences, and mapped staging in a bounded three-slot ring. Enqueue a title-queue wait for each upload completion instead of blocking the submit thread, with oldest-slot backpressure and a CPU fallback only if the driver rejects the queue wait.\n\nThe Windows-target check stopped before XCL compilation because this Linux host lacks MSVC headers and tools.\n\nAssisted-by: Codex (GPT-5.6-sol)
Expose an ordinary-submission wrapper that supplies the empty external-wait set inside list_x. Sibling modules no longer need to name the private PendingWait type, restoring Windows-target type checking.\n\n passed with warnings.\n\nAssisted-by: Codex (GPT-5.6-sol)
Match the queued upload helper's visibility to its completion type and actual XCL-only consumers, removing the private-interface warning.\n\nAssisted-by: Codex (GPT-5.6-sol)
This reverts commit c83cb0f2d6f64f45aed19f25c00814c0d2ba341b.
This reverts commit 7da8e4128bbb25ce765c269e5d8b4d3d5de6cb0e, reversing
changes made to 2731878fe8a3b10250992e40cb8a807efa092f71.
Measure outer executes, wait-split chunks, list and backing-mark writes, retirement Signal outcomes, and allocator-state lock wait/hold time without changing submission order or cadence. Publish the raw counters in preparation schema v3 and preserve v1/v2 comparison support.\n\nThe Windows-GNU probe reached XCL; this branch's base stopped on the since-corrected private PendingWait API. PowerShell tests could not run because PowerShell is unavailable.\n\nAssisted-by: Codex (GPT-5.6-sol)
# Conflicts:
#	crates/xcl/src/hle/d3d12x/real.rs
Use an 8 MiB merge gap derived from measured GetWriteWatch call and committed-page scan costs. This preserves merging of 1 MiB-spaced sparse ranges while avoiding scans across as much as 64 MiB of irrelevant pages; boundary and coverage invariants are tested.\n\nThe Windows-target test build stopped before XCL compilation because this Linux host lacks MSVC headers.\n\nAssisted-by: Codex (GPT-5.6-sol)
Add a BeginSubmit-to-PendingSubmit typestate that captures and pins exact list lifetime, recording, and allocator backing before native execution. Safe pre-execute abandonment unpins; once armed, drop or marker failure deliberately remains fail-closed, while successful finish converts pins into existing per-queue marks.\n\nThe Windows-GNU check reached and type-checked this code; the branch base then stopped on the since-corrected private PendingWait API.\n\nAssisted-by: Codex (GPT-5.6-sol)
# Conflicts:
#	crates/xcl/src/hle/d3d12x/alloc_pool.rs
Describe the raw allocator execute topology, retirement Signal, mark-write, and lock timing counters emitted by performance comparisons.\n\nAssisted-by: Codex (GPT-5.6-sol)
Zero-filled lazy mip uploads previously reserved and populated a separate staging footprint for every texture in a batch. Reuse one fully cleared, maximally pitched span for verified-zero subresources while preserving every copy, title-queue mapping order, and nonzero footprint alignment.

Adapted from xcl-dev/xcl PR #2573 commit 1bfa05d921 by razormontana.

Cross-target cargo check passed; Windows GPU execution was not available on this host.

Assisted-by: Codex (GPT-5.6-sol)
wait_for_memory previously checked WORKING against commit headroom and WANTED_AT_ONCE with an unlocked load before calling fetch_add(1), allowing concurrent worker wakeups to admit an unbounded burst past both limits.

Wrap the admission check and working-slot increment in a MemoryGate mutex while keeping MemorySlot::drop lock-free and sleeping outside the mutex, and add multi-threaded unit tests verifying tight-headroom, WANTED_AT_ONCE, low-commit single-slot, and timeout behavior.

Part of #2463
Part of #1566
Part of #1269
Assisted-by: Antigravity (Gemini 4 Hydrogen)
Replace Vec<Decoded> + HashSet<u64> in gpu::effects::of with a single-pass
streaming decoder over sorted instruction PCs, delegating to an explicit
far-jump path only when S_SETPC_B64 appears. Add early-exit on memory
writes and zero-copy slice borrowing for FSPX and FSSM compute shaders in
big_and_image_only.

Part of #2508
Part of #1833
Assisted-by: Google Antigravity (Gemini 4 Neon)
Descriptor range publication could continue past small heaps and partial tail pages into adjacent shared-heap ranges. Carry the source heap's remaining slot count into the resolved slot and clamp the existing zero-allocation publication loop without changing its lock coverage.

Adapted from the bounds portion of xcl-dev/xcl PR #2631 commit 3b49f094ec by Decodere. The PR's lock-removal portion is intentionally excluded because it permits range reuse before a delayed copy.

Cross-target cargo check for library and tests passed; Windows execution was unavailable.

Assisted-by: Codex (GPT-5.6-sol)
Replace BTreeMap/BTreeSet leader and block-index tables in Cfg::build_with
with binary search over monotonically decoded instruction PCs and flat
Vec tables, remove the unused reach BTreeSet, replace heap-allocated
succ_of Vec<usize> with a Copy stack-allocated Succs, avoid cloning
preds[x] in make_reducible, and short-circuit the dominator pass in
make_reducible when order() finds no back edges (acyclic DAG).

Part of #2508
Part of #1833
Assisted-by: Google Antigravity (Gemini 4 Neon)
A title can release a command allocator while command-list recordings, reserved submits, or GPU fence marks still depend on its native object. Probe the logical final COM Release, transfer that reference only for a busy backing, detach the title namespace, and retire original or pool-created backing ownership outside the allocator state lock once it is free.

This is the lifetime prerequisite for pre-execution allocator reservations; production submit wiring remains disabled.

Cross-target cargo check for tests passed; Windows GPU execution was unavailable.

Assisted-by: Codex (GPT-5.6-sol)
Fence refresh and diagnostics held the global fence table lock across driver GetCompletedValue calls, while CPU signals scanned unrelated fences. Snapshot stable cell mirrors, serialize refreshes per fence, and keep raw diagnostic fixtures alive through teardown without blocking ordinary signal/wait bookkeeping.

Adapted from xcl-dev/xcl PR #2649 commit 6530439984 by Decodere, with the non-cell diagnostic lifetime race fixed.

Cross-target cargo check for library and tests passed; Windows execution was unavailable.

Assisted-by: Codex (GPT-5.6-sol)
A pool heap is released only when all its tiles are free, and a title frees its
tiles in runs spread over all its heaps. With heaps of 64 MiB (1,024 tiles) a
retail title's world load unmapped 1.5 GB of its 4.6 GB of tiles and 3 of 78
heaps went back: 1.7 GB of video memory stayed in live heaps as free tiles.
With heaps of 64 tiles 1.25 GB goes back and 0.2 GB stays.

retire_free_pools marks the pools that go with a flag each: a world load frees
hundreds of pools' worth of tiles at once.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Capture and pin each list recording before ExecuteCommandLists can reach the driver. Associate the reservation with exactly one queue fence after native execution, and fail closed before later chunks if bookkeeping cannot be reserved.

This closes the reset/release race between native execution and allocator retirement while preserving exact effects for the chunks that actually ran.

Checked with the GNU Windows-target cargo check; Windows/MSVC, GPU, and title smoke execution were not available on this host.

Assisted-by: Codex (GPT-5.6-sol)
Publish foreground demand before scheduling a cold shared build, then wait for the worker result instead of taking the build job onto the binding title thread.

This preserves exact pipeline and compute semantics while moving long DXC and driver work out of correctness-critical title execution.

GNU Windows-target cargo check passed. Test linking was unavailable because this Linux host lacks the MinGW dlltool; Windows/MSVC and runtime execution were not tested.

Assisted-by: Codex (GPT-5.6-sol)
Publish wanted demand as soon as a dispatch is deferred to submission. The shared Build is promoted before scheduling, so DXC and driver admission see correctness-critical demand immediately without restoring title-thread compilation.

The bounded wanted-build concurrency makes the old four-segment lookahead unnecessary.

GNU Windows-target cargo check passed. Focused test linking was unavailable because this Linux host lacks MinGW dlltool; Windows/MSVC and runtime execution were not tested.

Adapted from PR #2579.
Assisted-by: Codex (GPT-5.6-sol)
Return ExecuteIndirect's resolved pipeline and the unbuilt state of that exact bound choice from one captured Pending. A build completing between resolution and classification can no longer send a stale stand-in to the driver with an incompatible root signature.

The shared Build completion state distinguishes a successful late completion from the permanent fallback of a failed build.

GNU Windows-target cargo check passed. Windows/MSVC, GPU, and title smoke execution were not available on this host.

Adapted from PR #2598.
Assisted-by: Codex (GPT-5.6-sol)
When XCL_PSO_WAIT_MS is positive, record a dispatch immediately and use the same bounded bind wait instead of splitting one deferred command-list segment per call. This prevents bounded mode from exhausting command-list memory during large cold-pipeline bursts.

Unset, zero, and malformed values preserve the default deferred-submit path. The change is stacked on atomic ExecuteIndirect stand-in classification.

GNU Windows-target cargo check passed. Windows/MSVC, GPU, and title smoke execution were not available on this host.

Adapted from PR #2581.
Assisted-by: Codex (GPT-5.6-sol)
Write the DXIL program header and bitcode directly into one exactly sized container allocation. Remove intermediate part, string, and signature allocations while preserving all public formats and digest coverage.

Keep an independent golden full-PSV byte fixture from the prior serializer so a same-length field reordering cannot hide behind the new assembly helpers.

The upstream release microbenchmark reported 2.18-2.47x faster 1-2 MiB container assembly. GNU Windows-target cargo check passed here; Windows/MSVC, GPU tests, and title smoke were not run on this host.

Adapted from PR #2664.
Assisted-by: Google Antigravity (Gemini 4 Neon)
Assisted-by: Codex (GPT-5.6-sol)
Pack the lock-free module ranges into a single table with a monotonic address envelope, making the common PC/driver-address rejection O(1). Publish registration and removal under the mapped-module write lock and make all containment arithmetic overflow-safe.

A controlled same-base test holds registration between range publication and vector publication and proves unregister cannot create a zombie entry.

The upstream release microbenchmark reported a 19-23x improvement for out-of-envelope probes against 32 modules. GNU Windows-target cargo check passed here; Windows/MSVC and runtime tests were not run on this host.

Adapted from PR #2673.
Assisted-by: Google Antigravity (Gemini 4 Neon)
Assisted-by: Codex (GPT-5.6-sol)
Let a bounded normal-band helper serve demanded pipeline work when a normal worker first blocks at the huge-driver-compile gate. Helpers retain BuildQueue priority, shared-Build wanted state, DXC admission, driver slot, and commit limits, then retire once parked workers return.

The helper count never exceeds the configured normal worker count and preload/speculative work stays isolated. GNU Windows-target cargo check passed; Windows/MSVC, peak commit, thread churn, GPU, and title smoke were not measured on this host.

Adapted from PR #2628.
Assisted-by: Codex (GPT-5.6-sol)
Move used-pipelines.txt appends to one ordered background writer. Producers sequence and deduplicate keys under one shared state, retain the exact in-flight batch until a successful append, and cannot let later keys overtake retries.

Normal exit and NtTerminate use bounded close/flush waits with no unbounded join or caller-side file handle. Partial append retries begin on a fresh line, and close success means the writer dropped its handle.

GNU Windows-target cargo check passed. Runtime tests could not link without MinGW dlltool; Windows/MSVC and termination smoke were not tested.

Assisted-by: Codex (GPT-5.6-sol)
After validating an unsplit translated-shader cache entry, move its payload to the front of the file buffer and retain that allocation instead of making a second payload-sized copy. Split entries keep the existing copy path so they do not retain all piece bytes.

Preserve cache-I/O stall attribution and add ownership, sampler-offset, malformed-entry, and split round-trip coverage. The upstream extracted-loader benchmark reported 27-35% faster 4-16 MiB warm-cache loads with roughly half the incremental heap peak.

GNU Windows-target cargo check passed. Windows/MSVC, GPU tests, and retail smoke were not run on this host.

Adapted from PR #2594.
Assisted-by: OpenAI Codex (gpt-6-astra)
Assisted-by: Codex (GPT-5.6-sol)
Replace the raw submitted-queue list with a registry that owns exactly one process-lifetime interface per queue and clones strong snapshots under its mutex. Migrate late release, GPU drain, VRAM, and sparse consumers away from unlocked raw-interface reconstruction.

This is behavior-neutral preparation for explicit active/retiring queue ownership: deduplication, insertion order, and permanent retention remain unchanged.

GNU Windows-target cargo check passed. Windows/MSVC, GPU, and title smoke execution were not available on this host.

Assisted-by: Codex (GPT-5.6-sol)
Replace per-placement String formatting with a compact copyable descriptor summary, release the alias mutex before logging, and take a lock-free return after the 16 diagnostic lines have been emitted. Bound pre-cap unique-address tracking and free the table at the cap.

GNU Windows-target cargo check passed. Windows/MSVC, long-run placement behavior, GPU tests, and title smoke were not run on this host.

Adapted from PR #2636.
Assisted-by: Google Antigravity (Gemini 4 Neon)
Assisted-by: Codex (GPT-5.6-sol)
Route standalone VS and PS variants through the exact runtime console_to_dxil_in path so precompile warms translated/v2 serialization and the selected HLSL/direct-DXIL backend instead of only manually warming HLSL output.

Selection matches the runtime's first hardware VS/PS FSSM and exact stage, split, windows, and base-zero keys. Paired PS variants with nonzero VS sampler bases remain cold because the shader archive has no pipeline pairing data.

GNU Windows-target cargo check passed. Fresh-cache Windows probes, GPU execution, and retail smoke were not available on this host.

Adapted from PR #2613.
Assisted-by: Codex (GPT-5.6-sol)
Compute transitive liveness for globals, declarations, and module constants from reachable instructions and metadata. Trace only live global initializers and aggregate elements, then compact the constant block through a stable old-to-new value map.

This removes dead constants and prevents an unreachable aggregate from retaining otherwise-unused internal symbols while preserving idempotent serialization and reachable Phi semantics.

GNU Windows-target cargo check passed here. Upstream validation includes native AMD wave64 and NVIDIA direct-DXIL GPU suites; Windows/MSVC and GPU execution were not repeated on this host.

Adapted from PR #2640.
Assisted-by: Google Antigravity (Gemini 4 Neon)
Assisted-by: Codex (GPT-5.6-sol)
Lower frexp mantissa and exponent directly from exponent bits, avoiding driver-dependent float classification and integer/float round trips. Simplify alignbit with a constant fast path and select-free dynamic shifts whose individual counts remain in range.

Adapted from #2641. Upstream reports direct-DXIL validation plus wave32 GPU parity on NVIDIA RTX 3060 and AMD RX 9070. Locally cross-checked only with the GNU Windows target; Windows GPU execution remains untested here.

Part of #2508

Assisted-by: Google Antigravity (Gemini 4 Neon)

Assisted-by: Codex (GPT-5.6-sol)
Introduce an inactive retirement state machine while preserving current production behavior. Retiring queues remain visible to every strong snapshot until an exact-generation completion mark is swept, and failed or unmarked retirement remains pinned.

Return owners and completion markers from the registry before dropping either, so COM releases cannot occur under the registry lock. This is the behavior-neutral Stage B prerequisite for bounded queue retirement.

Locally cross-checked with the GNU Windows target; Windows execution remains untested here.

Assisted-by: Codex (GPT-5.6-sol)
Retain deterministic whole-form build failures per exact immutable dispatch chain so repeated Dispatch and ExecuteIndirect calls do not re-enter the driver. Preserve success memoization and cap repeated ExecuteIndirect warnings.

Treat E_OUTOFMEMORY as transient: suppress attempts for ten seconds, then serialize one retry and retain success. Recreating the chain receives a fresh outcome.

Adapted from #2629. Locally cross-checked with the GNU Windows target; Windows execution and GPU smoke remain untested here.

Assisted-by: Codex (GPT-5.6-sol)
Record the selected runtime or precompile adapter vendor and conservatively disable persisted driver blobs after AMD is observed. AMD cached-PSO blobs can reference the driver-owned cache instead of containing self-sufficient code.

XCL_PSO_DISK_CACHE=1 remains an explicit override; =0 disables persistence everywhere. NVIDIA, Intel, and WARP retain default-on behavior.

Adapted from #2577. Locally cross-checked with the GNU Windows target; Windows execution remains untested here.

Assisted-by: Codex (GPT-5.6-sol)
Track conservative signed and unsigned i32 intervals through common SSA forms, then fold min/max identities, absorption, and non-overlapping bounds. This collapses translated clamp and med3 sequences after mem2reg without removing soundness guards for signed masks.

Adapted from #2568. Upstream reports 573/573 DXIL validation, direct GPU parity across NVIDIA and AMD, and 133,484 fewer emitted bytes across the corpus. Locally cross-checked only with the GNU Windows target; Windows GPU execution remains untested here.

Part of #2508

Assisted-by: Google Antigravity (Gemini 4 Neon)

Assisted-by: Codex (GPT-5.6-sol)
Lower add/subtract with carry or borrow using two i32 operations and unsigned comparisons. This removes unnecessary i64 widening and the Int64Ops feature from shaders that otherwise need only 32-bit arithmetic.

Adapted from #2565. Upstream reports 573/573 DXIL validation and direct GPU parity across NVIDIA and AMD. Locally cross-checked only with the GNU Windows target; Windows GPU execution remains untested here.

Part of #2508

Assisted-by: Google Antigravity (Gemini 4 Neon)

Assisted-by: Codex (GPT-5.6-sol)
Build bitfield masks with wrapping shift/subtract identities, fold constant 64-bit scalar masks into i32 halves, and lower signed find-first-bit-high directly to FirstbitSHi. This removes branches, selects, and avoidable Int64Ops.

Adapted from #2559. Upstream reports 573/573 DXIL validation and GPU parity across NVIDIA and AMD. Locally cross-checked only with the GNU Windows target; Windows GPU execution remains untested here.

Part of #2508

Assisted-by: Google Antigravity (Gemini 4 Neon)

Assisted-by: Codex (GPT-5.6-sol)
Retain the Windows file handle used to read each persisted driver blob. If the driver or offline precompiler rejects it, dispose that exact file object rather than a pathname another process may already have replaced.

Open entries with read/delete sharing and OPEN_REPARSE_POINT, falling back to read-only and failing closed when exact-object deletion is unavailable. Preserve cache-I/O stall attribution and cover cross-process replacement and link safety.

Adapted from #2614. Locally cross-checked with the GNU Windows target; Windows filesystem tests and execution remain untested here.

Assisted-by: Codex (GPT-5.6-sol)
# Conflicts:
#	crates/xcl/src/hle/d3d12x/real.rs
Add an inactive Stage C coordinator that removes every audited raw-command-queue cache only after a future retirement mark completes. Cover allocation, copy scratch, CPU-write, late-release, sparse/VRAM, title-texture, presentation, and synchronization-graph state.

Extract COM-bearing values under their subsystem lock and release them only after unlocking. In-flight batches retain independent fence clones, and the retirement registry remains untouched.

No overlapping queue-retirement PR was found. Locally cross-checked with the GNU Windows target; Windows execution remains untested here.

Assisted-by: Codex (GPT-5.6-sol)
Reserve null raw-UAV descriptors after the memory-window slots. Redirect ordinary out-of-layout loads and stores with a descriptor select, while retaining explicit guards for atomics whose return values require defined handling.

Keep runtime and GPU-test heaps on the same descriptor ABI and add a deterministic accessor-shape test. Adapted as the behavior-independent half of #2554; its upstream RTX 4090 investigation attributes about six seconds of a large cold compile to the duplicated guard branches.

Locally cross-checked with the GNU Windows target; Windows GPU execution remains untested here.

Assisted-by: Claude Code (model not disclosed)

Assisted-by: Codex (GPT-5.6-sol)
Capture registered texture destinations in immutable per-segment effects and publish them only after the native submission gate accepts that physical segment. Reset, discarded, failed, and unsent split continuations cannot mark a texture.

Track registration generations, writer-queue incarnations, monotonic GPU epochs, and known destination subresources without activating readback or synchronization. Preserve pre-submit lazy-level mapping preparation.

Locally cross-checked with the GNU Windows target; Windows execution remains untested here.

Assisted-by: Codex (GPT-5.6-sol)
Implement IDStorageQueueX1::EnqueueSetEvent as an ordered queue marker. The queue owns a restricted duplicate handle until every earlier request retires, then signals it; Close safely discards pending markers.

Adapted from #2569 with sequential auto-submit, parallel retirement ordering, caller-handle lifetime, and Close coverage. Upstream reports full Windows suite and retail smoke coverage.

Locally cross-checked with the GNU Windows target; Windows event execution remains untested here.

Assisted-by: Codex (GPT-6.2 Sol)

Assisted-by: Codex (GPT-5.6-sol)
Capture and persist the exact successful uncached pipeline result whose driver build crossed the slow threshold, even when bounded RAM-cache admission fails. Same-key builders reserve capture/publication, and disk-path turns prevent distinct RAM identities from racing one pathname.

Publish disk before RAM visibility, remember cap-refused persisted keys, clear that marker on cached-blob rejection, and preserve exact-generation invalidation plus AMD default-off policy. Adapted from #2574 after prerequisites #2577 and #2614.

Locally cross-checked with the GNU Windows target; Windows filesystem and driver execution remain untested here.

Assisted-by: Codex (GPT-5.6-sol)
Own title queues from creation, atomically transition a registry-only queue to Retiring, exclude it from every internal signal and submission producer, and enqueue a final fence marker. Marker/API/worker failure pins the owner permanently.

A worker sweeps exact completed generations, invalidates every audited raw-address cache, and only then drops the final registry owner. Pre-transition active snapshots delay retirement; retiring queues remain visible only to all-state ownership and diagnostics.

No overlapping queue-retirement PR was found. Locally cross-checked with the GNU Windows target; Windows runtime and GPU execution remain untested here.

Assisted-by: Codex (GPT-5.6-sol)
Keep exact single-sample colour render-target and UAV layouts in the title texture table without scheduling CPU uploads. This preserves address generations and submitted-write provenance needed by a later, ordered reverse-layout readback path while rejecting layouts that require conversion or unsupported metadata handling.\n\nAssisted-by: Codex (GPT-5.6-sol)
Assisted-by: Codex (GPT-5.6-sol)
Fix two linked-compilation bugs in dxc.rs introduced alongside accessor-library linking (#174):\n\n1. Keep LINK_GATE open and propagate transient E_OUTOFMEMORY errors directly from compile_linked_or_fallback instead of permanently disabling linked compilation and falling back to the heavier compile_whole path under memory pressure. Deterministic non-OOM failures still close LINK_GATE once and fall back to compile_whole.\n2. Forward the shader optimization tier and caller extra arguments to IDxcLinker::Link, and reject library blobs whose length cannot be represented by the API.\n\nAdd unit tests for OOM gate retention, link argument boundaries, and live DXC argument forwarding.\n\nPart of #174\nPart of #1566\nPart of #1269\nPart of #1833\n\nAssisted-by: Google Antigravity (Gemini 4 Neon)\nAssisted-by: Codex (GPT-5.6-sol)
Assisted-by: Google Antigravity (Gemini 4 Neon)\nAssisted-by: Codex (GPT-5.6-sol)
cl_release dropped XCL state keyed by a PC command list address only after the runtime's final Release had freed the list. A list created on another thread could immediately reuse that address and lose its bind state, allocator, last submit, and DRED marks. Probe the final reference and forget keyed state before the freeing Release, matching the established resource-release pattern.\n\nA fake list whose Release reuses its address immediately verifies the new list keeps its state.\n\nAssisted-by: Claude Code (Claude Opus 5.5)\nAssisted-by: Codex (GPT-5.6-sol)
Replace sparse tile quarantine's process-lifetime command-queue references with temporary active-queue snapshots and independently owned completion fences. Include installed central retirement markers, wait through the short Preparing state, and fail closed when retirement cannot provide a trustworthy completion source.\n\nPrune raw queue keys only through the exact Stage C retirement callback before address reuse; in-flight batches retain their own fence clones.\n\nAdapted from #2638 after central queue retirement was active.\n\nAssisted-by: Codex (GPT-5.6-sol)
Assisted-by: Codex (GPT-5.6-sol)
Add a pure CPU helper that validates one exact D3D12 readback footprint and tiles its logical rows back into the matching XG subresource. It handles arrays, volumes, mip edges, and block formats while rejecting metadata planes, format conversions, malformed footprints, arithmetic overflow, allocation failure, and short buffers.\n\nThis is the conversion-only stage for ordered GPU-owned texture copyback; it performs no queue, COM, synchronization, or title-memory work.\n\nAssisted-by: Codex (GPT-5.6-sol)
Assisted-by: Codex (GPT-5.6-sol)
The console compute-stream projection dropped its FLAGS subobject, so stream-created pipelines always reached creation and the driver-blob cache key with zero flags. Forward type 20 exactly as the graphics-stream and legacy compute paths already do.\n\nAdd a synthetic stream test covering absent and nonzero flags.\n\nPart of #2607.\n\nAssisted-by: Devin (SWE-2 High)\nAssisted-by: Codex (GPT-5.6-sol)
Assisted-by: Devin (SWE-2 High)\nAssisted-by: Codex (GPT-5.6-sol)
The streaming effects fast path capped its initial instruction storage when it only needed to reject memory-writing shaders, but an early S_SETPC_B64 fallback still reserved for the entire shader before seeing a nearby store. Apply the same small initial capacity to the far-jump path and let it grow only when full analysis is required.\n\nFollow-up to #2656.\n\nAssisted-by: Codex (GPT-5.6-sol)
Validate WaitFrameEventX's signaled-index target as committed, unguarded, and writable without touching its pages. Replace ancillary and paced wait handle vectors with fixed stack storage, avoid the scheduled-handle Arc clone on the paced path, and use deques for bounded frame history eviction.\n\nAdapted from #2692.\nPart of #103.\n\nAssisted-by: Google Antigravity (Gemini 4 Neon)\nAssisted-by: Codex (GPT-5.6-sol)
Assisted-by: Google Antigravity (Gemini 4 Neon)\nAssisted-by: Codex (GPT-5.6-sol)
The deferred-call path ignored native Close failures both while reserving an empty segment and after replaying the call. Such a segment could reach ExecuteCommandLists and remove the device.\n\nReject a reservation whose initial Close fails. If replay Close fails, drop the call, restore arena ownership to the previous valid segment, and quarantine the still-open list until wrapper destruction so it can never be reused as a closed spare.\n\nCo-Authored-By: Claude Opus 5.5 <[email protected]>\nAssisted-by: Claude Code (Claude Opus 5.5)\nAssisted-by: Codex (GPT-5.6-sol)
Checked parsing retains a known graphics-stream prefix while marking unknown or truncated suffixes uncacheable. Thread that decision through synchronous and worker builds so projected descriptors cannot populate memory or driver caches when omitted state may affect identity.\n\nAlso preserve the legacy-representable RASTERIZER1 and RASTERIZER2 fields. Fractional depth bias and RASTERIZER2 line mode remain for the later native-stream stage.\n\nAdapted from PR #2621 by Decodere.\nAssisted-by: Codex (GPT-5.6-sol)
Run eligible split-wave64 compute programs as independent 64-thread hardware groups and scale the dispatch dimension, avoiding cross-wave spin coordination. Preserve console group/thread IDs in generated HLSL and keep direct-DXIL pipelines unremapped.\n\nBuild an unremapped worker fallback for indirect dispatch or dimension overflow, with OOM cooldown, stand-in resolution, and fail-closed skip behavior. Retain fallback device/root-signature ownership and drop cache entries outside their mutex to avoid reentrant Release deadlocks.\n\nAssisted-by: Codex (GPT-5.6-sol)
# Conflicts:
#	crates/xcl/src/gpu/recomp/dxc.rs
Add a non-activated immutable plan for copying selected GPU-owned texture subresources into a retained readback resource. Validate exact XG element geometry, driver footprints, explicit states, source/queue device identity, and direct-queue ownership before execution.\n\nSubmission transfers every referenced COM object into a fence ticket before ExecuteCommandLists. Incomplete, signal-failed, or device-removed tickets fail closed by retaining GPU-owned objects; completed mapping is nonblocking and fallibly allocated. Selection validation is bounded and linear.\n\nAssisted-by: Codex (GPT-5.6-sol)
Carry the source writer queue type in immutable texture download plans. Record and submit on the same DIRECT or COMPUTE type, while rejecting COPY queues and type/device mismatches before ownership transfer or execution.\n\nThis remains a non-activated preparation for ordered pre-Signal downloads.\n\nAssisted-by: Codex (GPT-5.6-sol)
Adapt the native graphics stream path from PR #2621 so fractional depth bias and Rasterizer2 line modes are not lost through the legacy pipeline descriptor. Unknown or unreadable streams fail closed, and rect-list fallback is limited to E_INVALIDARG.

The native stream deliberately remains outside the driver-blob cache; cache lifecycle support is a separate stacked change.

Assisted-by: Google Antigravity (Gemini 4 Neon)

Assisted-by: Codex (GPT-5.6-sol)
Adapt PR #2697 so sparse CPU commit is counted from committed 4 KiB pages and every owner is scoped to the current device. Committed texture attribution is deliberately named as the tracked sampled subset because fallback resources and late-release physical lifetime are outside this diagnostic.

Totals saturate, local and non-local query failures remain independent, and the existing activity memory line stays stable.

Assisted-by: Claude Code (Claude Opus 5.5)

Assisted-by: Codex (GPT-5.6-sol)
DispatchX USE_THREAD_DIMENSIONS now reaches deferred replay, converts thread counts to whole group counts, and masks the partial last groups in both compute emitters. Oversized D3D grids and unknown group shapes are skipped before binding or recording.

Multidimensional kernels use HLSL for console-linear wave ordering; ordinary direct-DXIL dispatches avoid the partial-group ballot. Transient limits are consumed once and cleared on Reset.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

Assisted-by: Codex (GPT-5.6-sol)
Give every command queue a re-entrant per-generation lease. Native ExecuteCommandLists and its allocator, write, and texture-state publication now form one turn, while refresh and cross-queue preparation stay outside to avoid lock cycles.

Signal, Wait, and SignalX use the same ordering primitive; final Release cannot remove a replacement queue generation at a reused address.

Assisted-by: Codex (GPT-5.6-sol)
Give translated extended graphics streams a canonical pointer-free identity and reuse driver blobs from bounded RAM or disk caches. Cached-blob refusal is retried before rect-list GS fallback, while unrelated failures preserve their HRESULT and cache generation.

Exact-generation invalidation prevents a delayed rejection from evicting a newer RAM replacement; the no-GS fallback deliberately remains uncached under the with-GS identity.

Assisted-by: Codex (GPT-5.6-sol)
Record the wait under the existing lock-contention stall category only when another thread owns the same queue lease. Uncontended queue operations do not start a recorder span.

Assisted-by: Codex (GPT-5.6-sol)
Route XCL-owned Execute, Signal, and Wait operations through the original PC queue slots so adopted console layouts cannot turn them into shifted wrappers or successful stubs. Keep every operation inside the reentrant per-queue submission turn and cover the shifted-vtable case with a synthetic queue.\n\nAssisted-by: Codex (GPT-5.6-sol)
Move tracked texture transitions from mutable list-address notes into generation-tagged physical-segment effects. Publish state transitions and GPU-writer ownership atomically only after the native submission gate accepts each chunk, preserving reset, replay, split, repeat, and wait-split chronology.\n\nAssisted-by: Codex (GPT-5.6-sol)
Mirror patched vtable originals in a fixed atomic fast table, bypass silent and decoded voice maps when they are empty, and submit decoder-owned PCM16 storage without allocating a second byte buffer. Make shared silence allocation retryable and keep decoded-error fallback storage bounded when it is unavailable.\n\nAssisted-by: Google Antigravity (Gemini 4 Neon)\nAssisted-by: Codex (GPT-5.6-sol)\nCo-authored-by: Decodere <[email protected]>
Replace per-block bit-spread, residual-mask, and anchor scans with compile-time lookup tables and fixed masks while preserving every existing BCPack output. Add exhaustive helper equivalence checks and baseline hashes for the shipped fixtures and all BC6H/BC7 modes.\n\nAssisted-by: Google Antigravity (Gemini 4 Neon)\nAssisted-by: Codex (GPT-5.6-sol)\nCo-authored-by: Decodere <[email protected]>
Reuse self-delimited packet and per-stream PCM buffers, precompute defensive channel mappings, and reject cross-stream duration mismatches before any decoder state advances. Keep bulk output copying and broad output preallocation out of this logical change.\n\nAssisted-by: Google Antigravity (Gemini 4 Neon)\nAssisted-by: Codex (GPT-5.6-sol)\nCo-authored-by: Decodere <[email protected]>
Take descriptor-heap and unified-memory bookkeeping while a temporary native reference still pins the old object, then free captured backing only after the driver actually reaches zero. Preserve a documented post-free fallback for missed simultaneous-release probes without changing queue or allocator retirement protocols.\n\nAssisted-by: Claude Code (Claude Opus 5.5)\nAssisted-by: Codex (GPT-5.6-sol)\nCo-authored-by: Sage <[email protected]>
The title counted only DXC work, so multi-second cold driver pipeline
builds could make it report zero active work while the title stalled.

Count uncached CreatePipelineState calls, builds waiting for the large
compile slot, and completed builds. Keep cached driver-blob loads out of
the build count, including the two-pass compute path, and restore the
thread-local cache marker during unwinding. Log slow driver builds even
when they fall below the large-pipeline threshold.

Assisted-by: Claude Code (Claude Opus 5.5)
Assisted-by: Codex (GPT-5.6-sol)
Co-authored-by: Claude Opus 5.5 <[email protected]>
GetCompletedValue can enter the driver and block or call back into XCL.
Snapshot strong fence references and list generations under the allocator
state lock, poll them unlocked, then revalidate the exact submission before
recording diagnostics or declaring storage reusable.

This removes driver polling from note_resubmits and in_flight without
allowing an address-reuse generation or a newly reserved submission to be
mistaken for completed work.

Assisted-by: Codex (GPT-5.6-sol)
Texture submission can succeed even when the retirement-fence creation or
Signal used to track its lifetime fails. If the fallback queue wait also
fails, releasing the command objects and staging resource can free memory
that submitted GPU work still references.

Drop those objects only after a successful fallback wait; otherwise retain
them deliberately. Apply the same rule to synchronous uploads whose native
tracking Signal fails.

Assisted-by: Codex (GPT-5.6-sol)
Internal XCL submissions may execute while sparse or VRAM locks are held.
If such an ExecuteCommandLists call reaches the title path, its accounting
and late-release hooks can re-enter those locks and deadlock.

Forward own_work submissions directly through the original native slot
inside the queue's ordered lease. This keeps internal queues out of title
presentation accounting while preserving queue ordering.

Assisted-by: Antigravity (Google Gemini frontier model; exact model unknown)
Assisted-by: Codex (GPT-5.6-sol)
Guest VGPR writes preserve inactive lanes as select(exec, new, old).
Lane-local operations whose values are ultimately observed only under the
same condition cannot observe the preserved arm, so read through it and
let DCE remove the resulting dead selects.

Use a conservative observation lattice: phis, memory, atomics, integer
division, wave/quad operations, derivatives, and unknown calls observe all
lanes. Keep an opt-out and before/after GPU parity coverage for wave32,
split wave64, inactive lanes, and cross-lane barriers.

Assisted-by: Claude Code (Claude Opus 5.5)
Assisted-by: Codex (GPT-5.6-sol)
Co-authored-by: Claude Opus 5.5 <[email protected]>
Pending submit completion created fences and entered the queue driver while
holding the allocator pool's global lock. That serialized unrelated queues
and made driver callbacks capable of deadlocking allocator operations.

Use an Arc-owned per-queue marker with monotonic reentrant value
reservations. Create and Signal outside global state, then publish marks
only after exact marker revalidation. Failed signals and replaced queue
generations retain their submit pins fail-closed.

Assisted-by: Codex (GPT-5.6-sol)
GPU-written title textures previously remained detached from their CPU
memory view. Before a title signals the exact queue that wrote supported
subresources, build immutable readback plans, validate and reserve their
writer epochs in that queue turn, and enqueue the readbacks ahead of the
native title-fence signal.

Fence completion stays hidden until completed tickets are reverse-tiled
into committed writable title pages. Replaced epochs, resource generations,
partial submission failures, and queue reuse are discarded or retained
fail-closed. Cross-queue writes remain pending for their own synchronized
writer queue.

Assisted-by: Codex (GPT-5.6-sol)
Single-descriptor publication called CopyDescriptorsSimple while holding
the heap registries, serializing unrelated descriptor work and allowing a
driver callback to deadlock heap teardown.

Snapshot the exact heap generation and strong source owner, validate the
source and destination handles, and lease the destination slot before
dropping all registry locks. Defer shared-range reuse until overlapping
copies finish, and reject stale slots after raw-address reuse.

Assisted-by: Google Antigravity (Gemini 4 Neon)
Assisted-by: Codex (GPT-5.6-sol)
SubmitPreparation started after title texture refresh, so write-watch scanning, detiling, and upload work was invisible in the coarse stall breakdown. Start the span before refresh while retaining the existing suspension around deferred pipeline waits.

Assisted-by: Codex (GPT-5.6-sol)
Assisted-by: Codex (GPT-5.6-sol)
Some filesystems do not support FileDispositionInfoEx with POSIX semantics. Fall back to legacy delete-on-close using the same DELETE-open handle so rejection still invalidates the exact loaded blob generation rather than a path replacement.

Assisted-by: Codex (GPT-5.6-sol)
Assisted-by: Codex (GPT-5.6-sol)
Range publication still called the driver while holding shared heap metadata. Resolve and lease every exact destination run under the existing lock order, retain the source heap generation, then issue the batched copies without allocator locks. Tail bounds, unregister deferral, and address reuse remain validated.

Assisted-by: Codex (GPT-5.6-sol)
Assisted-by: Codex (GPT-5.6-sol)
Allocator reset, retirement, and release probing queried fence completion while holding the pool-wide state lock. Snapshot strong fence owners and exact backing generations, poll without the lock, and revalidate every namespace and mutable field before reuse or release. Carry replaced COM references out of the lock and fail closed on concurrent mutation.

Assisted-by: Codex (GPT-5.6-sol)
Assisted-by: Codex (GPT-5.6-sol)
Correctness-critical deferred dispatches marked their pipeline wanted only after command-list split allocation and reset. Publish demand first so foreground worker promotion and compiler admission overlap that native preparation. Bounded waits and the immediate wait after a failed split retain their existing behavior.

Assisted-by: Codex (GPT-5.6-sol)
Assisted-by: Codex (GPT-5.6-sol)
The title-texture upload cache held one global mutex across fence creation, signaling, polling, and bounded waits. Lease an address-generation state from the registry and serialize only that queue, retaining removed generations through in-flight operations. Drop completed staging after the queue-local lock is released.

Assisted-by: Codex (GPT-5.6-sol)
Assisted-by: Codex (GPT-5.6-sol)
VRAM reclamation queried every retirement fence while holding the device-wide registry. Snapshot strong exact fence owners, poll and deduplicate them unlocked, then sweep current batches against those observations. Concurrent higher or new marks remain retired, and completed heaps and COM owners drop after the lock.

Assisted-by: Codex (GPT-5.6-sol)
Assisted-by: Codex (GPT-5.6-sol)
Fence completion held the global download registry across polling, readback mapping, reverse tiling, and title-memory writes. Detach one fence's ordered batches under per-fence processing and installation markers, publish them unlocked, and restore unresolved work before concurrent arrivals. Cache every exposed completion so withholding remains monotonic.

Assisted-by: Codex (GPT-5.6-sol)
Assisted-by: Codex (GPT-5.6-sol)
The global retirement registry still covered fence creation, queue signals, polling, and device mutation. Lease an exact per-device state from the registry, preserving same-device signal ordering while allowing unrelated devices and cache invalidation to proceed independently. Removed generations remain owned through active operations.

Assisted-by: Codex (GPT-5.6-sol)
Assisted-by: Codex (GPT-5.6-sol)
Large title-texture refreshes created and joined up to eight OS threads for every upload batch. Reuse a process-lifetime bounded detile pool while preserving synchronous batch ordering and source timing. Missing or panicked work requeues only the exact CPU-owned texture generation and clears its premature content fingerprint.

Assisted-by: Codex (GPT-5.6-sol)
Assisted-by: Codex (GPT-5.6-sol)
Allocator Reset, GetDevice, and CreateCommandAllocator ran while holding the pool-wide state lock. Reserve one exact title operation, retain strong candidate owners, perform driver work unlocked, and commit only if the namespace and every backing field still match. Failures and stale completions cancel only their own token and roll back outside the lock.

Assisted-by: Codex (GPT-5.6-sol)
Assisted-by: Codex (GPT-5.6-sol)
Sparse submit preparation queried quarantine and pool fences while holding the entire sparse state. Snapshot strong exact fence owners, deduplicate and poll them unlocked, then drain only the FIFO prefix satisfied by those observations. Concurrent new fences and higher marks remain quarantined.

Assisted-by: Codex (GPT-5.6-sol)
Assisted-by: Codex (GPT-5.6-sol)
Sparse submission preparation called the native title-queue Wait while holding the global sparse state. A driver-side callback or an unrelated sparse operation could therefore stall behind that state even though the wait only needs an exact fence/value snapshot.\n\nSerialize preparation per title queue, reserve its monotonic wait under sparse state, then enqueue the native wait after releasing that state. The per-queue gate prevents a concurrent submission from overtaking the thread that reserved its wait.\n\nChecked with the Windows GNU target; Windows MSVC runtime, GPU, and smoke tests were not available here.\n\nAssisted-by: Codex (GPT-5.6-sol)
Split pieces inherited the whole shader's static resource metadata even when optimization removed every handle use in that piece. Derive the reachable binding ranges after optimization and retain only matching metadata, while preserving survivor order and the shared chain root-signature ABI.

The split parity fixture checks that scratch-only pieces omit the title-memory binding without changing GPU results.

Assisted-by: Codex (GPT-5.6-sol)
Inactive split segments kept their allocator users alive after leaving the submission graph, and idle aside allocators retained driver storage until selected again.

Detach only the retired recording association while preserving submit lifetime state. Reset idle aside backings outside allocator state, then commit once-only reset state through exact namespace tokens and backing probes.

The Windows-GNU test configuration compiles. Runtime and smoke measurements require Windows hardware.

Assisted-by: Codex (GPT-5.6-sol)
Retain sequenced keys when the journal worker cannot start or exits, and append them only after its file handle is gone at a flush boundary. Mark torn retry fragments invalid so they cannot become false preload ranks while complete retried keys keep their order.

The worker-start fallback concept was adapted from #2635 by Decodere, authored there with Google Antigravity (Gemini 4 Neon), and reworked for the integrated ordered journal.

Windows-GNU cargo check passed; focused tests could not link because x86_64-w64-mingw32-dlltool is unavailable.

Assisted-by: Codex (GPT-5.6-sol)
Every present walked every title-visible stand-in and locked its shared build just to update the compiling title. Cold runs can retain tens of thousands of dormant lazy stand-ins, so this both reported work that was never queued and added O(N) render-thread contention with completion.\n\nAdapt the measured accounting idea from #1168 to the integrated coalesced Build model. Track each unique title-visible build through idle, active, and done, publish the counter before a worker can complete, and finish it exactly once on completion or last-owner orphaning. Auxiliary foreground builds remain outside the title-pipeline metric.\n\nThe Windows GNU library/test cross-check passed with the existing warnings. Windows MSVC runtime, GPU, and smoke tests were not available here.\n\nSource concept: #1168 by eizispark, written with Antigravity (Google DeepMind, Gemini 4 Carbon / Claude Opus 5.5).\n\nAssisted-by: Codex (GPT-5.6-sol)
A bind looked up the same stand-in twice in the global pending map. Completed compute pipelines also entered the wait path, taking completion and demand locks and trying to promote work whose real pointer was already published.\n\nAdapt #1708 to the integrated shared Build model: resolve through the first retained Pending entry and return a completed real pipeline after one acquire load. Zero still takes the existing budget, spared, wait, and failed-build paths.\n\nThe Windows GNU library/test cross-check passed with the existing warnings. Windows MSVC runtime, GPU, and smoke tests were not available here.\n\nSource implementation and measurements: #1708 by CallMeBrado, written with OpenAI Codex (GPT-6).\n\nAssisted-by: Codex (GPT-5.6-sol)
The transactional split already reserves a closed continuation before closing the producer, but a cache miss made a private allocator, opened a list on it, and closed the list only to Reset it later onto the title allocator. CreateCommandList1 directly makes the required closed allocator-free object.

Use that path when ID3D12Device4 is available and retain the existing allocator-backed path for older devices and Close-failure injection tests. This preserves the integrated preflight/commit/rollback model and allocator generation tracking.

The Windows GNU library/test cross-check passed with existing warnings. Windows MSVC, GPU tests, and title smoke were not available here.

Adapted from the CreateCommandList1 reservation concept in #2717 by Kalmarv with Claude Code (Claude Opus 5.5); its core close-before-create fix was already superseded by the integrated transactional split.

Assisted-by: Codex (GPT-5.6-sol)
Identical DXIL and pipeline flags can use different ordered static samplers in their root signatures. The disk cache previously assigned those pipelines one filename, so a whole, split-chain, or two-pass compute build could reject and replace another root signature's blob before paying for an uncached driver retry.

Include the sampler identity in runtime and offline cache names while preserving exact legacy names for empty-sampler roots. Adapted from the collision identified and reproduced by PR #1420, extended to the integrated dispatch-chain and two-pass paths.

Checked with the Windows GNU target; Windows MSVC runtime, GPU cache reuse, and smoke tests were not available here.

Assisted-by: Codex (GPT-5.6-sol)
CreateReservedResource ran while holding the global sparse state, so driver callbacks and unrelated sparse work could block behind resource creation. A deferred final Release could also be applied after a reused COM address was recorded, removing the live buffer's pins.

Adapt the measured direction from PR #2539 with stronger current-tree lifetime rules: serialize placements and state replacement, snapshot a strong fence generation, create unlocked, drain deferred releases, and publish only after exact generation and window revalidation. Abort releases the returned COM owner outside state.

The Windows GNU target check passed. Windows MSVC runtime, GPU tests, and smoke runs were not available here; #2539 supplied the earlier Windows/NVIDIA full-suite and paired-smoke evidence for the underlying change.

Assisted-by: Codex (GPT-5.6-sol)
Hot resource, command-list, allocator, fence, and queue hooks locked the global adopted-class table and scanned method names on every call. A translated draw paid this for both its draw and pipeline bind, and all recording threads contended on the same lock.\n\nAdapt #903 by caching the first slot at each interface-family call site. COM interface versions append methods, and a table-driven test verifies every cached method has one nonzero slot throughout its family. Cold or interface-dependent lookups remain dynamic.\n\nThe Windows GNU library/test cross-check passed with the existing warnings. Windows MSVC runtime, GPU, and smoke tests were not available here.\n\nSource implementation and native tests: #903 by mastrr9, authored with Claude Code (Claude Opus 5.5) and audited with Antigravity.\n\nAssisted-by: Codex (GPT-5.6-sol)
After the single-lookup bind improvement, every recording thread still took one process-wide PENDING map lock. The #1708 bind benchmark measured about 102 ns per completed bind with four callers, versus about 21 ns with one, leaving unrelated command-list recorders serialized.

Route exact stand-in addresses across 64 fixed shards. Insert, lookup, and release remain single-shard operations; the retained Pending owns the shared Build independently, and constant-time queued accounting needs no registry-wide snapshot. Tests cover parallel lifetimes, raw-address replacement, shard distribution, and lock independence.

The Windows GNU library/test cross-check passed with the existing warnings. Windows MSVC runtime, GPU, benchmark, and smoke tests were not available here.

Assisted-by: Codex (GPT-5.6-sol)
The sparse upload ring retried a five-second fence wait forever while holding global sparse state. A stalled upload queue therefore blocked activity reporting and every later title submission permanently.\n\nAdapt #1277's bounded exit, but preserve correctness beyond the source patch: mark exactly the unsubmitted 64-byte chunk suffix for retry instead of leaving its sent hashes stale or invalidating already-submitted chunks in the same page. A synchronous readback aborts when its prerequisite upload did not complete, so it cannot overwrite CPU memory with stale GPU data.\n\nThe Windows GNU library/test cross-check passed with the existing warnings. Windows MSVC runtime, GPU execution, and smoke tests were not available here.\n\nSource diagnosis and timeout test: #1277 by ExoCalibra, assisted by Antigravity (Gemini 4 Neon).\n\nAssisted-by: Codex (GPT-5.6-sol)
The existing row-factorized detiler still visited swizzled textures one element at a time and recalculated block placement for every element. Large CPU-written textures therefore consumed milliseconds on the submit path even after persistent detile workers.

Adapt raylitebull's 032c661a block-slab algorithm: cache the largest provably contiguous horizontal run for each immutable GFX10 layout, keep one 4 KiB/64 KiB block hot at a time, bulk-copy complete runs, and retain element-wise bounds checks for a truncated source. Low-bit base swizzles shorten runs safely; thick 3D single-slice helpers retain their former path.

On this AMD EPYC 7R13 Linux host, an isolated release benchmark against 032c661a's parent reduced 1920x1080 R8 mode-5 detile from 8.8-10.3 ms to 0.76-0.87 ms and tile from 28-31 ms to 0.64-0.78 ms. A 2048x2048 RGBA8 mode-10 detile fell from 28-31 ms to 9.7-11.8 ms and tile from 59-67 ms to 5.8-6.9 ms.

All 17 isolated pure tiling tests passed. The Windows GNU library/test cross-check passed with the existing warnings; Windows MSVC, GPU, and smoke tests were unavailable.

Source algorithm: 032c661a by raylitebull, assisted by Antigravity (Gemini 4 Neon High).

Assisted-by: Codex (GPT-5.6-sol)
Integrated XCL already keeps cold title-visible builds on workers, superseding #2615's title-thread compile fix without adopting its correctness-losing default skip policy. Worker failure still had terminal holes: a panicking job was caught only outside the Build and never woke its waiters, a panicking parallel piece omitted a result, and zero workers or a refused queue left accepted work with no executor.

Catch pipeline and piece panics as failed results, restore worker-local/preload state before publishing completion, and fail exact jobs when no normal worker can start or the queue refuses them. Failed speculative-preload startup leaves the build dormant so a later title demand can schedule it normally.

The Windows GNU library/test cross-check passed with the existing 11 library warnings and 2 test warnings (1 duplicate). Windows MSVC runtime, GPU, and smoke tests were not available here.

Panic-recovery source: #2053 by RandomGithub12309, written with Antigravity (Gemini 4 Neon).

Assisted-by: Codex (GPT-5.6-sol)
DirectStorage destinations and emulated CLZERO checked sparse-window pages with VirtualQuery. The measured source PR #501 found those walks averaged 6.7 ms, reached 138 ms, and serialized GetWriteWatch on a retail title.

Adapt its affirmative commit/protection cache to the integrated sparse lifecycle. The state lock checks one mask per 64 KiB tile and is released before batched working-set queries. Non-writable changes publish conservatively before the OS call, commits publish protection atomically, current-process *Ex handles are tracked by process ID, and probed-but-untracked pages remain in the fallback path. All uncertain cases still use VirtualQuery.

The Windows GNU library/test cross-check passed with the existing warnings. Windows MSVC runtime, GPU, and smoke tests were not available here; #501's timing and title results were not independently reproduced.

Source implementation and measurements: #501 by mrp1no with Claude Code (Claude Opus 5.5).

Assisted-by: Codex (GPT-5.6-sol)
Sparse upload and readback paths continued after a five-second fence timeout, resetting command allocators which the GPU could still be using and publishing readback staging bytes whose copy had not completed. Reset and Close failures were ignored as well.\n\nMake upload-slot acquisition fail closed, retry exact dirty or zero work, and abort readback before allocator reuse or CPU publication whenever its wait or command-list transition fails. The healthy asynchronous path is unchanged.\n\nThe Windows GNU library/test cross-check passed with the existing warnings. Windows MSVC runtime, GPU execution, and smoke tests were not available here.\n\nAssisted-by: Codex (GPT-5.6-sol)
Texture page preparation called the native title-queue Wait while holding the device-wide PAGES registry. A driver call on one queue therefore serialized streaming, bookkeeping, and unrelated queues behind a global state lock.\n\nGive each title queue a lifecycle-scoped preparation gate, reserve its monotonic mapping fence value under PAGES, and enqueue the native wait after releasing PAGES. The gate prevents same-queue submissions from overtaking a reserved wait while different queues remain independent; exact queue retirement removes both waited state and its gate.\n\nThe Windows GNU library/test cross-check passed with the existing warnings. Windows MSVC runtime, GPU, and smoke tests were not available here.\n\nAssisted-by: Codex (GPT-5.6-sol)
Driver cached pipeline blobs can be node-specific on linked-adapter devices. Include NodeMask in the in-memory compute blob identity so a compile for one node cannot be offered to another.

Checked with the Windows GNU cross-target cargo check; Windows runtime and GPU tests were not available.

Assisted-by: Codex (GPT-5.6-sol)
D3D12 root signatures belong to the device that created them. Cache both plain and static-sampler ABI signatures by device so secondary devices cannot receive a foreign COM object.

A synthetic cache test covers identical sampler layouts on distinct devices. Checked with the Windows GNU cross-target cargo check; native Windows GPU tests were unavailable.

Assisted-by: Codex (GPT-5.6-sol)
A fresh dispatch-chain root signature made the in-memory compute blob key unique for every split program, preventing programs with common pieces from sharing their driver-compiled blobs.

Cache signatures by device and exact static-sampler layout. PR #2723 measured shared-piece reuse on Windows; the integrated stage passed the Windows GNU cross-target cargo check, but native GPU execution was unavailable here.

Assisted-by: Codex (GPT-5.6-sol)
Heap-window reads in the direct DXIL compute path placed a branch and PHI set around every access. Add an opt-in one-path form whose cache identity is shared by runtime and offline precompile, while the HLSL path strips the flag and stays byte-identical. Graphics stages remain guarded because their performance has not been established across vendors.

Adapted from #2427 by Kalmarv and Claude Code (Claude Opus 5.5).

Assisted-by: Codex (GPT-5.6-sol)
Keep superseded reserved textures and their tiles alive until completion markers on every relevant title and upload queue have passed. Use the guarded queue-retirement snapshot and CPU polling so the mapping queue never waits back on title work. Fail closed when a trustworthy marker cannot be made.

Adapted from PR #2270 by Joey Percia, incorporating the queue-cycle finding from PR #594 by Abdellah Khanani.

Assisted-by: Codex (GPT-5.6-sol)
The in-memory driver-blob key already includes NodeMask, but the disk filename did not. Persist nonzero linked-adapter node masks in the name so later processes cannot offer node-specific cached state to another node; node zero keeps cache compatibility.

Checked with the Windows GNU cross-target cargo check; native linked-adapter execution was unavailable.

Assisted-by: Codex (GPT-5.6-sol)
The Windows Opus decoder converted PCM16 output one sample at a time. Copy complete little-endian samples into the reserved output buffer in one operation while preserving scalar float conversion and partial-sample handling.

Adapted from PR #2696 by Decodere and Google Antigravity (Gemini 4 Neon), which measured the 3840-byte PCM16 append at 1024.4 ns before and 31.5 ns after. The Windows GNU cross-target library/test check passes; native Windows audio execution was unavailable.

Assisted-by: Codex (GPT-5.6-sol)
Reserve fail-closed completion values while updating the held mapping, then call the driver queue Signal methods after releasing PAGES. Concurrent completion polling sees unsignalled values and keeps the mapping, and a Signal failure remains safely incomplete.

Checked with the Windows GNU cross-target cargo check; native multi-queue GPU tests were unavailable.

Assisted-by: Codex (GPT-5.6-sol)
HEAP_FLAT changes only compute-stage direct DXIL. Remove the flag from vertex, pixel, mesh, and geometry translation inputs so opting into the compute fast path does not invalidate byte-identical graphics cache entries.

Checked with the Windows GNU cross-target cargo check; native GPU execution was unavailable.

Assisted-by: Codex (GPT-5.6-sol)
Concurrent preparation processes could hand the same missing or stale compute pipeline to the driver at once. Coordinate each exact driver-cache path with an exclusive Windows delete-on-close handle, which also releases ownership immediately when a worker is terminated.

Filesystem failures remain fail-open so preparation still works without a writable shared cache. Adapted as the first separable stage of PR #2712 by ZekkJJ.

Checked with the Windows GNU cross-target cargo check; native Windows claim tests and GPU execution were unavailable.

Assisted-by: Codex (GPT-5.6-sol)
Two-pass mesh and geometry streams preserved NodeMask for their visible mesh PSO but built the hidden compute pass on node zero. Carry the same node into its descriptor and both in-memory and persisted driver-blob identities.

A stream test covers NodeMask extraction. Checked with the Windows GNU cross-target cargo check; native linked-adapter execution was unavailable.

Assisted-by: Codex (GPT-5.6-sol)
Manual running-count decrements covered normal returns but leaked a slot if driver pipeline creation panicked, potentially leaving every later preparation thread blocked on the concurrency cap.

Use a narrow RAII permit for only the running counter and condition variable. A deterministic unwind test verifies the counter returns to zero and a waiting thread can acquire the slot.

Adapted as an independent stage of PR #2712 by ZekkJJ. Checked with the Windows GNU cross-target cargo check; native Windows tests and GPU execution were unavailable.

Assisted-by: Codex (GPT-5.6-sol)
Repeated monitorx and mwaitx emulation can raise tens of thousands of illegal-instruction exceptions per second on Intel CPUs. Replace each aligned site atomically with nops or pause plus nops after its first fault.

Serialize page protection changes, retry word replacement after interference, preserve adjacent rewrites, restore RX protection, flush the instruction cache, and recognize exceptions already in flight at a newly rewritten site.

Adapted from PR #2618 by Tarosul and Claude Code (Claude Opus 5.5). That PR measured a retail workload improving from 1.24 to 2-3.5 presents/s. The Windows GNU cross-target check passes; native Windows tests and smoke were unavailable here.

Assisted-by: Codex (GPT-5.6-sol)
At a fresh decoder boundary, packet durations determine the complete PCM sample count before decoding. Reserve that bounded count once for mono, stereo, and duration-validated multistream buffers; skip speculation when an MFT may still hold output from an earlier call.

Adapted from PR #2696 by Decodere and Google Antigravity (Gemini 4 Neon). The Windows GNU cross-target library/test check passes; native Windows audio execution was unavailable.

Assisted-by: Codex (GPT-5.6-sol)
A retail world run measured hundreds of free PC allocators stranded in separate title-allocator namespaces while non-local memory kept growing. Let an allocator without an idle spare take a same-type spare from another namespace before creating another native allocator.

Fence probes run outside the pool lock. Exact backing snapshots and donor reset tokens reject concurrent use or an unlocked native Reset, then the candidate is transferred and claimed through the requester's normal reset generation. Adapted from PR #2725.

The Windows GNU cross-target library/test check passes; native Windows tests and smoke were unavailable.

Assisted-by: Codex (GPT-5.6-sol)
When the driver cache path or its cross-process claim is unavailable, identical preparation workers could enter the driver together and multiply its peak memory and compile contention.

Key in-flight work by the complete pipeline cache identity and make later local workers wait for the active attempt. The RAII slot is released and waiters are notified on every return and panic; completed identities are not retained, so later cache-validation passes and retries after failures remain unchanged.

Adapted from PR #2712 by Bloxive.

Co-authored-by: Bloxive <[email protected]>
Assisted-by: Codex (GPT-5.6-sol)
PR #2633 changed every split pipeline to a root CBV, including direct dispatches that regressed on RADV. Prepare an indirect-only variant instead: retain the existing direct root constants and legacy driver-cache identity while defining a distinct CBV root layout and cache namespace for indirect pipeline states.

This is deliberately wiring-only. The indirect pipeline must be built as a separate PSO because D3D12 pipeline states are tied to their root signatures.

Assisted-by: Codex (GPT-5.6-sol)
Translated graphics PSOs could share a driver-blob key even when one retained a native geometry shader that the other did not. Hash and size the final GS bytes, including native GS bytecode, rather than only XCL's generated rectangle shader.

Scope bounded RAM entries to the effective per-device root signature. Persisted paths remain adapter-scoped and encode the static-sampler ABI, while in-process entries can no longer cross devices.

Stream-output declarations are pointer-backed state not represented by the descriptor key, so leave those pipelines uncached instead of aliasing different layouts. An unreadable nonempty GS is also conservatively uncached. This follows the cache-identity findings in PR #902 and issue #2508.

The Windows GNU cross-target library/test check passes; native Windows tests and smoke were unavailable.

Assisted-by: Codex (GPT-5.6-sol)
The translated-shader LRU subtracted dispatch-chain piece capacities during eviction but omitted them when admitting an entry. Large split programs could therefore retain substantially more than the configured byte budget.

Use the same complete capacity calculation at insertion and eviction, with a regression test whose whole shader fits only when its split pieces are incorrectly ignored. This closes the cache-accounting gap identified in issue #2508.

The Windows GNU cross-target library/test check passes; native Windows tests and GPU execution were unavailable.

Assisted-by: Codex (GPT-5.6-sol)
Cold 128-256 KiB compute PSOs took tens of seconds and over 1 GiB each when amdxc64 compiled 16 at once. Give that AMD-only class a RAM-scaled lane separate from the existing huge and giant lanes, without reducing NVIDIA or graphics parallelism. Two-pass pipelines take one outer turn for both driver calls.

Assisted-by: Codex (GPT-5.6-sol)
A successful warm disk lookup counted the hit and dropped its loaded Arc without offering that generation to the bounded RAM cache. Repeated creates of the same compute, graphics, or two-pass key could therefore reread and copy the same file.

Admit the accepted Arc under the existing byte cap while holding capture-reservation ownership in the same lock order. Concurrent admissions charge bytes once, active builders retain ownership, and stale rejection removes only the exact Arc generation used by the driver.

Assisted-by: Codex (GPT-5.6-sol)
Every mirrored vertex or index bind and draw searched the append-only mirror table behind one global mutex. Once a title created a mirror, repeated hot-path lookups serialized even though existing entries never change.

Keep a complete ordered mirror snapshot per thread and answer positive lookups locally. Misses still lock and refresh from the authoritative table, preserving first-match range selection and immediate discovery before creating a mirror; the no-mirror case rejects from the existing byte counter.

Assisted-by: Codex (GPT-5.6-sol)
A split compute pipeline previously always used its expensive whole form for ExecuteIndirect. For the measured one-Dispatch, one-command shape, generate bounded piece commands on the GPU once that whole fallback is already available.

The slicer emits either every piece slab or only the whole dispatch, so it cannot lose work. Generated commands remain owned by the recording until its allocator resets, including when ABI binding fails. The first use and all other command shapes retain the existing whole-form path.

Assisted-by: Codex (GPT-5.6-sol)
Allocator swapping made the logical title allocator differ from the native backing that owns a recording. Key pending console UMA blocks to that native backing and release them only after its exact generation is proved idle and reset or retired.

Driver Reset, fence polling, UMA release, and COM Release remain outside allocator pool state.

Assisted-by: Codex (GPT-5.6-sol)
Track resident and SRV-addressable texels only when XCL_ACTIVITY is enabled. Disabled runs do not allocate per-texture accounting or take the PAGES lock from SRV creation. Deferred superseded mappings remain resident until their guarded GPU unmap actually completes.

Assisted-by: Codex (GPT-5.6-sol)
Add a separate detailed stall-tracing tier for high-frequency command recording. The first title submit identifies the submitting thread, and only that thread's draw, dispatch, binding, barrier, copy, and list-lifecycle work is timed. Coarse tracing and default runs still avoid clock reads and counter updates at those hot call sites.

Assisted-by: Codex (GPT-5.6-sol)
Describe the opt-in resident, SRV-addressable, and virtual texel line emitted with XCL_ACTIVITY.

Assisted-by: Codex (GPT-5.6-sol)
Root-constant ExecuteIndirect costs about 15.3 us per piece step on the measured RTX 5070 Ti, versus 0.41 us for a Dispatch-only signature. Build a bounded, speculative indirect-only piece and whole set on one background lane, then share one 256-byte CBV command per round across its pieces.

Direct dispatch keeps its existing constants ABI. Until the direct whole and complete indirect set are ready, ExecuteIndirect keeps the existing whole fallback. Source-plan retention and live duplicate admission are each capped at 64 MiB.

Assisted-by: Codex (GPT-5.6-sol)
A successful offline driver compile could silently fail to persist its blob and repeat the same expensive work on the next run. Count attempted persistence failures, warn once with the affected path, and include the total in the preparation summary without changing completion semantics.

Assisted-by: Codex (GPT-5.6-sol)
Record the canonical console compute record hash when a split chain reaches ExecuteIndirect. The bounded journal lets used-only preparation distinguish the few split programs whose GPU-written dimensions require the exact whole fallback.

Build their duplicate pieces and whole form with the indirect-CBV root and cache namespace, while preserving direct-root pieces and leaving unobserved split programs unchanged.

Assisted-by: Codex (GPT-5.6-sol)
ExecuteIndirect command storage was a committed resource per call. Keep one weakly indexed resource per command-list recording and reuse offset zero after a complete UAV-to-read-to-UAV state cycle. Recordings retain it through the native allocator reset, including bind failures, while list reset and release invalidate future reuse.

Assisted-by: Codex (GPT-5.6-sol)
Teach the tile allocator to keep evictable and pinned allocations on different backing heaps. Existing production allocation remains pinned, so this is a behavior-neutral foundation for reclaiming fully evicted heaps later.

Assisted-by: Codex (GPT-5.6-sol)
Keep each lazily mapped mip group’s page keys separate through normal release, deferred superseded unmap, and cancellation. This prepares fence-safe group retirement without enabling eviction; all current groups still allocate from the pinned class.

Assisted-by: Codex (GPT-5.6-sol)
Selected prewarming built the indirect variants but left the direct whole fallback cold, while ExecuteIndirect refused to use those variants until the direct whole had already been built. This preserved the first-use stall despite a successful prewarm pass.

Persist both whole roots for selected programs, start cached indirect loading during chain preparation, and let a ready indirect set run independently. Initialize and gate the use journal off the recording hot path.

Assisted-by: Codex (GPT-5.6-sol)
A successful offline PSO creation did not say whether it produced a reusable driver blob. Count only successful fresh creations and assign each exactly one terminal persistence outcome: saved, unavailable, disabled, or write failed. Preserve the existing cache-hit, refusal, and failure output while making cold preparation results auditable.

Assisted-by: Codex (GPT-5.6-sol)
XCL_ACTIVITY now reports the foreground cost of each serialized look before title submission: write-watch bytes, ranges and dirty pages; sparse lock, scan and upload phases; and remaining texture refresh work.

When activity reporting is disabled, remove the prior unconditional sparse timing clocks, range-byte sums, atomic counter updates and power-of-two timing logs. GetWriteWatch retains its atomic retrieve-and-reset behavior.

Assisted-by: Codex (GPT-5.6-sol)
A title allocator can already have rotated to another native backing when it creates a command list. Pass that backing to native CreateCommandList and allocator-pool recording ownership while retaining the logical title allocator for list reset, KickoffX, and allocator-release tracking.

Assisted-by: Codex (GPT-5.6-sol)
Detailed stall tracing already accounts for command recording but leaves descriptor and view creation untimed. Add one submitter-only category around title descriptor API entry points, retaining the existing one-atomic-load disabled path and avoiding a second accounting system.

Assisted-by: Codex (GPT-5.6-sol)
Publish each completed look as one record so a reporting boundary cannot split its phases from its total. Separate refresh serialization wait from active work, name queue and fence/state phases for what they contain, and retain zero/dirty transfer volume without adding work when activity reporting is disabled.

Assisted-by: Codex (GPT-5.6-sol)
Keep shared pages keyed by title address so pinned and evictable resources preserve console aliasing. Treat heap classes only as fresh-allocation packing hints, retain one empty pool per class, and include lazy mip-group ownership in test mapping inspection.

Checked with cargo check -p xcl --tests --target x86_64-pc-windows-gnu using the host GCC and ar; the library and test target compiled with pre-existing dead-code warnings.

Assisted-by: Codex (GPT-5.6-sol)
Measure completed background PSOs retained behind stand-ins and bucket them by frames since completion or last use. The activity-only bind path uses frame-counter atomics, while the two-second observer performs registry scans and deduplicates coalesced builds.

Checked with cargo check -p xcl --tests --target x86_64-pc-windows-gnu using the host GCC and ar; the library and test target compiled with pre-existing dead-code warnings.

Assisted-by: Codex (GPT-5.6-sol)
A synchronous GPU copy-back previously replaced an entire committed page span and then accepted those bytes as sent state. If the CPU had changed one of its 64-byte chunks after the last upload, that newer value was lost. Land only chunks whose current hash still matches the last-sent hash; leave dirty chunks and hashes unchanged for the next upload look.

Assisted-by: Codex (GPT-5.6-sol)
A retail title's world load can stop with no GPU-wait time-out: presents,
submits and DirectStorage requests go to 0 and every thread waits. The
watchdog's summaries of pending title fences and of XCL's own unmet queue
waits are only logged at a time-out, so such a stop did not say whether
a fence or a queue was behind.

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

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XZrhsCAiLU1tTuEBwPLaRW
The three lines of the first commit read "none / none / 0" in runs where
the title had stopped after its first #101: no fence and no queue was
behind, yet nothing was presented. What showed the stop was a SYNC_GRAPH
cell whose recorded value is above what was submitted and completed,
with no GPU wait armed: a list that writes the value was recorded and
never submitted, so the submitting thread is held (GreemSC's runs, RX
7900 XT; the thread dump then named that thread).

cells_behind_summary lists such cells, and those with armed waits:
memory, completed, submitted (and on which queue), recorded and CPU
values, and the armed waits with their age. It takes the graph with
try_lock, since a dump can come while a submitting thread holds it.
The cell is read with ReadProcessMemory (dstorage::read_own), since
the title can decommit its page at any time; an unreadable cell shows
"mem unreadable" (bmjask's review).
The function is GreemSC's, from the review of this PR.

Co-authored-by: GreemSC <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XZrhsCAiLU1tTuEBwPLaRW
A cell recorded and never submitted (#1452: rec 0x619, sub 0x0@qNone)
did not say which list recorded the value or what became of that list.
Each cell now keeps the PC list and time of the recording that set its
recorded_max, and each list that recorded a Write64 keeps its last
execute, Reset and Release (signal_write64_fences, the KickoffX submit,
reset_pc, clear_segment_state, on_release). The cell entry in
cells_behind_summary prints them as their time after the recording, or
"no": reset or released with no execute is a recording thrown away
(#2691's address reuse shows as a release), executed is a miss on the
submit side, and none of the three a list the title still holds.

Part of #1452.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The trace was kept per list address: after a Reset, or a Release and a
new list at the same address, a later execute of another recording
showed on the old cell as "executed", though its write was thrown away.
Each recording that records a Write64 now has a trace of its own, which
the cells it recorded hold; a Reset or Release ends it, and what comes
to the list after belongs to the next one.

The test adds both cases: Reset, an unrelated recording and its execute
leave the old cell at "executed no", and so do a Release and a list at
the same address that records and is executed.

Part of #1452.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The integrated execution path publishes captured SubmissionChunk effects instead of calling the legacy post-submit helpers. Capture each recording token with that immutable plan and mark it only after the exact chunk reaches the driver, so Reset, Release, address reuse, and split waits cannot redirect execution to another generation. Kickoff ends the actual reset target only after Reset succeeds. Recording-level tracing remains disabled unless XCL_THREAD_DUMP_AT schedules a dump.

Assisted-by: Codex (GPT-5.6-sol)
Pipeline jobs normally consume their owned descriptors on the first build. Preserve that one-shot path without an extra device reference or retained shader storage, while allowing XCL_PSO_REBUILD_RECIPES=1 to keep immutable, fully owned inputs for future residency work.

Clear borrowed root signatures and unused pointer members, and reject stream-output arrays that are not owned. The opt-in recipe owns its device and can run repeatedly; no rebuild or eviction is activated yet.

Assisted-by: Codex (GPT-5.6-sol)
SRV coverage previously deduplicated only mip levels, so a one-slice view counted every slice in an array and later distinct slice views added nothing. Retain disjoint slice intervals per mip and add only newly addressable texels.

The accounting remains restricted to XCL_ACTIVITY runs.

Assisted-by: Codex (GPT-5.6-sol)
Future generation-pinned resources need the exact queue progress after native execution, including a fail-closed distinction when execution may have happened but its marker could not be published. Reuse the allocator pool queue marker and keep the existing submission path unchanged.

Assisted-by: Codex (GPT-5.6-sol)
Texture residency cannot safely replace descriptors until recorded command lists and queue fences carry descriptor generations. Retain only the current CPU-side logical state, keyed by heap generation and slot, so later work has exact resource, device, descriptor, and publication identities without holding COM objects alive.

The opt-in tracker serializes complete hooked descriptor mutations, mirrors overwrites and range copies, stores all eight console descriptor words, and provides an unused on-demand generation-checked snapshot that discards raw-memory rewrites. Untrackable fallback sources clear destinations. It does not scan submissions, rewrite descriptors, or change texture mappings.

Measured with a Windows GNU cross-target check including tests; executable tests were not run because this Linux host cannot run the Windows target.

Assisted-by: Codex (GPT-5.6-sol)
Dirty scanning used to mark chunks sent before command-list close, execution, and queue signalling established that the bytes had a durable ordering receipt. Capture hashes from each bounded staging batch and publish them only after that batch is signalled. Keep a signal-failed generation alive because its GPU completion cannot be proven.

Assisted-by: Codex (GPT-5.6-sol)
Retained rebuild recipes now publish a monotonic native generation with one strong pipeline owner before the raw result becomes visible. A future recording path can resolve and pin that exact generation under the same lock used by completion and release, without a raw-pointer AddRef race.

The ordinary one-shot path keeps its existing allocation and AddRef behavior.

Assisted-by: Codex (GPT-5.6-sol)
Write-watch bits are reset before sparse uploads have a durable ordering receipt. Preserve failed pages in the sparse state, retry preparation against the same dirty snapshot, and roll back failed title-queue waits. A void title submission can only proceed after preparation is ready; an untracked or repeatedly failed upload stops the title instead of silently running stale GPU work.

Assisted-by: Codex (GPT-5.6-sol)
Record shared view-heap use on each physical command-list segment after translated ABI binding succeeds. Preserve bundle use in the parent recording and carry immutable use through submission planning without changing default behavior.

Assisted-by: Codex (GPT-5.6-sol)
Reserve exact opt-in shared-view heap epochs at native title submission and retain their strong fence receipts until retirement. Keep future descriptor mutations serialized with reservation, and poison quiescence permanently when executed work cannot be tracked.

Assisted-by: Codex (GPT-5.6-sol)
Recipe-backed PSOs can eventually replace a native object while recorded command lists still refer to the prior generation. Capture the exact generation atomically at every native bind, deduplicate pins per physical segment, and carry them into immutable submission plans and bundle parents. This stage intentionally stops at capture; submission retirement will attach the pins to receipts later.

Assisted-by: Codex (GPT-5.6-sol)
Sparse upload slot and staging-ring retirement waited for the GPU while holding the global sparse state, blocking commits, mappings and other state users behind a stalled queue. Return exact generation-bound wait tickets only at closed-list boundaries, wait under a lifetime gate with STATE released, then validate and rescan journaled CPU writes before recording more work. Signal failure remains terminal poison.

Assisted-by: Codex (GPT-5.6-sol)
Retained recipes need one atomic replacement path before any eviction policy can use them. Coalesce overlapping rebuild requests, keep the current generation on failure, publish replacements under the build lock, and abandon new results when the last title owner disappears during the driver build. No policy calls this foundation yet.

Assisted-by: Codex (GPT-5.6-sol)
Keep exact native pipeline generation owners through GPU completion using the same strong submission receipt already requested for descriptor epochs. Executed work without a receipt retains its pins permanently; ordinary submissions without opt-in pins keep the marker-free path.

Assisted-by: Codex (GPT-5.6-sol)
Serialize opt-in final resource release with a dedicated lifetime gate so a future quiescent rewrite cannot clone a numeric COM identity after it died. On logical zero, remove the tracker entry atomically with lease snapshots, then leave the lifetime gate before unrelated backing cleanup. Descriptor writes never nest with that gate, and the exact-generation strong resource lease never waits for descriptor writes. Heap-generation leasing and raw descriptor-memory reconciliation remain separate prerequisites.

Assisted-by: Codex (GPT-5.6-sol)
Reserve rebuild attempts in the recipe state machine before placing them on the existing speculative pipeline worker band. Queued attempts own the Build independently of the Pending registry and recheck title ownership before driver work and publication, so release cannot resurrect a pipeline and failed rebuilds retain the current generation.

Assisted-by: Codex (GPT-5.6-sol)
Scan the small upload-slot ring before waiting so a busy round-robin head does not hide an already-retired allocator. When every slot is busy, wait on the earliest value from the shared sparse fence without advancing slot ownership.

Assisted-by: Codex (GPT-5.6-sol)
Use the generation owner's stable Arc allocation as the identity for hash-based receipt and permanent-poison deduplication. This preserves distinct generations when a driver reuses the same raw pipeline address while removing unbounded repeated Vec scans.

Assisted-by: Codex (GPT-5.6-sol)
Keep the source and shared native descriptor heaps and their device alive while a future quiescent mutation validates an exact heap generation and slot. Serialize opt-in final heap Release without taking the descriptor-write gate, and preserve the default-off path.

Assisted-by: Codex (GPT-5.6-sol)
Compose queue quiescence, exact resource and heap leases, descriptor-write exclusion, and final logical-generation and raw-word checks into an uncalled mutation transaction. Stale observations fail closed, while strong COM owners are released only after inner locks have been dropped.

Assisted-by: Codex (GPT-5.6-sol)
Retain the exact native backing named by an accepted upload so the process-wide ownership gate can be released while its retirement fence is waited. A crossing uploader may reuse retired slots or ring space; the waiter only mutates exact unchanged state and otherwise rebuilds from the current generation.

Assisted-by: Codex (GPT-5.6-sol)
Model recipe residency explicitly and add an uncalled eviction transition that atomically detaches the raw and generation owners while excluding rebuild publication. Exact recording pins remain independent, and COM owners are released only after every state lock is dropped.

Assisted-by: Codex (GPT-5.6-sol)
Separate upload-gate acquisition and hold time for title submission preparation from synchronous readback work under XCL_ACTIVITY. Released readback waits include fence retirement and gate reacquisition, while the disabled path performs no clock reads or counter updates.

Assisted-by: Codex (GPT-5.6-sol)
Amortize queue quiescence and descriptor-write exclusion across a deterministic set of tracked SRV generations. Each candidate keeps exact resource and heap owners, is revalidated against its logical generation and raw words, and drops every owner outside tracker and write locks.

Assisted-by: Codex (GPT-5.6-sol)
Reserve absent recipe generations before placing reconstruction on the speculative worker band. Queue refusal, cancellation, and unwind restore a retryable state; release before or during driver work cannot resurrect a generation.

Assisted-by: Codex (GPT-5.6-sol)
Represent zero, retry, and dirty page work as generation-tagged claims with monotonic identities. Later observations remain journalled behind the exact owner, and cancellation or unwind restores only that claim without rewinding newer work.

Assisted-by: Codex (GPT-5.6-sol)
Parse the interval metrics already preserved in performance logs, sum them per cold or warm run, and expose raw baseline/candidate/delta values. Older logs keep explicit missing states instead of inventing zero counters.

Assisted-by: Codex (GPT-5.6-sol)
Record recipe-enabled pipeline use in a bounded lock-free weak-identity ring so a future pressure policy can inspect a fixed amount of work without scanning the title registry or retaining released PSOs. Background draining filters exact resident, owned, inactive builds and leaves eviction transitions uncalled.

Assisted-by: Codex (GPT-5.6-sol)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 12:03:09 +00:00
Carry exact mapping, published-hash and source-page identities between a bounded work claim and a future serialized commit phase. Invalid or abandoned plans restore only their exact claim, while only a successful serialized commit closure consumes it without opening allocator, command-list or staging state.

Assisted-by: Codex (GPT-5.6-sol)
Apply conservative frame-age thresholds to a bounded background drain and order eligible resident pipelines oldest-first. Selection re-reads use/completion ages, treats frame-counter wrap as recent, and leaves pressure admission and eviction uncalled.

Assisted-by: Codex (GPT-5.6-sol)
Track generation-bound slot and ring ownership with monotonic reservation serials. Retire only a contiguous prefix backed by exact submission receipts, and fail closed when an ordering signal cannot be established.

Keep the model private and inert so later commit-phase work can adopt it without changing live sparse upload behavior.

Assisted-by: Codex (GPT-5.6-sol)
Author
Owner

@⁠KOLESNiii on GitHub · 2026-11-26 12:15 UTC · original

Can these improvements be broken down into smaller scoped changes, and then individually merged into main, instead of this mega-PR?

**@⁠KOLESNiii** on GitHub · 2026-11-26 12:15 UTC · [original](https://github.com/xcl-dev/xcl/pull/2778#issuecomment-7191780156) Can these improvements be broken down into smaller scoped changes, and then individually merged into main, instead of this mega-PR?
Port direct-DXIL output-parity coverage for flat versus guarded heap reads across four and the maximum supported window count. Keep one window as a root-UAV-only degenerate baseline, and exercise null, outside-UMA, inactive-lane, and view-boundary reads in native and forced split-wave64 forms when supported.

Assisted-by: Codex (GPT-5.6-sol)
Define a default-off, pure pressure state over explicit DXGI budget samples. High/low hysteresis keeps decisions stable, while per-turn eviction limits and exponential rehydrate backoff bound future policy work.

Assisted-by: Codex (GPT-5.6-sol)
Author
Owner

@⁠inf1425 on GitHub · 2026-11-26 12:20 UTC · original

Please complete your PR template too...

**@⁠inf1425** on GitHub · 2026-11-26 12:20 UTC · [original](https://github.com/xcl-dev/xcl/pull/2778#issuecomment-7191875637) Please complete your PR template too...
Compose immutable upload plans with exact slot and ring reservations while keeping the protocol private and disconnected from live D3D12. Pre-submit failures restore work; accepted executions publish receipts or poison their generation.

Assisted-by: Codex (GPT-5.6-sol)
Keep planner-owned batches visible to foreground queues until an exact receipt or obsolete resolution closes their epoch. Lease rotation makes pre-accept takeover safe while accepted work remains wait-only.

Assisted-by: Codex (GPT-5.6-sol)
Keep each upload slot, ring rollback point, and unpublished hash plan in one prepared batch. Pure copy planning now makes the existing window and ring split boundaries explicit without changing submission or wait behavior.

Assisted-by: Codex (GPT-5.6-sol)
Keep work claims and their visibility frontier under one atomic ledger. Lease rotation revokes stale planners without restoring their work, while unsealed reasons and accepted failures remain visible or fail closed.

Assisted-by: Codex (GPT-5.6-sol)
Add an inert ledger which reserves bounded capacity before native detachment and validates every later transition against the exact build allocation, native generation, slot generation, and serial. Armed failures remain visible until explicitly retired.

Assisted-by: Codex (GPT-5.6-sol)
Author
Owner

@⁠KOLESNiii on GitHub · 2026-11-26 12:46 UTC · original

I put together a proposed split in #2787. @⁠bmjask, are you planning to open PRs for the slices below? If any are unclaimed, I’d like to take them and open focused PRs against main, keeping the original commit attribution.

  • Sparse upload recovery. Start with publishing sent hashes only after a successful queue signal (41a369ee), then preserve and retry dirty work when upload preparation fails (3cd053e4). I’d coordinate the timeout prerequisite with #1277.
  • Deferred CPU write ordering. Extract 311fc618 with the minimum producer tracking it needs, so a list wait can see the deferred CPU write that satisfies it. I’d keep this to its own regression and PR.
  • Contiguous 2D tiling runs. If the synchronization fixes are spoken for, I can take b81ac2eb as a standalone PR with byte-parity coverage and a detile benchmark.

I’d start with sparse upload recovery if that’s free. If there’s a prerequisite I’ve missed or a narrower cut you’d prefer, please point me to it.

**@⁠KOLESNiii** on GitHub · 2026-11-26 12:46 UTC · [original](https://github.com/xcl-dev/xcl/pull/2778#issuecomment-7192442264) I put together a proposed split in #2787. @⁠bmjask, are you planning to open PRs for the slices below? If any are unclaimed, I’d like to take them and open focused PRs against main, keeping the original commit attribution. - **Sparse upload recovery.** Start with publishing sent hashes only after a successful queue signal (`41a369ee`), then preserve and retry dirty work when upload preparation fails (`3cd053e4`). I’d coordinate the timeout prerequisite with #1277. - **Deferred CPU write ordering.** Extract `311fc618` with the minimum producer tracking it needs, so a list wait can see the deferred CPU write that satisfies it. I’d keep this to its own regression and PR. - **Contiguous 2D tiling runs.** If the synchronization fixes are spoken for, I can take `b81ac2eb` as a standalone PR with byte-parity coverage and a detile benchmark. I’d start with sparse upload recovery if that’s free. If there’s a prerequisite I’ve missed or a narrower cut you’d prefer, please point me to it.
Run pressure admission and bounded candidate inspection only from the existing activity observer, using its completed DXGI sample. Every live popped identity is requeued or conserved weakly without clearing its dedup flag, so crossing binds, transient rebuilds, and journal saturation lose no candidate or retain a released generation.

Assisted-by: Codex (GPT-5.6-sol)
Bind revocable sparse batch leases to exact staging reservations. Pre-submit failures remain visible for takeover, while every accepted failure poisons both ownership domains and successful submission publishes the staging receipt before the frontier fence.

Assisted-by: Codex (GPT-5.6-sol)
Adapt the opt-in timing from upstream PR #1065 to the exact native chunks emitted by the current submission planner. Keep count and slowest duration/list count as one coherent sample in report.json; ordinary submissions read no clock.

Assisted-by: Codex (GPT-5.6-sol)
Add an inert bounded registry which separates queue request outcomes from exact asynchronous completion. Accepted guards fail closed on cancellation or panic, and stale attempts cannot publish replacement generations.

Assisted-by: Codex (GPT-5.6-sol)
Author
Owner

@⁠SlopTart on GitHub · 2026-11-26 13:01 UTC · original

Suite run on this PR from two Linux/Wine machines. Headline: the xcl lib test binary hard-crashes its test host on this branch, and it is reproducible with one single test.

The killer, one command (usual CPU-lane env: wine runner, WINEDLLOVERRIDES="d3d12,d3d12core,dxgi,d3d11,d3d10core=n,b", VKD3D_CONFIG=ignore_shared_fence, network off):

cargo test --release --locked -p xcl --lib --target x86_64-pc-windows-gnu -- --exact 'hle::d3d12x::alloc_pool::tests::released_lists_leave_only_live_recordings_and_gpu_work_holding_the_backing'

Results:

commit machine result
main b49be183 rig A, release ok, 0.00s
PR head 7d0487c4 rig A, release test host dies, wine exit status 9
PR head 7d0487c4 rig A, debug profile same abort, same spot
PR head 7d0487c4 rig B, release lib binary dies, same spot
later head today d98343d2 rig A, release still dies, exit status 9

With --nocapture the last xcl line before the host dies is its own log line D3D12.X: 2 allocator resets so far with recordings still held or on the GPU – another PC allocator took its place, then wine reports Unhandled exception code c0000409 flags 1 addr 0x1400e6e25 (xcl.exe image base 0x140000000, so offset +0xE6E25). A single-threaded full lib pass (--test-threads=1) dies on exactly this test (test 51 of the run), and the two threaded workspace runs die in the same alloc_pool neighborhood on both machines, so the whole-suite abort and this one test look like the same fault.

Consequence for the template checklist: a full cargo test --workspace run on these lanes cannot produce lib totals on this branch, roughly 1330 lib tests get no verdict. The integration binaries are fine: same 5 known Wine-red names on PR and on main (disk_free_space_ex_reports_pls_quota, offline_split_compute_pipeline_is_reused_by_a_second_process, split_compute_prefers_the_offline_whole_pipeline, set_predication_buffer_state_and_kickoff, test_title_runs_and_game_folder_is_untouched), no new integration reds on this PR.

Tested:

  • rig A: AMD Ryzen 9 9900X, 96 GB DDR5, RX 7900 XT 20 GB (Navi 31), Arch Linux, kernel 7.2.15, Mesa 26.2.5 RADV, wine-11.0 (Proton), rustc 1.94.0
  • rig B: Intel i5-10600K, 16 GB DDR4, GTX 1070 8 GB, driver 550.163.01, Debian 13, wine-10.0
  • both CPU-only lanes, --skip gpu::; workspace runs used --test-threads=2 --skip gpu::
  • note: the author is pushing fast, heads moved again since these runs (f910a402 is current), the single-test crash still reproduced on d98343d2

Not tested:

  • Windows native. One-command check: if the solo repro above also hard-fails on Windows, this is a real regression rather than a Wine interaction. The Windows lib-binary aborts in #2632 (aborts at test 1024/1564) may be this same fault, worth a cross-check of the crash signature.
  • game/perf behavior, this only covers the CPU-lane suite.

Hermes agent (local Qwen-class) ran the tests and drafted this; I checked it before posting.

**@⁠SlopTart** on GitHub · 2026-11-26 13:01 UTC · [original](https://github.com/xcl-dev/xcl/pull/2778#issuecomment-7192771774) Suite run on this PR from two Linux/Wine machines. Headline: the xcl lib test binary hard-crashes its test host on this branch, and it is reproducible with one single test. The killer, one command (usual CPU-lane env: wine runner, `WINEDLLOVERRIDES="d3d12,d3d12core,dxgi,d3d11,d3d10core=n,b"`, `VKD3D_CONFIG=ignore_shared_fence`, network off): ``` cargo test --release --locked -p xcl --lib --target x86_64-pc-windows-gnu -- --exact 'hle::d3d12x::alloc_pool::tests::released_lists_leave_only_live_recordings_and_gpu_work_holding_the_backing' ``` Results: | commit | machine | result | | --- | --- | --- | | main `b49be183` | rig A, release | ok, 0.00s | | PR head `7d0487c4` | rig A, release | test host dies, wine exit status 9 | | PR head `7d0487c4` | rig A, debug profile | same abort, same spot | | PR head `7d0487c4` | rig B, release | lib binary dies, same spot | | later head today `d98343d2` | rig A, release | still dies, exit status 9 | With `--nocapture` the last xcl line before the host dies is its own log line `D3D12.X: 2 allocator resets so far with recordings still held or on the GPU – another PC allocator took its place`, then wine reports `Unhandled exception code c0000409 flags 1 addr 0x1400e6e25` (xcl.exe image base `0x140000000`, so offset +0xE6E25). A single-threaded full lib pass (`--test-threads=1`) dies on exactly this test (test 51 of the run), and the two threaded workspace runs die in the same alloc_pool neighborhood on both machines, so the whole-suite abort and this one test look like the same fault. Consequence for the template checklist: a full `cargo test --workspace` run on these lanes cannot produce lib totals on this branch, roughly 1330 lib tests get no verdict. The integration binaries are fine: same 5 known Wine-red names on PR and on main (`disk_free_space_ex_reports_pls_quota`, `offline_split_compute_pipeline_is_reused_by_a_second_process`, `split_compute_prefers_the_offline_whole_pipeline`, `set_predication_buffer_state_and_kickoff`, `test_title_runs_and_game_folder_is_untouched`), no new integration reds on this PR. Tested: - rig A: AMD Ryzen 9 9900X, 96 GB DDR5, RX 7900 XT 20 GB (Navi 31), Arch Linux, kernel 7.2.15, Mesa 26.2.5 RADV, wine-11.0 (Proton), rustc 1.94.0 - rig B: Intel i5-10600K, 16 GB DDR4, GTX 1070 8 GB, driver 550.163.01, Debian 13, wine-10.0 - both CPU-only lanes, `--skip gpu::`; workspace runs used `--test-threads=2 --skip gpu::` - note: the author is pushing fast, heads moved again since these runs (`f910a402` is current), the single-test crash still reproduced on `d98343d2` Not tested: - Windows native. One-command check: if the solo repro above also hard-fails on Windows, this is a real regression rather than a Wine interaction. The Windows lib-binary aborts in #2632 (aborts at test 1024/1564) may be this same fault, worth a cross-check of the crash signature. - game/perf behavior, this only covers the CPU-lane suite. Hermes agent (local Qwen-class) ran the tests and drafted this; I checked it before posting.
Provide warmup, sampled timing, throughput reporting, substring filtering, batched inputs, and a fast --test smoke mode using only std. This avoids introducing a dependency graph with licences incompatible with GPL-2.0-only.

Assisted-by: Codex (GPT-5.6-sol)
Adapt the generated inputs and benchmark IDs from upstream PR #1148 to the dependency-free harness. Cover RDNA2 decode, descriptors, parsers, shader-pack scans, and PE parsing without game data.

Assisted-by: Codex (GPT-5.6-sol)
Adapt upstream PR #1152 to the dependency-free harness for shader decoding and translation, mesh-wave analysis, descriptor conversion, configuration, utility, and VFS paths. Count terminal S_ENDPGM instructions in throughput.

Assisted-by: Codex (GPT-5.6-sol)
Compose the inert eviction ledger and rehydration receipts without nested policy locks. Exact terminal receipts now map to retry, release, poison, or restored state, while foreground demand promotes one existing attempt.

Assisted-by: Codex (GPT-5.6-sol)
Bind frontier-ready receipts to exact sparse fence and title-queue generations. Reservation guards separate rollback-safe preparation from accepted waits, while unpublished acceptance remains fail-closed.

Assisted-by: Codex (GPT-5.6-sol)
Author
Owner

@⁠ettehn on GitHub · 2026-11-26 13:20 UTC · original · edited 2026-11-26 13:28 UTC

Native Windows follow-up to the Wine allocator abort, Windows 11 with Rust 1.97.1 MSVC debug, one test per process.

  • Clean main b49be183: released_lists_leave_only_live_recordings_and_gpu_work_holding_the_backing passes.
  • Clean PR head f6577375b9460228627fb284fc65a8577777da8d: that exact test terminates the test process with 0xc0000409.
  • Same PR head with a test-only fixture fix: that test passes in isolation and in the allocator group. BackingProbe::new clones the retained fence, so the mock needs a real IUnknown::AddRef slot. The slot had pointed to unexpected_call, which calls abort(). I initialized the fake fence refcount to 1 for the map-owned reference, implemented increment/decrement in its AddRef/Release slots, and asserted the count was 0 after forget(alloc). No production changes were needed for this test.

The allocator group is still red after the fixture fix. submit_reservation_keeps_pre_reset_attribution_across_queues independently fails with fence refs 4 vs expected 0, even in a fresh process. The next test, transferred_owner_is_released_once_outside_state_after_logical_forget, encounters 0xc0000005 in the group but passes on its own. I have not attributed that second failure or group abort to the missing AddRef above.

AI-assisted diagnosis and Windows verification (OpenAI Codex).

_Originally posted by @⁠ettehn in #2778

Retest on 2c5c33d4c85acf64a489204e40b8efb990bfa6e2

  • Clean head still terminates the same isolated test with 0xc0000409, matching the Wine retest.
  • With three test fixture corrections in alloc_pool.rs, the allocator group completes with 23 passed, 0 failed, 0 ignored, no reported GPU skips. In addition to the AddRef fix above, the cross-queue test advances its mock fence through value 6 before cleanup and gives the replacement allocator a valid Release slot. The resubmit test now registers its initial submission through begin_submit / finish_with_mark so it creates the list lifetime that note_resubmits checks. The group also runs through transferred_owner_is_released_once_outside_state_after_logical_forget successfully.

cargo test --locked --offline -p xcl --lib -j 2 hle::d3d12x::alloc_pool::tests:: -- --test-threads=1 --nocapture on Windows 11 build 26200, Ryzen 9 8945HX, RTX 5070 Ti Laptop (621.24), Rust 1.97.1 MSVC debug. The full suite and a retail title were not tested.

OpenAI Codex assisted with diagnosis and verification (model unavailable in this session).

**@⁠ettehn** on GitHub · 2026-11-26 13:20 UTC · [original](https://github.com/xcl-dev/xcl/pull/2778#issuecomment-7193206270) · edited 2026-11-26 13:28 UTC Native Windows follow-up to the [Wine allocator abort](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2778), Windows 11 with Rust 1.97.1 MSVC debug, one test per process. - Clean `main` `b49be183`: `released_lists_leave_only_live_recordings_and_gpu_work_holding_the_backing` passes. - Clean PR head `f6577375b9460228627fb284fc65a8577777da8d`: that exact test terminates the test process with `0xc0000409`. - Same PR head with a test-only fixture fix: that test passes in isolation and in the allocator group. `BackingProbe::new` clones the retained fence, so the mock needs a real `IUnknown::AddRef` slot. The slot had pointed to `unexpected_call`, which calls `abort()`. I initialized the fake fence refcount to 1 for the map-owned reference, implemented increment/decrement in its AddRef/Release slots, and asserted the count was 0 after `forget(alloc)`. No production changes were needed for this test. The allocator group is still red after the fixture fix. `submit_reservation_keeps_pre_reset_attribution_across_queues` independently fails with fence refs 4 vs expected 0, even in a fresh process. The next test, `transferred_owner_is_released_once_outside_state_after_logical_forget`, encounters `0xc0000005` in the group but passes on its own. I have not attributed that second failure or group abort to the missing AddRef above. AI-assisted diagnosis and Windows verification (OpenAI Codex). _Originally posted by @⁠ettehn in https://git.gtahub.st/github/xcl-dev--xcl/issues/2778 **Retest on `2c5c33d4c85acf64a489204e40b8efb990bfa6e2`** - Clean head still terminates the same isolated test with `0xc0000409`, matching the Wine retest. - With three test fixture corrections in `alloc_pool.rs`, the allocator group completes with **23 passed, 0 failed, 0 ignored, no reported GPU skips**. In addition to the AddRef fix above, the cross-queue test advances its mock fence through value 6 before cleanup and gives the replacement allocator a valid `Release` slot. The resubmit test now registers its initial submission through `begin_submit` / `finish_with_mark` so it creates the list lifetime that `note_resubmits` checks. The group also runs through `transferred_owner_is_released_once_outside_state_after_logical_forget` successfully. `cargo test --locked --offline -p xcl --lib -j 2 hle::d3d12x::alloc_pool::tests:: -- --test-threads=1 --nocapture` on Windows 11 build 26200, Ryzen 9 8945HX, RTX 5070 Ti Laptop (621.24), Rust 1.97.1 MSVC debug. The full suite and a retail title were not tested. OpenAI Codex assisted with diagnosis and verification (model unavailable in this session).
Author
Owner

@⁠SlopTart on GitHub · 2026-11-26 13:27 UTC · original

Wine-lane follow-up to my crash row above and ettehn's Windows control, at PR head 2c5c33d4 (heads keep moving, re-checked 2026-11-26):

  1. The fixture abort is still live upstream, unmerged-fix: --exact hle::d3d12x::alloc_pool::tests::released_lists_leave_only_live_recordings_and_gpu_work_holding_the_backing still hard-kills the Wine test host (exit status 9) on this head, matching ettehn's 0xc0000409 on Windows. Their BackingProbe::new AddRef diagnosis also fits our side exactly: the mock fence vtable in alloc_pool.rs is built from unexpected_call (line 1433) which is std::process::abort(), and abort() surfaces as c0000409/fast-fail. One fault, two platforms, confirmed.

  2. ettehn's remaining red reproduces on Wine too, same fixture as shipped, fresh process, no local changes:

cargo test --release --locked -p xcl --lib --target x86_64-pc-windows-gnu -- --exact 'hle::d3d12x::alloc_pool::tests::submit_reservation_keeps_pre_reset_attribution_across_queues'
panicked at crates/xcl/src/hle/d3d12x/alloc_pool.rs:2025:9:
assertion `left == right` failed
  left: 4
 right: 0

That is the same fence-ref count (4 vs expected 0) ettehn reported on native Windows. A plain assertion failure with identical numbers on Wine/Linux and Windows/MSVC points at the allocator changes in this PR, not at mocks or Wine.

  1. Control: on main b49be183 the full lib suite completes green apart from the known baseline reds, and released_lists... was verified solo at 0.00s; submit_reservation... is among the passing on main in the full run.

Setup same as the row above (rig A: Ryzen 9 9900X, RX 7900 XT, Mesa 26.2.5 RADV, wine-11.0 Proton, rustc 1.94.0; CPU lane, gpu:: skipped). Not tested: the 0xc0000005 group abort ettehn saw, group runs on our lane die earlier on the fixture abort.

Hermes agent (local Qwen-class) ran the tests and drafted this; I checked it before posting.

**@⁠SlopTart** on GitHub · 2026-11-26 13:27 UTC · [original](https://github.com/xcl-dev/xcl/pull/2778#issuecomment-7193383521) Wine-lane follow-up to my crash row above and ettehn's Windows control, at PR head `2c5c33d4` (heads keep moving, re-checked 2026-11-26): 1. The fixture abort is still live upstream, unmerged-fix: `--exact hle::d3d12x::alloc_pool::tests::released_lists_leave_only_live_recordings_and_gpu_work_holding_the_backing` still hard-kills the Wine test host (exit status 9) on this head, matching ettehn's `0xc0000409` on Windows. Their `BackingProbe::new` AddRef diagnosis also fits our side exactly: the mock fence vtable in `alloc_pool.rs` is built from `unexpected_call` (line 1433) which is `std::process::abort()`, and `abort()` surfaces as `c0000409`/fast-fail. One fault, two platforms, confirmed. 2. ettehn's remaining red reproduces on Wine too, same fixture as shipped, fresh process, no local changes: ``` cargo test --release --locked -p xcl --lib --target x86_64-pc-windows-gnu -- --exact 'hle::d3d12x::alloc_pool::tests::submit_reservation_keeps_pre_reset_attribution_across_queues' ``` ``` panicked at crates/xcl/src/hle/d3d12x/alloc_pool.rs:2025:9: assertion `left == right` failed left: 4 right: 0 ``` That is the same fence-ref count (4 vs expected 0) ettehn reported on native Windows. A plain assertion failure with identical numbers on Wine/Linux and Windows/MSVC points at the allocator changes in this PR, not at mocks or Wine. 3. Control: on main `b49be183` the full lib suite completes green apart from the known baseline reds, and `released_lists...` was verified solo at 0.00s; `submit_reservation...` is among the passing on main in the full run. Setup same as the row above (rig A: Ryzen 9 9900X, RX 7900 XT, Mesa 26.2.5 RADV, wine-11.0 Proton, rustc 1.94.0; CPU lane, `gpu::` skipped). Not tested: the `0xc0000005` group abort ettehn saw, group runs on our lane die earlier on the fixture abort. Hermes agent (local Qwen-class) ran the tests and drafted this; I checked it before posting.
The coordinated batch transaction now owns acceptance, poisoning, and publication semantics. Preserve unwind, callback-order, and staging-ownership coverage on that implementation before removing the duplicate test-only protocol.

Assisted-by: Codex (GPT-5.6-sol)
The coordinated upload plan uses the shared page construction and validation primitives directly. Preserve intent, range, incomplete-build, and identity-validation coverage on those paths before removing the older claim-owning plan.

Assisted-by: Codex (GPT-5.6-sol)
SparseBatches now owns the guarded claim lifecycle used by coordinated uploads. Preserve ordering, reason merging, exact restoration, and stale-producer coverage on the shared ledger and batch model before removing the older guards.

Assisted-by: Codex (GPT-5.6-sol)
Keep one exact queue handle per restoration attempt so foreground demand can promote existing speculative work without compiling on the caller. Transfer an opaque recipe-bound published generation through the exact ticket, and report queue and build terminal states without substituting another attempt.

The private coordinator remains default-off and unwired.

Assisted-by: Codex (GPT-5.6-sol)
Exercise foreground promotion, coalescing, queue refusal and cancellation, build failure, worker panic, release, and exact attempt-token replacement. Deterministically evict after publication capture and verify the ticket keeps the recipe-bound generation, while final COM destruction occurs outside the coordinator lock.

Assisted-by: Codex (GPT-5.6-sol)
Publish an armed eviction token on its exact Build before a future policy may detach native owners. An uncommitted guard clears only its own token and poisons its ledger record, leaving resolver and policy wiring for a later stage.

Assisted-by: Codex (GPT-5.6-sol)
Exercise pre-detach visibility, rollback after failed generation revalidation, and stale-token clearing after bounded ledger slot reuse.

Assisted-by: Codex (GPT-5.6-sol)
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2778/head:github-bot/gh-2778'
git switch 'github-bot/gh-2778'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2778'
git switch 'github-bot/gh-2778'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2778'
git switch 'github-bot/gh-2778'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2778'
git switch 'main'
git merge --squash 'github-bot/gh-2778'
git switch 'main'
git merge --ff-only 'github-bot/gh-2778'
git switch 'main'
git merge 'github-bot/gh-2778'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.