Plan for extracting focused PRs from #2778 #2787

Open
opened 2026-11-26 12:40:17 +00:00 by github-bot · 2 comments
Owner

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

Take the correctness fixes and self-contained improvements from #2778. Extract the larger runtime changes only where they solve a demonstrated problem. Leave the unfinished eviction and sparse planning systems on the branch.

This is a breakdown of #2778 at a4f0399f19e4 against main at b49be1836844 (371 commits, 70 files). The commit IDs identify the changes to extract. Each row proposes one PR unless it gives an explicit sequence. Rebase the behavior and its tests onto current main, preserving attribution. The overlap notes at the end are for avoiding duplicate submissions.

The commit-by-commit plan below gives the pick order and prerequisites, starting with the three slices requested on #2778.

Worth pulling first

Proposed PR Change from #2778 and what the PR should demonstrate
Signal DirectStorage events in request order 3fd55dff. Implement the X1 event marker through the existing retirement path. Test sequential and parallel retirement and caller handle closure. This addresses a title wait that otherwise has no completion event.
Order a list wait after its deferred CPU write 311fc618 with the minimum write-producer tracking from 62de4d55 / b3d9441e. Prove a preceding CPU store becomes visible before the waiting continuation and independent stores stay asynchronous. Add immutable submission-effect capture (1b0b589c) only to the extent the fix needs it.
Keep failed native lists out of Execute Start with the put-off segment Close fix (3364f184). Follow with separate split-continuation reservation and Kickoff Close/Reset recovery PRs (d5aa0a6a, 617b493d, 03e4d27d, 73898793, 974e3395). Use fault injection to show the prior valid recording survives and the failed segment never executes.
Retire object bookkeeping at the right lifetime boundary Separate PRs for command-list and heap address reuse (2d8b8295, fb810988). For allocators, first reserve the recorded backing before native Execute (06d03e60), then retain it and its UMA through the correct retirement/reset (93693054, 9ec2b4a3). Cover creation on a rotated backing (3d0d0558) where that path needs a follow-up. Exercise address reuse, outstanding work, and Reset/Release.
Recover sparse uploads without losing work Three PRs in order. Bound ring waits and refuse unsafe reuse (faea307a, 37271a3c). Publish sent hashes only after a successful queue signal (41a369ee). Preserve and retry the dirty snapshot and stop submission when ordering remains unknown (3cd053e4). Test Close/Wait/Signal failure, including partial batches. Separately take 054270ca to preserve newer CPU writes during sparse copyback.
Fix the selected PSO and complete worker failures Take the ExecuteIndirect stand-in classification fix (4e62e7c8)) and failed-job completion (0eaef7e6)) as separate PRs. Cover completion during bind and cancellation/failure waking waiters. Take cold builds off bind threads (aff341e1) separately, with early wanted promotion (11cf89f9) and bounded-wait segmentation (76e87252) split out by behavior.
Fix DispatchX thread dimensions Split ba659963 into whole-group conversion and tail-lane masking with deferred replay. Test non-multiples of the group size, multidimensional IDs, and overflow. Both behaviors are needed for partial-group parity.
Preserve pipeline stream state One PR for compute FLAGS (2bfc36eb), another for graphics projection/cache safety (32ecdb27), then faithful extended rasterizer state (e3a52f43). Keep native-stream caching (9e82e2aa, 6457c188) separate until identity and rejected-blob fallback are tested.
Fix linked DXC error handling and argument forwarding Split b271eba5 into retryable OOM and forwarding optimization/extra arguments. Test that OOM leaves linking enabled and that arguments reach the live linker. Review slot admission (2e45718b) separately with concurrent callers.
Fix cache identity before expanding persistence Separate stale-generation invalidation (fba7de2b)), static-sampler identity (be772deb), and node/device and graphics identities (e5d2e5ee, 4cd1b772, 5afb11ad, 14524632). Test stale rejection after replacement and differing roots/node masks. Extract graphics precompile parity (5d91261c`) as its own PR with a cold-cache runtime hit test.
Fix descriptor bounds and sparse object ownership Take descriptor bounds (b0deef15)) separately from lock elision. Take generation-checked sparse placed-buffer publication (7619ff8c)) separately. Test stale state and COM address reuse.
Land small, independently measurable improvements One PR each for unsplit shader-cache buffer reuse (355826c5), single-copy DXIL containers (3cf3451c), loader range rejection (b59e59b6), zero-mip staging reuse (396a4144), streaming shader effects plus its far-jump cap (e67817e4, 911ad65d), contiguous 2D tiling runs (b81ac2eb), and BCPack bit packing (9fdfe6c9). Require byte/output parity and measure the operation being improved. For Opus, split scratch reuse and validation (5a5b6504)) from PCM copying and output preallocation (87c5c52c, 2a577d7d). For frame pacing (75c4a245`), split writable-target validation from removing wait allocations.

