D3D12.X: run split pieces for dispatches with no title allocator or in a bundle #2509

Open
b3IKK wants to merge 15 commits from upstream-pr/2519 into main
b3IKK commented 2026-11-25 21:24:26 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by b3IKK on 2026-11-25T21:24:26Z.


Stacked on #2404 (5b9d4ff).

dispatch_chain::dispatch only used a chain's scratch when the list had a title allocator and was not a bundle. Every other dispatch — a bundle, or a list whose allocator XCL cannot see (a console list, a Wait64 segment) — fell back to Chain::whole, a 0.7–1.1 MB unsplit compute pipeline that the driver takes 20–35 s to compile. On the retail 1.0.2.1 title (RTX 5080, XCL_DIRECT_DXIL=1, default wait) 46 such whole forms were still asked on the #2404+#2097 stack, and the first one stalled presentation at 92–94 s.

This gives those dispatches an XCL-owned scratch keyed by the list. The recording is held in LIST_RECORDINGS until the title resets that list or bundle, and the already-compiled chain pieces run instead of the whole form.

What is in it

  • crates/xcl/src/hle/d3d12x/real/dispatch_chain.rs: LIST_RECORDINGS; dispatch treats allocator == 0 or a bundle as XCL-owned (scratch_for(..., 0)), stores the recording under the list, and list_reset drops it; test a_bundle_dispatch_runs_the_pieces_with_an_xcl_scratch_not_the_whole_form.