Worth extracting as stacks, with a measured reason to activate them

  1. GPU-ordered texture uploads. Port the submitting-queue path and its page-mapping wait together (d8ddd5b5, e12049fe). The commit reports 3 hangs in 4 RTX 3080 world-load runs before the wait and 0 in 7 with it. Those runs support the dependency and need repeating on the extracted PR. Preserve staging ownership after a failed wait (0ea9a959) and per-queue ordering (23d7f4e8) in the activation or its prerequisites. Omit the reverted intermediate upload implementation (01c0835a and its revert).
  2. GPU-written texture copyback. First take owned queue snapshots and exact retirement as separate prerequisites (d93c63a7, c52ad726, 0540a23c, 9374675e, 12b1b786). If needed, land native queue-slot dispatch and submission ordering independently (89343644, e10df30d, 87b55ac8). Then split copyback into reverse layout conversion (b7af0096), generation/subresource writer and transition tracking (972f66ec, 24ffb0e7, b0442a22), writer-queue staging and lifetime (e564cbb7, fafeee3e), and publication before the title observes fence completion (4cc28d40, 547f3211). Activate with a title-path regression covering partial subresources, two queues, and failed waits.
  3. PSO build coalescing and priorities. First separate stand-in ownership from build lifetime (6f6b5a27), then define and test canonical identity (0fef9d5a, 67629ad4, fedfbe4c), then enable in-process coalescing (b946815d). Measure duplicate builds and first-use wait time. Review priority queue activation (e7c522d8, 2ccea5e1), bounded compile helpers, and prior-use preload ranking (56cffc2b) independently. Keep off-bind used-key journaling (7ea65ea9, 77eb9e7f) separate and test shutdown and ordering.
  4. Split ExecuteIndirect. Split indirect root ABI and execution (202c9623, ffac3219, 2a6a8ba2), per-recording command storage reuse (aa446c29), and used-only prewarming (c162ffb1, 6495067f). Compare direct/indirect output, first-use wait, and GPU time per piece. Review whole-build failure memoization (deb5fccf) separately with transient OOM recovery.
  5. Shader lowering. Each DXIL change needs its own parity tests and emitted-size or compile-time evidence. Start with carries, min/max, bit masks and signed FFBH, frexp/alignbit, and liveness pruning (3e417232, 2f608f80, 4db26aec, b077218f, 7273e250). Keep branchless heap guards (0aa15353) apart from split-wave64 remapping (e0416843). Take the flat/guarded GPU parity test (ab323147) where it adds coverage beyond main. Treat CFG allocation, EXEC folding and split-piece binding pruning as separate candidates.
  6. Measurement tools. First extract the isolated cold/warm runner and workload manifest (5bdaa54e, dfcd4bbb)), then the comparator (fd237b1b). Keep fixtures with their scripts and describe cold/warm as XCL cache states since driver caches are uncontrolled. Add coarse stall tracing (dab895e5, e0635a1c)) separately. Wait64 recording history and memory by owner have concrete diagnostic uses and can each stand alone. Add detailed hooks only for a specific investigation.

Leave out of the initial merge series

  • Disconnected sparse planner models (c8889e88, b5f7fc0e, 3116f06f, 4e0b3555, 7d0487c4). They model claims, plans, reservations, commit and receipt ordering without driving live uploads. The live failure fixes above have a direct testable outcome. The newer b628cfb4 refactors the live synchronous path by bundling the slot, rollback point and pending hashes. Consider it separately after correctness lands, if it makes a concrete follow-up smaller.
  • Pipeline eviction/rehydration and descriptor/mip residency groundwork (08662496, 729dac6f, c77b4849, c58bf39a, 96950cbb, fa2167b2, bf0db1ad, 025dc2fa, 0bd24ca7, cf4c3ebc, 70a58f43). The branch adds opt-in tracking and ownership machinery while leaving pressure-driven eviction and descriptor mutation uncalled. Revisit with a workload that demonstrates reclaimed memory, safe in-flight lifetimes, and bounded reload cost.
  • Broad performance and policy changes without isolated evidence on current main. This includes cross-process PSO claims (4893eb6c), AMD persistence defaults and compile lanes (80bb4516, 16e58563), slow-blob persistence past the RAM cap (4ca5c6fe), write-watch gap tuning, pending lookup sharding, allocator spare pooling, wider fence-lock changes, persistent detile workers, and the XAudio2 atomic dispatch table. Measure them independently if the corresponding bottleneck remains. Keep the first-fault instruction rewrite (bf157ece) outside this series.
  • Already covered on main. Drop portions of flat root-UAV lowering and offline PSO reuse already covered by #2368 and #2371. Keep only the delta that adds behavior or coverage.

Overlap to check when assigning the extracted changes includes #2569 (DirectStorage events), #2585 (linked DXC), #2610 (DispatchX group conversion), #2621 (graphics stream state), #2622 (deferred Close), #2633 (indirect CBV), #2691 (list Release), and #2702 (BCPack). Fold equivalent work into its focused PR and submit only a distinct follow-up where needed.

Target roughly 400 changed lines per PR and use Stacked on #N for actual dependencies. Runtime PRs need a focused regression, full Windows suite counts with GPU skips, and same-title/same-duration smoke blocks for clean main and the exact PR head. This review was static. Windows/MSVC, GPU, and retail smoke tests were unavailable.

Commit-by-commit extraction plan

The three slices requested in the #2778 handoff comment come first. The remaining rows are a backlog, subject to author coordination and the evidence gates below. Arrows give the order of commits within a PR. A dependency on another PR means stack on it or wait for it to land. Each new branch starts from current main or the named prerequisite.

Patch applicability was checked against b49be1836844 with three-way Git application in a temporary index. That checks conflicts only. Pick means the listed source changes are the intended inputs to git cherry-pick -x. Port means adapt the named hunks to the current implementation, preserving source SHAs and attribution. A whole commit that applies can still need code or test changes after review. Use individual source commits, leaving the umbrella merge commits behind.

1. Sparse upload recovery

PR Ordered sources and boundaries Review evidence
S1. Stop timed-out uploads from reusing live staging Port faea307a → 37271a3c. Coordinate the ring timeout and its test with #1277. If that timeout lands first, reuse it and extract only the unsubmitted-range handling plus the allocator/readback guards. Keep the scope to bounded waits, Reset/Close failure, and withholding CPU readback on incomplete copies. Inject a stalled fence and failed Reset/Close. Verify no allocator/staging reuse, no readback publication, and that the unsent suffix remains dirty.
S2. Publish sparse hashes after the upload signal Port 41a369ee on S1. In sparse.rs, make scanning plan dirty ranges without publishing sent hashes. Record proposed hashes per staging batch, apply only after the queue signal succeeds, and retain GPU-owned staging when Execute may have happened without a usable marker. The original commit conflicts with main
carry the small submission-outcome plumbing this invariant needs.
Verify that a signalled prefix stays published, an unsubmitted suffix stays dirty, and a CPU write during planning is still seen on the next scan. Inject signal failure after Execute.
S3. Keep dirty pages until title submission is safe Port 3cd053e4 on S2. Limit runtime changes to the write-watch retry journal, rollback of a failed title-queue wait reservation, and the shared preparation checks at Execute and Kickoff. Keep the newer synchronous refactor b628cfb4 out of S1–S3. Verify a retry uses the same dirty snapshot, a failed wait rolls back only its own reservation, and terminal preparation failure prevents native Execute on both entry points.

2. Deferred CPU write ordering

The five commits below applied in source order as a stack. The original ordering fix alone conflicted with main. Divide the stack this way so the behavior change has one reviewable boundary.

PR Commit order Review evidence
W1. Track exact list write ranges Pick 62de4d55. Check adjacent and overlapping ranges, Reset, and coverage at the end of a write.
W2. Capture immutable list effects for submission Pick 1b0b589c on W1. Preserve wait, signal, sparse-write and deferred-store effects across split submission and list reuse.
W3. Name and reuse list split reasons Pick 4d17a73b on W2. Exercise the existing Wait64 and deferred-dispatch paths with their current recording and binding behavior.
W4. Classify the producer of each recorded write Pick b3d9441e on W3. Show that GPU writes, post-segment CPU stores and Write64 cases retain their distinct ordering, with the existing wait policy.
W5. Wait for the exact deferred CPU store Pick 311fc618 on W4. This is the behavior change. Keep 9b847915 as an optional measured follow-up for avoiding repeated scans of earlier segments. Cover Wait32/64, a matching producer in an earlier segment, an unrelated CPU write, and failed split creation. Test ordinary Execute and Kickoff.

3. Contiguous 2D tiling

T1. Pick b81ac2eb alone. It applied to main as a one-file change in gpu/tiling.rs (383 changed lines in the source commit). Retain the tiled and detiled comparisons against the element-by-element path, including base XOR, block formats and mip edges. Report byte parity and a before/after timing on the same texture workload. Keep persistent workers (6dd9d53f) out so the measurement isolates the copy strategy.

Other extraction candidates

Each line in the table proposes a separate PR unless an explicit sequence is given. Where a source commit mixes scopes, extract the named hunks and retain its SHA in the new commit message.