Retail A/B (RTX 5080, retail 1.0.2.1, XCL_DIRECT_DXIL=1, default wait, one run each, on the earlier #2404 head 5ca9c23):

condition whole forms presentation end
allocator-less lists only (400c095, 400 s) 37 100.1 s device removed at 100.5 s
allocator-less lists + bundles (50af98e, 300 s) 0 264.1 s device removed at 264.5 s

The bundle half removes the 37 whole forms; the wall in both is the driver's shader-code heap (#2403), which the 2 GiB profile later removed. On the new head (5b9d4ff) this scratch is part of the stack that ran 600 s with no device removal (1,954 frames, world reached, 0 whole forms) together with #2590's 2 GiB profile, KDenKC's free_aside patch and a precompiled heap-window cache.

Tested

  • hardware: NVIDIA GeForce RTX 5080 (driver 32.0.16.1088), AMD Ryzen 9 9950X3D, Windows 11 10.0.26300, Rust 1.100.0 (stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5, debug (scripts/test.ps1) and release (scripts/smoke.ps1)
  • .\scripts\test.ps1 (cargo build --workspace + cargo test --workspace -- --test-threads=4): 1448 passed, 0 failed, 47 ignored
  • the new test alone: 1 passed, 0 failed. With owned forced to false: 0 passed, 1 failed (the dispatch falls back to the whole form).
  • SKIPPED: the wave64 / direct-DXIL per-lane tests that need 64-lane hardware or a semantics mode this adapter refuses, no heap windows, and cannot disable the driver cache (Windows Developer Mode is required).

Regression run

main (426a5a7, clean tree, no local changes):

xcl-smoke v1
commit: 426a5a745db4d5e4b037449ede0b70cb342f5192
gpu: NVIDIA GeForce RTX 5080
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1642 (PresentX 1642)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15158 MB

PR (bad9c5d, clean tree, no local changes):

xcl-smoke v1
commit: bad9c5df292449944eb5c733edc9ce6138b06178
gpu: NVIDIA GeForce RTX 5080
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1620 (PresentX 1620)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15093 MB

(The main block is 426a5a7, an ancestor of the current main, from the same machine and data folder.)

Not tested

  • a bundle reset while the parent list still executes its copied commands: the scratch is then released with the bundle. #2459 tracks the wider shared-scratch lifetime and the missing Reset hooks. This title resets its bundles after the frame's GPU work; other titles may need the recording retained on the parent at ExecuteBundle.
  • AMD GPUs, native wave64 hardware, other titles and Linux / Wine.

AI use

  • OpenCode, Claude Fable 5.2: implemented the list-keyed scratch, added the test and checked it fails without the change, re-stacked it on 5b9d4ff, ran the full suite and the scripts/smoke.ps1 pair, and ran the retail A/B and the 600 s stack on this machine.
<!-- greyfinch-sync:ivall/xcl:issue:5499421874 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2519). Originally posted by [b3IKK](https://github.com/b3IKK) on 2026-11-25T21:24:26Z. --- Stacked on #2404 (`5b9d4ff`). `dispatch_chain::dispatch` only used a chain's scratch when the list had a title allocator and was not a bundle. Every other dispatch — a bundle, or a list whose allocator XCL cannot see (a console list, a Wait64 segment) — fell back to `Chain::whole`, a 0.7–1.1 MB unsplit compute pipeline that the driver takes 20–35 s to compile. On the retail 1.0.2.1 title (RTX 5080, `XCL_DIRECT_DXIL=1`, default wait) 46 such whole forms were still asked on the #2404+#2097 stack, and the first one stalled presentation at 92–94 s. This gives those dispatches an XCL-owned scratch keyed by the list. The recording is held in `LIST_RECORDINGS` until the title resets that list or bundle, and the already-compiled chain pieces run instead of the whole form. **What is in it** - `crates/xcl/src/hle/d3d12x/real/dispatch_chain.rs`: `LIST_RECORDINGS`; `dispatch` treats `allocator == 0` or a bundle as XCL-owned (`scratch_for(..., 0)`), stores the recording under the list, and `list_reset` drops it; test `a_bundle_dispatch_runs_the_pieces_with_an_xcl_scratch_not_the_whole_form`. **Retail A/B** (RTX 5080, retail 1.0.2.1, `XCL_DIRECT_DXIL=1`, default wait, one run each, on the earlier #2404 head `5ca9c23`): | condition | whole forms | presentation | end | |---|---:|---:|---| | allocator-less lists only (`400c095`, 400 s) | 37 | 100.1 s | device removed at 100.5 s | | allocator-less lists + bundles (`50af98e`, 300 s) | **0** | **264.1 s** | device removed at 264.5 s | The bundle half removes the 37 whole forms; the wall in both is the driver's shader-code heap (#2403), which the 2 GiB profile later removed. On the new head (`5b9d4ff`) this scratch is part of the stack that ran **600 s with no device removal** (1,954 frames, world reached, 0 whole forms) together with #2590's 2 GiB profile, KDenKC's `free_aside` patch and a precompiled heap-window cache. **Tested** - hardware: NVIDIA GeForce RTX 5080 (driver 32.0.16.1088), AMD Ryzen 9 9950X3D, Windows 11 10.0.26300, Rust 1.100.0 (`stable-x86_64-pc-windows-msvc`), DXC 1.9.2609.5, debug (`scripts/test.ps1`) and release (`scripts/smoke.ps1`) - `.\scripts\test.ps1` (`cargo build --workspace` + `cargo test --workspace -- --test-threads=4`): **1448 passed, 0 failed, 47 ignored** - the new test alone: 1 passed, 0 failed. With `owned` forced to `false`: 0 passed, 1 failed (the dispatch falls back to the whole form). - SKIPPED: the wave64 / direct-DXIL per-lane tests that need 64-lane hardware or a semantics mode this adapter refuses, `no heap windows`, and `cannot disable the driver cache (Windows Developer Mode is required)`. **Regression run** main (`426a5a7`, clean tree, no local changes): ``` xcl-smoke v1 commit: 426a5a745db4d5e4b037449ede0b70cb342f5192 gpu: NVIDIA GeForce RTX 5080 title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1642 (PresentX 1642) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15158 MB ``` PR (`bad9c5d`, clean tree, no local changes): ``` xcl-smoke v1 commit: bad9c5df292449944eb5c733edc9ce6138b06178 gpu: NVIDIA GeForce RTX 5080 title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1620 (PresentX 1620) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15093 MB ``` (The main block is `426a5a7`, an ancestor of the current `main`, from the same machine and data folder.) **Not tested** - a bundle reset while the parent list still executes its copied commands: the scratch is then released with the bundle. #2459 tracks the wider shared-scratch lifetime and the missing Reset hooks. This title resets its bundles after the frame's GPU work; other titles may need the recording retained on the parent at `ExecuteBundle`. - AMD GPUs, native wave64 hardware, other titles and Linux / Wine. **AI use** - OpenCode, Claude Fable 5.2: implemented the list-keyed scratch, added the test and checked it fails without the change, re-stacked it on `5b9d4ff`, ran the full suite and the `scripts/smoke.ps1` pair, and ran the retail A/B and the 600 s stack on this machine.
DavidM1911 commented 2026-11-25 22:06:49 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T21:45:35Z.


Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: 1038 passed, 1 failed in one parallel run; the failing test passes on a single-threaded rerun (1039/0). Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7175502751 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2519#issuecomment-7175502751). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T21:45:35Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: 1038 passed, 1 failed in one parallel run; the failing test passes on a single-threaded rerun (1039/0). Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun. Thanks!
b3IKK commented 2026-11-25 22:06:50 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by b3IKK on 2026-11-25T21:46:34Z.


Thanks for the 3060 Ti run. That is the known parallel-run flake (#1978): the same single test passes when the suite is rerun single-threaded, and our 5080 shows the same pattern.

The head is now 400c095, re-stacked directly on #2404 (5ca9c23) and narrowed to lists whose allocator XCL cannot see (bundles keep the whole-form fallback, #2459). On this machine its suite is 1220 passed / 1 failed / 26 ignored; the one failure is a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier, a base 68a284a expectation that main fixes in c828d8c and that this PR does not touch. Smoke: 1622 frames, 0 removals. I am updating the PR body with the full pair and the retail numbers.

AI use: OpenCode, Claude Fable 5.2 wrote this.

<!-- greyfinch-sync:ivall/xcl:comment:7175522467 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2519#issuecomment-7175522467). Originally posted by [b3IKK](https://github.com/b3IKK) on 2026-11-25T21:46:34Z. --- Thanks for the 3060 Ti run. That is the known parallel-run flake (#1978): the same single test passes when the suite is rerun single-threaded, and our 5080 shows the same pattern. The head is now `400c095`, re-stacked directly on #2404 (`5ca9c23`) and narrowed to lists whose allocator XCL cannot see (bundles keep the whole-form fallback, #2459). On this machine its suite is 1220 passed / 1 failed / 26 ignored; the one failure is `a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier`, a base `68a284a` expectation that main fixes in `c828d8c` and that this PR does not touch. Smoke: 1622 frames, 0 removals. I am updating the PR body with the full pair and the retail numbers. AI use: OpenCode, Claude Fable 5.2 wrote this.
emirduran707 commented 2026-11-25 22:06:52 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by emirduran707 on 2026-11-25T21:56:31Z.


Independent AMD RDNA4 (native wave64) test report on exact head 50af98ed1f5e95d4e9af2195e93d395d2ae187d7 (clean detached checkout, no local changes).

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64, driver 32.0.31044.16), Ryzen 5 5600, 32 GB RAM, Windows 11 Pro 26300, Rust 1.100.0 (stable-x86_64-pc-windows-msvc), DXC 1.9.2602.17; tests debug, smoke release.
  • cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 1288 passed, 3 failed, 46 ignored; 8 SKIPPED (6 in lower_dxil::tests::{f16,f32}_programs_on_the_gpu refused by per-lane form; heap_window_out_of_memory_falls_back_to_the_switch_form; pso_measurement_compiles_an_exact_synthetic_record). All native wave64 GPU tests ran and passed.
    • The PR's test passed: hle::d3d12x::real::dispatch_chain::scratch_tests::a_bundle_dispatch_runs_the_pieces_with_an_xcl_scratch_not_the_whole_form.
    • The 3 failures are pre-existing on the PR's base main: gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1 (seed 722) and fuzz_validate_and_gpu_3 (seed 1599) on this GPU, plus gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier (from 50a9fde / #2074, fixed later on main in #2420).

Regression run (60 s retail-title smoke, XCL_NETWORK=0, release)

xcl-smoke v1
commit: 50af98ed1f5e95d4e9af2195e93d395d2ae187d7
gpu: AMD Radeon RX 9060 XT
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1620 (PresentX 1620)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13934 MB

(Matched main 68a284a baseline on the same machine today: 1573 frames, 14420 MB peak, 0 device removals, 0 crashes.)

Not tested

  • D3D12 debug layer; Intel GPUs.

AI use

  • Antigravity with Gemini 4 Neon ran the build, test suite, and smoke run and drafted this report.
<!-- greyfinch-sync:ivall/xcl:comment:7175735454 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2519#issuecomment-7175735454). Originally posted by [emirduran707](https://github.com/emirduran707) on 2026-11-25T21:56:31Z. --- Independent AMD RDNA4 (native wave64) test report on exact head `50af98ed1f5e95d4e9af2195e93d395d2ae187d7` (clean detached checkout, no local changes). **Tested** - AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64, driver 32.0.31044.16), Ryzen 5 5600, 32 GB RAM, Windows 11 Pro 26300, Rust 1.100.0 (`stable-x86_64-pc-windows-msvc`), DXC 1.9.2602.17; tests debug, smoke release. - `cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4`: **1288 passed, 3 failed, 46 ignored; 8 SKIPPED** (6 in `lower_dxil::tests::{f16,f32}_programs_on_the_gpu` refused by per-lane form; `heap_window_out_of_memory_falls_back_to_the_switch_form`; `pso_measurement_compiles_an_exact_synthetic_record`). All native wave64 GPU tests ran and passed. - The PR's test passed: `hle::d3d12x::real::dispatch_chain::scratch_tests::a_bundle_dispatch_runs_the_pieces_with_an_xcl_scratch_not_the_whole_form`. - The 3 failures are pre-existing on the PR's base `main`: `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1` (seed 722) and `fuzz_validate_and_gpu_3` (seed 1599) on this GPU, plus `gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier` (from `50a9fde` / #2074, fixed later on `main` in #2420). **Regression run** (60 s retail-title smoke, `XCL_NETWORK=0`, release) ``` xcl-smoke v1 commit: 50af98ed1f5e95d4e9af2195e93d395d2ae187d7 gpu: AMD Radeon RX 9060 XT title: 21222967 seconds: 60 exit: 0x0 frames shown: 1620 (PresentX 1620) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 13934 MB ``` (Matched `main` `68a284a` baseline on the same machine today: 1573 frames, 14420 MB peak, 0 device removals, 0 crashes.) **Not tested** - D3D12 debug layer; Intel GPUs. **AI use** - Antigravity with Gemini 4 Neon ran the build, test suite, and smoke run and drafted this report.
SlopTart commented 2026-11-25 23:09:18 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-25T22:49:50Z.


Tested: current PR head merged onto current origin/main (clean), Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT (NAVI31), cargo target x86_64-pc-windows-gnu run under wine-11.0 (Proton), rustc 1.94.0, vkd3d-proton 3.1 with the XCL patch, official MS DXC (binaries 2026-09-29).

gpu_ suite (cold cache): 164 passed / 3 failed, no crashes. The three are the known baseline on this lane (seed-1003 fuzz, mad/mac contraction, promoted-UAV-clear driver gap, PR #2490); none caused by this PR.
Targeted run of a_bundle_dispatch_runs_the_pieces_with_an_xcl_scratch_not_the_whole_form: passed.

Not tested: retail titles (no title data on this lane, counts only).

AI use: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting.

<!-- greyfinch-sync:ivall/xcl:comment:7176836349 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2519#issuecomment-7176836349). Originally posted by [SlopTart](https://github.com/SlopTart) on 2026-11-25T22:49:50Z. --- **Tested**: current PR head merged onto current `origin/main` (clean), Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT (NAVI31), cargo target `x86_64-pc-windows-gnu` run under wine-11.0 (Proton), rustc 1.94.0, vkd3d-proton 3.1 with the XCL patch, official MS DXC (binaries 2026-09-29). `gpu_` suite (cold cache): 164 passed / 3 failed, no crashes. The three are the known baseline on this lane (seed-1003 fuzz, mad/mac contraction, promoted-UAV-clear driver gap, PR #2490); none caused by this PR. Targeted run of `a_bundle_dispatch_runs_the_pieces_with_an_xcl_scratch_not_the_whole_form`: passed. **Not tested**: retail titles (no title data on this lane, counts only). **AI use**: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting.
DavidM1911 commented 2026-11-26 02:08:22 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T01:36:40Z.


Re-verification on RTX 3060 Ti (Windows 11), new head merged with current main:

  • cargo test -p xcl --lib: 1 failure under parallel scheduling; clean on --test-threads=1 rerun (1307 passed, 0 failed, 27 ignored, 81s). Intermittent single-test flake — tracked in #1978.

Thanks!

— Devin

<!-- greyfinch-sync:ivall/xcl:comment:7179945995 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2519#issuecomment-7179945995). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-26T01:36:40Z. --- Re-verification on RTX 3060 Ti (Windows 11), new head merged with current `main`: - `cargo test -p xcl --lib`: 1 failure under parallel scheduling; clean on `--test-threads=1` rerun (**1307 passed, 0 failed, 27 ignored**, 81s). Intermittent single-test flake — tracked in #1978. Thanks! — Devin
luckyteagirl commented 2026-11-26 07:16:43 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-26T07:16:43Z.

Review: COMMENTED


Could the bundle path keep using the whole pipeline until split dispatches can be recorded without a bundle-forbidden command? The new branch sends bundles to record_dispatch_chain, which emits a UAV ResourceBarrier before the second piece, before a second slab, or when it reuses scratch. D3D12 does not allow ResourceBarrier in bundles. The new test records one piece in one slab with fresh scratch and does not call native Close or ExecuteBundle, so it misses that path.

A test that records an actual two-piece chain, executes the bundle, and checks output with the D3D12 debug layer enabled would catch the dropped barrier. Exact-head source review of 50af98ed1f5e95d4e9af2195e93d395d2ae187d7. Microsoft's command-list and bundle API table says the runtime drops forbidden bundle calls and the debug layer reports them. No GPU run. AI-assisted review with Codex.

<!-- greyfinch-sync:ivall/xcl:review:6069934021 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2519#pullrequestreview-6069934021). Originally posted by [luckyteagirl](https://github.com/luckyteagirl) on 2026-11-26T07:16:43Z. **Review:** COMMENTED --- Could the bundle path keep using the whole pipeline until split dispatches can be recorded without a bundle-forbidden command? The new branch sends bundles to `record_dispatch_chain`, which emits a UAV `ResourceBarrier` before the second piece, before a second slab, or when it reuses scratch. D3D12 does not allow `ResourceBarrier` in bundles. The new test records one piece in one slab with fresh scratch and does not call native `Close` or `ExecuteBundle`, so it misses that path. A test that records an actual two-piece chain, executes the bundle, and checks output with the D3D12 debug layer enabled would catch the dropped barrier. Exact-head source review of `50af98ed1f5e95d4e9af2195e93d395d2ae187d7`. [Microsoft's command-list and bundle API table](https://learn.microsoft.com/en-us/windows/win32/direct3d12/recording-command-lists-and-bundles) says the runtime drops forbidden bundle calls and the debug layer reports them. No GPU run. AI-assisted review with Codex.
luckyteagirl commented 2026-11-26 07:16:45 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-26T07:16:45Z.

Review: COMMENTED


Could allocatorless direct-list scratch stay alive until the submitted recording completes? list_reset removes the recording from LIST_RECORDINGS. Its scratch is otherwise held only by that recording, with a weak reference in SHARED. D3D12 permits resetting a command list while a queued recording of it is in flight, using another eligible allocator. A title can submit the old list behind a queue wait, reset the command list, then release the wait. The old dispatch still refers to the scratch GPU address after the owning reference can be dropped.

Keep the recording alive through its submission fence or allocator, or retain the whole-pipeline fallback where completion cannot be tracked. A gated queue test can assert that a successful command-list Reset leaves scratch alive until the old fence completes. Exact-head source review of 50af98ed1f5e95d4e9af2195e93d395d2ae187d7. Microsoft Reset contract. No GPU run. AI-assisted review with Codex.

<!-- greyfinch-sync:ivall/xcl:review:6069934360 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2519#pullrequestreview-6069934360). Originally posted by [luckyteagirl](https://github.com/luckyteagirl) on 2026-11-26T07:16:45Z. **Review:** COMMENTED --- Could allocatorless direct-list scratch stay alive until the submitted recording completes? `list_reset` removes the recording from `LIST_RECORDINGS`. Its scratch is otherwise held only by that recording, with a weak reference in `SHARED`. D3D12 permits resetting a command list while a queued recording of it is in flight, using another eligible allocator. A title can submit the old list behind a queue wait, reset the command list, then release the wait. The old dispatch still refers to the scratch GPU address after the owning reference can be dropped. Keep the recording alive through its submission fence or allocator, or retain the whole-pipeline fallback where completion cannot be tracked. A gated queue test can assert that a successful command-list Reset leaves scratch alive until the old fence completes. Exact-head source review of `50af98ed1f5e95d4e9af2195e93d395d2ae187d7`. [Microsoft Reset contract](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-id3d12graphicscommandlist-reset). No GPU run. AI-assisted review with Codex.
Foniass commented 2026-12-01 08:15:05 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:15:05Z.


Triage (#1607) – head bad9c5d

Stacked on #2404 (5b9d4ff); only the top commit bad9c5d belongs here. #2404, #2919 and #2633 share the base but do not add LIST_RECORDINGS.
real/dispatch_chain.rs: an "owned" recording (a bundle, or allocator 0) goes into LIST_RECORDINGS, and list_reset drops it. list_reset runs on every title Reset (list_x.rs Reset hook via reset_copy_scratch) and on XCL segment resets. Dropping the last Arc<Recording> releases the Scratch buffer. The comment says D3D12 allows a reset only after the GPU has finished, but that is true of ID3D12CommandAllocator::Reset. ID3D12GraphicsCommandList::Reset may be called right after ExecuteCommandLists. list_reset's own doc comment says the GPU may still run the last recording. Its last Release is held by late_release (on by default) until every queue with work is past it, so only XCL_LATE_RELEASE=0 frees it while the GPU may still use it. The comment's reason is still wrong: ID3D12GraphicsCommandList::Reset may follow ExecuteCommandLists at once; only the allocator Reset waits for the GPU. The test checks only the map entries.
Recommendation: keep open; fix the comment, or keep the scratch until the allocator is reset.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7305070801 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2519#issuecomment-7305070801). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T08:15:05Z. --- **Triage (#1607)** – head bad9c5d Stacked on #2404 (`5b9d4ff`); only the top commit bad9c5d belongs here. #2404, #2919 and #2633 share the base but do not add `LIST_RECORDINGS`. `real/dispatch_chain.rs`: an "owned" recording (a bundle, or allocator 0) goes into `LIST_RECORDINGS`, and `list_reset` drops it. `list_reset` runs on every title `Reset` (`list_x.rs` Reset hook via `reset_copy_scratch`) and on XCL segment resets. Dropping the last `Arc<Recording>` releases the `Scratch` buffer. The comment says D3D12 allows a reset only after the GPU has finished, but that is true of `ID3D12CommandAllocator::Reset`. `ID3D12GraphicsCommandList::Reset` may be called right after `ExecuteCommandLists`. `list_reset`'s own doc comment says the GPU may still run the last recording. Its last Release is held by `late_release` (on by default) until every queue with work is past it, so only `XCL_LATE_RELEASE=0` frees it while the GPU may still use it. The comment's reason is still wrong: `ID3D12GraphicsCommandList::Reset` may follow `ExecuteCommandLists` at once; only the allocator Reset waits for the GPU. The test checks only the map entries. Recommendation: keep open; fix the comment, or keep the scratch until the allocator is reset. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2519:upstream-pr/2519'
git switch 'upstream-pr/2519'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/2519'
git switch 'upstream-pr/2519'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2519'
git switch 'upstream-pr/2519'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2519'
git switch 'main'
git merge --squash 'upstream-pr/2519'
git switch 'main'
git merge --ff-only 'upstream-pr/2519'
git switch 'main'
git merge 'upstream-pr/2519'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!2509
No description provided.