Area Candidate PRs and source commits
Independent compatibility and lifetime fixes Ordered DirectStorage event pick 3fd55dff (overlap #2569)
command-list Release pick 2d8b8295 (#2691)
heap Release port fb810988
descriptor publication bounds pick b0deef15 (#2631)
sparse placement lifetime port 7619ff8c (#2539).
Failed segment handling Deferred Close port 3364f184 (#2622)
reserve a continuation before closing port d5aa0a6a and only the related split recovery from 617b493d / 03e4d27d
Kickoff Close port 73898793
Kickoff Reset port 974e3395. Share W3 where it is needed.
Allocator ownership Submit reservation port cf40395a → 06d03e60 as one change, keeping only their final reservation path
hold busy backing across final Release port 93693054
make list creation use the active backing port 3d0d0558
pin UMA to native backing until retirement port 9ec2b4a3 after backing ownership is in place.
Cold PSOs and indirect binds Correct selected stand-in port 4e62e7c8
finish failed worker jobs port 0eaef7e6)<br>keep cold compiles off bind threads **port** aff341e1<br>record wanted state at deferred record time **port** 11cf89f9<br>avoid put-off segments for bounded waits **port** 76e87252`.
Stream state and compiler fixes Compute FLAGS pick 2bfc36eb
conservative graphics projection port 32ecdb27
extended rasterizer state port e3a52f43 after projection
native cache lifecycle port 9e82e2aa → 6457c188 after stream support. From b271eba5, extract DXC OOM handling and linker arguments as two PRs
serialized DXC admission pick 2e45718b independently. From ba659963, extract group-count conversion first and tail-lane masking/deferred replay second.
Cache correctness Exact stale generation port fba7de2b
static samplers port be772deb
NodeMask runtime and disk identity port e5d2e5ee → 4cd1b772 → 5afb11ad
graphics cache identity port 14524632
graphics CLI/runtime variant parity pick 5d91261c.
Small independent performance PRs Unsplit cache buffer reuse port 355826c5
DXIL container copy pick 3cf3451c
loader range filter pick b59e59b6
zero-mip staging port 396a4144
effects analysis pick e67817e4 → 911ad65d together
BCPack pick 9fdfe6c9
Opus scratch and validation pick 5a5b6504), then PCM bulk copy and preallocation **pick** 87c5c52c→2a577d7dafter scratch. Split writability checks from allocations in75c4a245`.
GPU texture uploads and copyback Port d8ddd5b5 → e12049fe together for upload ordering, with staging and queue lifetime prerequisites where needed (0ea9a959, 23d7f4e8). For copyback: owned queue snapshots d93c63a7
retirement model then activation c52ad726 followed by 0540a23c → 9374675e, with sparse consumers 12b1b786 following separately
native slots 89343644 → e10df30d and queue ordering 87b55ac8 as distinct prerequisites where needed
reverse conversion pick b7af0096
writer metadata port 972f66ec → 24ffb0e7 → b0442a22
staging plans port e564cbb7 → fafeee3e
activate fence-visible publication port 4cc28d40 → 547f3211. Split writer metadata into bookkeeping and publication if it exceeds the size target.
PSO performance Build ownership 6f6b5a27
canonical key 0fef9d5a → 67629ad4 → fedfbe4c
coalescing b946815d
queue foundation e7c522d8 and activation 2ccea5e1) as separate PRs<br>rank preloads 56cffc2b<br>journal used keys 7ea65ea9→77eb9e7f. Split indirect CBV ABI 202c9623→ffac3219from activation2a6a8ba2)
command-buffer reuse aa446c29
observed-use prewarm c162ffb1 → 6495067f. Treat these as ports on the minimum landed prerequisites.
Shader lowering and diagnostics One candidate PR per lowering change and its tests, in the order needed by that module. Keep 0aa15353 (guards) and e0416843 (wave remap) separate. For tooling, runner pick 5bdaa54e then port the runner/fixture parts of dfcd4bbb with it
comparator port fd237b1b plus comparator/fixture parts of dfcd4bbb after the runner. Defer the later counters until their producers land. Stall report foundation dab895e5 → e0635a1c is separate from hook sets.

The refreshed source head also adds 54039442 and a4f0399f. Leave both out of these PRs. They extend the sparse claim ledger and the inert pipeline eviction ledger, respectively.

After each extraction, review the diff against its base and retain only the named behavior, its regression, and any required README update. Link the source commits and this issue, preserve original author and co-author credit, and note any adaptation in the PR. Run the Windows/GPU suite and paired smoke checks described above before marking a runtime PR ready. No Windows, GPU or retail runs were performed for this plan.

AI use — Codex (GPT-6) inspected the diff, commit history and related PRs and drafted this issue.

**@⁠KOLESNiii** on GitHub · 2026-11-26 12:35 UTC · [original](https://github.com/xcl-dev/xcl/issues/2787) Take the correctness fixes and self-contained improvements from #2778. Extract the larger runtime changes only where they solve a demonstrated problem. Leave the unfinished eviction and sparse planning systems on the branch. This is a breakdown of #2778 at `a4f0399f19e4` against `main` at `b49be1836844` (371 commits, 70 files). The commit IDs identify the changes to extract. Each row proposes one PR unless it gives an explicit sequence. Rebase the behavior and its tests onto current `main`, preserving attribution. The overlap notes at the end are for avoiding duplicate submissions. The [commit-by-commit plan](#commit-by-commit-extraction-plan) below gives the pick order and prerequisites, starting with the three slices requested on #2778. ## Worth pulling first | Proposed PR | Change from #2778 and what the PR should demonstrate | | --- | --- | | **Signal DirectStorage events in request order** | `3fd55dff`. Implement the X1 event marker through the existing retirement path. Test sequential and parallel retirement and caller handle closure. This addresses a title wait that otherwise has no completion event. | | **Order a list wait after its deferred CPU write** | `311fc618` with the minimum write-producer tracking from `62de4d55` / `b3d9441e`. Prove a preceding CPU store becomes visible before the waiting continuation and independent stores stay asynchronous. Add immutable submission-effect capture (`1b0b589c`) only to the extent the fix needs it. | | **Keep failed native lists out of Execute** | Start with the put-off segment Close fix (`3364f184`). Follow with separate split-continuation reservation and Kickoff Close/Reset recovery PRs (`d5aa0a6a`, `617b493d`, `03e4d27d`, `73898793`, `974e3395`). Use fault injection to show the prior valid recording survives and the failed segment never executes. | | **Retire object bookkeeping at the right lifetime boundary** | Separate PRs for command-list and heap address reuse (`2d8b8295`, `fb810988`). For allocators, first reserve the recorded backing before native Execute (`06d03e60`), then retain it and its UMA through the correct retirement/reset (`93693054`, `9ec2b4a3`). Cover creation on a rotated backing (`3d0d0558`) where that path needs a follow-up. Exercise address reuse, outstanding work, and Reset/Release. | | **Recover sparse uploads without losing work** | Three PRs in order. Bound ring waits and refuse unsafe reuse (`faea307a`, `37271a3c`). Publish sent hashes only after a successful queue signal (`41a369ee`). Preserve and retry the dirty snapshot and stop submission when ordering remains unknown (`3cd053e4`). Test Close/Wait/Signal failure, including partial batches. Separately take `054270ca` to preserve newer CPU writes during sparse copyback. | | **Fix the selected PSO and complete worker failures** | Take the ExecuteIndirect stand-in classification fix (`4e62e7c8)) and failed-job completion (`0eaef7e6)) as separate PRs. Cover completion during bind and cancellation/failure waking waiters. Take cold builds off bind threads (`aff341e1`) separately, with early wanted promotion (`11cf89f9`) and bounded-wait segmentation (`76e87252`) split out by behavior. | | **Fix DispatchX thread dimensions** | Split `ba659963` into whole-group conversion and tail-lane masking with deferred replay. Test non-multiples of the group size, multidimensional IDs, and overflow. Both behaviors are needed for partial-group parity. | | **Preserve pipeline stream state** | One PR for compute FLAGS (`2bfc36eb`), another for graphics projection/cache safety (`32ecdb27`), then faithful extended rasterizer state (`e3a52f43`). Keep native-stream caching (`9e82e2aa`, `6457c188`) separate until identity and rejected-blob fallback are tested. | | **Fix linked DXC error handling and argument forwarding** | Split `b271eba5` into retryable OOM and forwarding optimization/extra arguments. Test that OOM leaves linking enabled and that arguments reach the live linker. Review slot admission (`2e45718b`) separately with concurrent callers. | | **Fix cache identity before expanding persistence** | Separate stale-generation invalidation (`fba7de2b)), static-sampler identity (`be772deb`), and node/device and graphics identities (`e5d2e5ee`, `4cd1b772`, `5afb11ad`, `14524632`). Test stale rejection after replacement and differing roots/node masks. Extract graphics precompile parity (`5d91261c`) as its own PR with a cold-cache runtime hit test. | | **Fix descriptor bounds and sparse object ownership** | Take descriptor bounds (`b0deef15)) separately from lock elision. Take generation-checked sparse placed-buffer publication (`7619ff8c)) separately. Test stale state and COM address reuse. | | **Land small, independently measurable improvements** | One PR each for unsplit shader-cache buffer reuse (`355826c5`), single-copy DXIL containers (`3cf3451c`), loader range rejection (`b59e59b6`), zero-mip staging reuse (`396a4144`), streaming shader effects plus its far-jump cap (`e67817e4`, `911ad65d`), contiguous 2D tiling runs (`b81ac2eb`), and BCPack bit packing (`9fdfe6c9`). Require byte/output parity and measure the operation being improved. For Opus, split scratch reuse and validation (`5a5b6504)) from PCM copying and output preallocation (`87c5c52c`, `2a577d7d`). For frame pacing (`75c4a245`), split writable-target validation from removing wait allocations. | ## Worth extracting as stacks, with a measured reason to activate them 1. **GPU-ordered texture uploads.** Port the submitting-queue path and its page-mapping wait together (`d8ddd5b5`, `e12049fe`). The commit reports 3 hangs in 4 RTX 3080 world-load runs before the wait and 0 in 7 with it. Those runs support the dependency and need repeating on the extracted PR. Preserve staging ownership after a failed wait (`0ea9a959`) and per-queue ordering (`23d7f4e8`) in the activation or its prerequisites. Omit the reverted intermediate upload implementation (`01c0835a` and its revert). 2. **GPU-written texture copyback.** First take owned queue snapshots and exact retirement as separate prerequisites (`d93c63a7`, `c52ad726`, `0540a23c`, `9374675e`, `12b1b786`). If needed, land native queue-slot dispatch and submission ordering independently (`89343644`, `e10df30d`, `87b55ac8`). Then split copyback into **reverse layout conversion** (`b7af0096`), **generation/subresource writer and transition tracking** (`972f66ec`, `24ffb0e7`, `b0442a22`), **writer-queue staging and lifetime** (`e564cbb7`, `fafeee3e`), and **publication before the title observes fence completion** (`4cc28d40`, `547f3211`). Activate with a title-path regression covering partial subresources, two queues, and failed waits. 3. **PSO build coalescing and priorities.** First separate stand-in ownership from build lifetime (`6f6b5a27`), then define and test canonical identity (`0fef9d5a`, `67629ad4`, `fedfbe4c`), then enable in-process coalescing (`b946815d`). Measure duplicate builds and first-use wait time. Review priority queue activation (`e7c522d8`, `2ccea5e1`), bounded compile helpers, and prior-use preload ranking (`56cffc2b`) independently. Keep off-bind used-key journaling (`7ea65ea9`, `77eb9e7f`) separate and test shutdown and ordering. 4. **Split ExecuteIndirect.** Split **indirect root ABI and execution** (`202c9623`, `ffac3219`, `2a6a8ba2`), **per-recording command storage reuse** (`aa446c29`), and **used-only prewarming** (`c162ffb1`, `6495067f`). Compare direct/indirect output, first-use wait, and GPU time per piece. Review whole-build failure memoization (`deb5fccf`) separately with transient OOM recovery. 5. **Shader lowering.** Each DXIL change needs its own parity tests and emitted-size or compile-time evidence. Start with carries, min/max, bit masks and signed FFBH, frexp/alignbit, and liveness pruning (`3e417232`, `2f608f80`, `4db26aec`, `b077218f`, `7273e250`). Keep branchless heap guards (`0aa15353`) apart from split-wave64 remapping (`e0416843`). Take the flat/guarded GPU parity test (`ab323147`) where it adds coverage beyond `main`. Treat CFG allocation, EXEC folding and split-piece binding pruning as separate candidates. 6. **Measurement tools.** First extract the isolated cold/warm runner and workload manifest (`5bdaa54e`, `dfcd4bbb)), then the comparator (`fd237b1b`). Keep fixtures with their scripts and describe cold/warm as XCL cache states since driver caches are uncontrolled. Add coarse stall tracing (`dab895e5`, `e0635a1c)) separately. Wait64 recording history and memory by owner have concrete diagnostic uses and can each stand alone. Add detailed hooks only for a specific investigation. ## Leave out of the initial merge series - **Disconnected sparse planner models** (`c8889e88`, `b5f7fc0e`, `3116f06f`, `4e0b3555`, `7d0487c4`). They model claims, plans, reservations, commit and receipt ordering without driving live uploads. The live failure fixes above have a direct testable outcome. The newer `b628cfb4` refactors the live synchronous path by bundling the slot, rollback point and pending hashes. Consider it separately after correctness lands, if it makes a concrete follow-up smaller. - **Pipeline eviction/rehydration and descriptor/mip residency groundwork** (`08662496`, `729dac6f`, `c77b4849`, `c58bf39a`, `96950cbb`, `fa2167b2`, `bf0db1ad`, `025dc2fa`, `0bd24ca7`, `cf4c3ebc`, `70a58f43`). The branch adds opt-in tracking and ownership machinery while leaving pressure-driven eviction and descriptor mutation uncalled. Revisit with a workload that demonstrates reclaimed memory, safe in-flight lifetimes, and bounded reload cost. - **Broad performance and policy changes without isolated evidence on current main.** This includes cross-process PSO claims (`4893eb6c`), AMD persistence defaults and compile lanes (`80bb4516`, `16e58563`), slow-blob persistence past the RAM cap (`4ca5c6fe`), write-watch gap tuning, pending lookup sharding, allocator spare pooling, wider fence-lock changes, persistent detile workers, and the XAudio2 atomic dispatch table. Measure them independently if the corresponding bottleneck remains. Keep the first-fault instruction rewrite (`bf157ece`) outside this series. - **Already covered on main.** Drop portions of flat root-UAV lowering and offline PSO reuse already covered by #2368 and #2371. Keep only the delta that adds behavior or coverage. Overlap to check when assigning the extracted changes includes #2569 (DirectStorage events), #2585 (linked DXC), #2610 (DispatchX group conversion), #2621 (graphics stream state), #2622 (deferred Close), #2633 (indirect CBV), #2691 (list Release), and #2702 (BCPack). Fold equivalent work into its focused PR and submit only a distinct follow-up where needed. Target roughly 400 changed lines per PR and use `Stacked on #N` for actual dependencies. Runtime PRs need a focused regression, full Windows suite counts with GPU skips, and same-title/same-duration smoke blocks for clean `main` and the exact PR head. This review was static. Windows/MSVC, GPU, and retail smoke tests were unavailable. ## Commit-by-commit extraction plan The three slices requested in the [#2778 handoff comment](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2778) come first. The remaining rows are a backlog, subject to author coordination and the evidence gates below. Arrows give the order of commits within a PR. A dependency on another PR means stack on it or wait for it to land. Each new branch starts from current `main` or the named prerequisite. Patch applicability was checked against `b49be1836844` with three-way Git application in a temporary index. That checks conflicts only. **Pick** means the listed source changes are the intended inputs to `git cherry-pick -x`. **Port** means adapt the named hunks to the current implementation, preserving source SHAs and attribution. A whole commit that applies can still need code or test changes after review. Use individual source commits, leaving the umbrella merge commits behind. ### 1. Sparse upload recovery | PR | Ordered sources and boundaries | Review evidence | | --- | --- | --- | | **S1. Stop timed-out uploads from reusing live staging** | **Port** `faea307a` → `37271a3c`. Coordinate the ring timeout and its test with #1277. If that timeout lands first, reuse it and extract only the unsubmitted-range handling plus the allocator/readback guards. Keep the scope to bounded waits, Reset/Close failure, and withholding CPU readback on incomplete copies. | Inject a stalled fence and failed Reset/Close. Verify no allocator/staging reuse, no readback publication, and that the unsent suffix remains dirty. | | **S2. Publish sparse hashes after the upload signal** | **Port** `41a369ee` on S1. In `sparse.rs`, make scanning plan dirty ranges without publishing sent hashes. Record proposed hashes per staging batch, apply only after the queue signal succeeds, and retain GPU-owned staging when Execute may have happened without a usable marker. The original commit conflicts with main<br>carry the small submission-outcome plumbing this invariant needs. | Verify that a signalled prefix stays published, an unsubmitted suffix stays dirty, and a CPU write during planning is still seen on the next scan. Inject signal failure after Execute. | | **S3. Keep dirty pages until title submission is safe** | **Port** `3cd053e4` on S2. Limit runtime changes to the write-watch retry journal, rollback of a failed title-queue wait reservation, and the shared preparation checks at Execute and Kickoff. Keep the newer synchronous refactor `b628cfb4` out of S1–S3. | Verify a retry uses the same dirty snapshot, a failed wait rolls back only its own reservation, and terminal preparation failure prevents native Execute on both entry points. | ### 2. Deferred CPU write ordering The five commits below applied in source order as a stack. The original ordering fix alone conflicted with main. Divide the stack this way so the behavior change has one reviewable boundary. | PR | Commit order | Review evidence | | --- | --- | --- | | **W1. Track exact list write ranges** | **Pick** `62de4d55`. | Check adjacent and overlapping ranges, Reset, and coverage at the end of a write. | | **W2. Capture immutable list effects for submission** | **Pick** `1b0b589c` on W1. | Preserve wait, signal, sparse-write and deferred-store effects across split submission and list reuse. | | **W3. Name and reuse list split reasons** | **Pick** `4d17a73b` on W2. | Exercise the existing Wait64 and deferred-dispatch paths with their current recording and binding behavior. | | **W4. Classify the producer of each recorded write** | **Pick** `b3d9441e` on W3. | Show that GPU writes, post-segment CPU stores and Write64 cases retain their distinct ordering, with the existing wait policy. | | **W5. Wait for the exact deferred CPU store** | **Pick** `311fc618` on W4. This is the behavior change. Keep `9b847915` as an optional measured follow-up for avoiding repeated scans of earlier segments. | Cover Wait32/64, a matching producer in an earlier segment, an unrelated CPU write, and failed split creation. Test ordinary Execute and Kickoff. | ### 3. Contiguous 2D tiling **T1. Pick `b81ac2eb` alone.** It applied to main as a one-file change in `gpu/tiling.rs` (383 changed lines in the source commit). Retain the tiled and detiled comparisons against the element-by-element path, including base XOR, block formats and mip edges. Report byte parity and a before/after timing on the same texture workload. Keep persistent workers (`6dd9d53f`) out so the measurement isolates the copy strategy. ### Other extraction candidates Each line in the table proposes a separate PR unless an explicit sequence is given. Where a source commit mixes scopes, extract the named hunks and retain its SHA in the new commit message. | Area | Candidate PRs and source commits | | --- | --- | | **Independent compatibility and lifetime fixes** | Ordered DirectStorage event **pick** `3fd55dff` (overlap #2569)<br>command-list Release **pick** `2d8b8295` (#2691)<br>heap Release **port** `fb810988`<br>descriptor publication bounds **pick** `b0deef15` (#2631)<br>sparse placement lifetime **port** `7619ff8c` (#2539). | | **Failed segment handling** | Deferred Close **port** `3364f184` (#2622)<br>reserve a continuation before closing **port** `d5aa0a6a` and only the related split recovery from `617b493d` / `03e4d27d`<br>Kickoff Close **port** `73898793`<br>Kickoff Reset **port** `974e3395`. Share W3 where it is needed. | | **Allocator ownership** | Submit reservation **port** `cf40395a` → `06d03e60` as one change, keeping only their final reservation path<br>hold busy backing across final Release **port** `93693054`<br>make list creation use the active backing **port** `3d0d0558`<br>pin UMA to native backing until retirement **port** `9ec2b4a3` after backing ownership is in place. | | **Cold PSOs and indirect binds** | Correct selected stand-in **port** `4e62e7c8`<br>finish failed worker jobs **port** `0eaef7e6)<br>keep cold compiles off bind threads **port** `aff341e1`<br>record wanted state at deferred record time **port** `11cf89f9`<br>avoid put-off segments for bounded waits **port** `76e87252`. | | **Stream state and compiler fixes** | Compute FLAGS **pick** `2bfc36eb`<br>conservative graphics projection **port** `32ecdb27`<br>extended rasterizer state **port** `e3a52f43` after projection<br>native cache lifecycle **port** `9e82e2aa` → `6457c188` after stream support. From `b271eba5`, extract DXC OOM handling and linker arguments as two PRs<br>serialized DXC admission **pick** `2e45718b` independently. From `ba659963`, extract group-count conversion first and tail-lane masking/deferred replay second. | | **Cache correctness** | Exact stale generation **port** `fba7de2b`<br>static samplers **port** `be772deb`<br>NodeMask runtime and disk identity **port** `e5d2e5ee` → `4cd1b772` → `5afb11ad`<br>graphics cache identity **port** `14524632`<br>graphics CLI/runtime variant parity **pick** `5d91261c`. | | **Small independent performance PRs** | Unsplit cache buffer reuse **port** `355826c5`<br>DXIL container copy **pick** `3cf3451c`<br>loader range filter **pick** `b59e59b6`<br>zero-mip staging **port** `396a4144`<br>effects analysis **pick** `e67817e4` → `911ad65d` together<br>BCPack **pick** `9fdfe6c9`<br>Opus scratch and validation **pick** `5a5b6504), then PCM bulk copy and preallocation **pick** `87c5c52c` → `2a577d7d` after scratch. Split writability checks from allocations in `75c4a245`. | | **GPU texture uploads and copyback** | **Port** `d8ddd5b5` → `e12049fe` together for upload ordering, with staging and queue lifetime prerequisites where needed (`0ea9a959`, `23d7f4e8`). For copyback: owned queue snapshots `d93c63a7`<br>retirement model then activation `c52ad726` followed by `0540a23c` → `9374675e`, with sparse consumers `12b1b786` following separately<br>native slots `89343644` → `e10df30d` and queue ordering `87b55ac8` as distinct prerequisites where needed<br>reverse conversion **pick** `b7af0096`<br>writer metadata **port** `972f66ec` → `24ffb0e7` → `b0442a22`<br>staging plans **port** `e564cbb7` → `fafeee3e`<br>activate fence-visible publication **port** `4cc28d40` → `547f3211`. Split writer metadata into bookkeeping and publication if it exceeds the size target. | | **PSO performance** | Build ownership `6f6b5a27`<br>canonical key `0fef9d5a` → `67629ad4` → `fedfbe4c`<br>coalescing `b946815d`<br>queue foundation `e7c522d8` and activation `2ccea5e1) as separate PRs<br>rank preloads `56cffc2b`<br>journal used keys `7ea65ea9` → `77eb9e7f`. Split indirect CBV ABI `202c9623` → `ffac3219` from activation `2a6a8ba2)<br>command-buffer reuse `aa446c29`<br>observed-use prewarm `c162ffb1` → `6495067f`. Treat these as ports on the minimum landed prerequisites. | | **Shader lowering and diagnostics** | One candidate PR per lowering change and its tests, in the order needed by that module. Keep `0aa15353` (guards) and `e0416843` (wave remap) separate. For tooling, runner **pick** `5bdaa54e` then **port** the runner/fixture parts of `dfcd4bbb` with it<br>comparator **port** `fd237b1b` plus comparator/fixture parts of `dfcd4bbb` after the runner. Defer the later counters until their producers land. Stall report foundation `dab895e5` → `e0635a1c` is separate from hook sets. | The refreshed source head also adds `54039442` and `a4f0399f`. Leave both out of these PRs. They extend the sparse claim ledger and the inert pipeline eviction ledger, respectively. After each extraction, review the diff against its base and retain only the named behavior, its regression, and any required README update. Link the source commits and this issue, preserve original author and co-author credit, and note any adaptation in the PR. Run the Windows/GPU suite and paired smoke checks described above before marking a runtime PR ready. No Windows, GPU or retail runs were performed for this plan. **AI use** — Codex (GPT-6) inspected the diff, commit history and related PRs and drafted this issue.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 12:40:17 +00:00
Author
Owner

@⁠mokkamokacaffe on GitHub · 2026-11-26 13:25 UTC · original

The unsplit translated-cache buffer reuse listed here is already extracted as #2594, authored by @⁠storrmzz at current head ae921b40. Commit 355826c5 in #2778 explicitly says it was adapted from that PR, so another extraction would duplicate an active, focused and mergeable contribution.

I reviewed #2594 against main b49be183:

  • translated::decode_entry retains ownership of the file Vec and validates the DXIL container before modifying it.
  • In the unsplit branch, rest.is_empty() establishes that the validated payload ends at the end of the file buffer, so b.len() - len is the payload start.
  • copy_within and truncate preserve the allocation; split entries keep the previous per-container copy path and do not retain all piece bytes.
  • The added tests cover allocation ownership, sampler-table offsets, every unsplit truncation, trailing bytes, malformed split fields, split truncations and split round trips.
  • git diff --check origin/main...ae921b40 passed.

No separate PR should be opened for 355826c5; #2594 should remain the source of truth and receive any further testing. Its remaining merge requirement is the exact-head paired retail smoke run described in its body.

AI use

  • OpenAI Codex (GPT-6.2 Astra Ultra) traced the provenance, compared the focused and mega-PR patches, audited the buffer ownership and validation invariants, and drafted this note. No code was changed.
**@⁠mokkamokacaffe** on GitHub · 2026-11-26 13:25 UTC · [original](https://github.com/xcl-dev/xcl/issues/2787#issuecomment-7193321106) The unsplit translated-cache buffer reuse listed here is already extracted as #2594, authored by @⁠storrmzz at current head `ae921b40`. Commit `355826c5` in #2778 explicitly says it was adapted from that PR, so another extraction would duplicate an active, focused and mergeable contribution. I reviewed #2594 against `main` `b49be183`: - `translated::decode_entry` retains ownership of the file `Vec` and validates the DXIL container before modifying it. - In the unsplit branch, `rest.is_empty()` establishes that the validated payload ends at the end of the file buffer, so `b.len() - len` is the payload start. - `copy_within` and `truncate` preserve the allocation; split entries keep the previous per-container copy path and do not retain all piece bytes. - The added tests cover allocation ownership, sampler-table offsets, every unsplit truncation, trailing bytes, malformed split fields, split truncations and split round trips. - `git diff --check origin/main...ae921b40` passed. No separate PR should be opened for `355826c5`; #2594 should remain the source of truth and receive any further testing. Its remaining merge requirement is the exact-head paired retail smoke run described in its body. **AI use** - OpenAI Codex (GPT-6.2 Astra Ultra) traced the provenance, compared the focused and mega-PR patches, audited the buffer ownership and validation invariants, and drafted this note. No code was changed.
Author
Owner

@⁠retrope13 on GitHub · 2026-11-26 13:25 UTC · original

Native Windows/MSVC + NVIDIA GPU verification and release benchmark for T1 (b81ac2eb cherry-picked cleanly onto main b49be183) — not claiming the PR (just providing the native Windows/MSVC test + timing data that was unavailable when #2787 was drafted).

Environment

  • CPU / RAM: Intel Core i5-14500HX (14C/20T), 24 GB RAM
  • GPU: NVIDIA GeForce RTX 4060 Laptop GPU (8 GB, driver 32.0.16.2140), XCL_ADAPTER=NVIDIA
  • OS / Toolchain: Windows 11 26H2 (build 26300.9818), rustc 1.100.0 (stable-x86_64-pc-windows-msvc), Windows SDK 10.0.26100.0 DXC 1.9.2602.17

Applicability & Full Windows/MSVC Test Suite

  • git cherry-pick --no-commit b81ac2eb onto main (b49be183): applies cleanly with 0 conflicts (crates/xcl/src/gpu/tiling.rs, +321 / -62) and 0 new compiler warnings.
  • Targeted cargo test --locked -p xcl --lib gpu::tiling::: 17 passed, 0 failed in debug (10.64 s) and 17 passed, 0 failed in --release (0.86 s).
  • Full workspace (cargo build --workspace --locked, then cargo test --workspace --locked --no-fail-fast -- --test-threads=4):
    • Clean main (b49be183): 1435 passed, 0 failed, 47 ignored
    • main + b81ac2eb (T1): 1437 passed, 0 failed, 47 ignored (+2 new tiling tests, 0 regressions)

Isolated --release Timing & Byte Parity (main b49be183 vs. main + b81ac2eb)

9 timed iterations after 1 warmup per workload (median ms reported; FNV-1a 64-bit checksums of both tile and detile outputs matched 100% identically across all 4 cases):

Workload Op main (b49be183) main + b81ac2eb Speedup Output Parity
1920×1080 R8 (mode 5, elem_log2=0) detile 18.75 ms (18.40–19.25) 0.59 ms (0.56–0.66) 31.8× identical (1b3af948a76d4c25)
1920×1080 R8 (mode 5, elem_log2=0) tile 18.90 ms (18.58–19.21) 0.56 ms (0.54–0.58) 33.8× identical (31cf563b857bf425)
2048×2048 RGBA8 (mode 10, elem_log2=2) detile 40.14 ms (38.91–41.11) 5.48 ms (5.41–5.83) 7.3× identical (a4118795b68a2325)
2048×2048 RGBA8 (mode 10, elem_log2=2) tile 41.79 ms (41.76–42.46) 5.34 ms (5.29–5.53) 7.8× identical (56e0fada6c622325)
2048×2048 BC7 (512×512×16B, mode 10) detile 2.84 ms (2.72–3.04) 1.11 ms (0.98–1.31) 2.6× identical (1b59b090d0bc2325)
2048×2048 BC7 (512×512×16B, mode 10) tile 3.19 ms (3.02–3.39) 1.19 ms (0.74–1.31) 2.7× identical (6645f0556de02325)
2048×2048 RGBA8 (mode 25 XOR, pipes=3, pkrs=3, base_xor=0x100) detile 41.58 ms (40.89–41.86) 6.60 ms (6.41–6.88) 6.3× identical (a4118795b68a2325)
2048×2048 RGBA8 (mode 25 XOR, pipes=3, pkrs=3, base_xor=0x100) tile 41.58 ms (41.34–43.06) 7.22 ms (5.75–8.05) 5.8× identical (d3edea4df9ca2325)

Not Tested

  • Live retail title smoke runs, AMD / Intel GPUs, Linux, and the 47 #[ignore] tests.

AI disclosure: Antigravity (Gemini 4 Neon, XHigh) ran the cherry-pick, Windows/MSVC test suites, release benchmark, and drafted this comment.

**@⁠retrope13** on GitHub · 2026-11-26 13:25 UTC · [original](https://github.com/xcl-dev/xcl/issues/2787#issuecomment-7193331600) **Native Windows/MSVC + NVIDIA GPU verification and release benchmark for T1 (`b81ac2eb` cherry-picked cleanly onto `main` `b49be183`)** — not claiming the PR (just providing the native Windows/MSVC test + timing data that was unavailable when #2787 was drafted). ### Environment - **CPU / RAM:** Intel Core i5-14500HX (14C/20T), 24 GB RAM - **GPU:** NVIDIA GeForce RTX 4060 Laptop GPU (8 GB, driver `32.0.16.2140`), `XCL_ADAPTER=NVIDIA` - **OS / Toolchain:** Windows 11 26H2 (build `26300.9818`), `rustc 1.100.0` (`stable-x86_64-pc-windows-msvc`), Windows SDK `10.0.26100.0` DXC `1.9.2602.17` ### Applicability & Full Windows/MSVC Test Suite - `git cherry-pick --no-commit b81ac2eb` onto `main` (`b49be183`): **applies cleanly with 0 conflicts** (`crates/xcl/src/gpu/tiling.rs`, +321 / -62) and **0 new compiler warnings**. - Targeted `cargo test --locked -p xcl --lib gpu::tiling::`: **17 passed, 0 failed** in debug (`10.64 s`) and **17 passed, 0 failed** in `--release` (`0.86 s`). - Full workspace (`cargo build --workspace --locked`, then `cargo test --workspace --locked --no-fail-fast -- --test-threads=4`): - Clean `main` (`b49be183`): **1435 passed, 0 failed, 47 ignored** - `main` + `b81ac2eb` (T1): **1437 passed, 0 failed, 47 ignored** (+2 new tiling tests, 0 regressions) ### Isolated `--release` Timing & Byte Parity (`main` `b49be183` vs. `main` + `b81ac2eb`) 9 timed iterations after 1 warmup per workload (median ms reported; FNV-1a 64-bit checksums of both `tile` and `detile` outputs matched **100% identically** across all 4 cases): | Workload | Op | `main` (`b49be183`) | `main` + `b81ac2eb` | Speedup | Output Parity | |---|---|---:|---:|---:|:---:| | `1920×1080` R8 (`mode 5`, `elem_log2=0`) | detile | 18.75 ms *(18.40–19.25)* | **0.59 ms** *(0.56–0.66)* | **31.8×** | identical (`1b3af948a76d4c25`) | | `1920×1080` R8 (`mode 5`, `elem_log2=0`) | tile | 18.90 ms *(18.58–19.21)* | **0.56 ms** *(0.54–0.58)* | **33.8×** | identical (`31cf563b857bf425`) | | `2048×2048` RGBA8 (`mode 10`, `elem_log2=2`) | detile | 40.14 ms *(38.91–41.11)* | **5.48 ms** *(5.41–5.83)* | **7.3×** | identical (`a4118795b68a2325`) | | `2048×2048` RGBA8 (`mode 10`, `elem_log2=2`) | tile | 41.79 ms *(41.76–42.46)* | **5.34 ms** *(5.29–5.53)* | **7.8×** | identical (`56e0fada6c622325`) | | `2048×2048` BC7 (`512×512×16B`, `mode 10`) | detile | 2.84 ms *(2.72–3.04)* | **1.11 ms** *(0.98–1.31)* | **2.6×** | identical (`1b59b090d0bc2325`) | | `2048×2048` BC7 (`512×512×16B`, `mode 10`) | tile | 3.19 ms *(3.02–3.39)* | **1.19 ms** *(0.74–1.31)* | **2.7×** | identical (`6645f0556de02325`) | | `2048×2048` RGBA8 (`mode 25` XOR, `pipes=3, pkrs=3, base_xor=0x100`) | detile | 41.58 ms *(40.89–41.86)* | **6.60 ms** *(6.41–6.88)* | **6.3×** | identical (`a4118795b68a2325`) | | `2048×2048` RGBA8 (`mode 25` XOR, `pipes=3, pkrs=3, base_xor=0x100`) | tile | 41.58 ms *(41.34–43.06)* | **7.22 ms** *(5.75–8.05)* | **5.8×** | identical (`d3edea4df9ca2325`) | ### Not Tested - Live retail title smoke runs, AMD / Intel GPUs, Linux, and the 47 `#[ignore]` tests. *AI disclosure: Antigravity (Gemini 4 Neon, XHigh) ran the cherry-pick, Windows/MSVC test suites, release benchmark, and drafted this comment.*
This discussion has been locked. Commenting is limited to contributors.
No description provided.