D3D12.X: replace busy copy scratch within budget #1411

Open
hajduzsolt wants to merge 2 commits from upstream-pr/1421 into main
hajduzsolt commented 2026-11-24 15:47:17 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by hajduzsolt on 2026-11-24T15:47:17Z.


Runtime fix verified with unit tests and RX 9070 XT smoke run.

What is in it

  • crates/xcl/src/hle/d3d12x/list_x.rs: retain busy scratch until GPU completion and test replacement and accounting with synthetic D3D12 resources.

Tested

  • Windows 11 Pro x64 build 26300, AMD Ryzen 7 9800X3D, AMD Radeon RX 9070 XT 16 GB, driver 32.0.32029.2010; Rust 1.98.1 MSVC, debug.
  • cargo test -p xcl --lib copy_scratch -- --test-threads=4: 3 passed, 0 failed.
  • cargo test --workspace -- --test-threads=4 --nocapture: 752 passed, 0 failed, 41 ignored. The reported passes include tests that return early.
  • SKIPPED: test_title_draws_with_a_root_signature_under_the_debug_layer and uploads_start_from_each_subresources_state (D3D12 debug layer unavailable).

Regression run

main:

xcl-smoke v1
commit: c160d86ef2efe3a07e4dfb473e4fa72eafb413c0
gpu: AMD Radeon RX 9070 XT
title: A newer retail game
seconds: 60
exit: 0x0
frames shown: 1594 (PresentX 1594)
presents per 2 s (last 3): 49 48 14
device removals: 0
crashes: 0
peak commit: 20195 MB

PR:

xcl-smoke v1
commit: 7124a95392e1a6b99db7b3fc5763d1269606c5f3
gpu: AMD Radeon RX 9070 XT
title: A newer retail game
seconds: 60
exit: 0x0
frames shown: 1680 (PresentX 1680)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14843 MB

Not tested

  • Retail title, debug-layer validation, and the end-to-end kickoff/copy path. The budget-exhausted fallback and its logging are unchanged.

AI use

  • Codex (GPT-6): wrote implementation and unit tests, ran validation, and drafted this description.
<!-- greyfinch-sync:ivall/xcl:issue:5475492992 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1421). Originally posted by [hajduzsolt](https://github.com/hajduzsolt) on 2026-11-24T15:47:17Z. --- Runtime fix verified with unit tests and RX 9070 XT smoke run. **What is in it** - `crates/xcl/src/hle/d3d12x/list_x.rs`: retain busy scratch until GPU completion and test replacement and accounting with synthetic D3D12 resources. **Tested** - Windows 11 Pro x64 build 26300, AMD Ryzen 7 9800X3D, AMD Radeon RX 9070 XT 16 GB, driver 32.0.32029.2010; Rust 1.98.1 MSVC, debug. - `cargo test -p xcl --lib copy_scratch -- --test-threads=4`: 3 passed, 0 failed. - `cargo test --workspace -- --test-threads=4 --nocapture`: 752 passed, 0 failed, 41 ignored. The reported passes include tests that return early. - SKIPPED: `test_title_draws_with_a_root_signature_under_the_debug_layer` and `uploads_start_from_each_subresources_state` (D3D12 debug layer unavailable). **Regression run** main: ``` xcl-smoke v1 commit: c160d86ef2efe3a07e4dfb473e4fa72eafb413c0 gpu: AMD Radeon RX 9070 XT title: A newer retail game seconds: 60 exit: 0x0 frames shown: 1594 (PresentX 1594) presents per 2 s (last 3): 49 48 14 device removals: 0 crashes: 0 peak commit: 20195 MB ``` PR: ``` xcl-smoke v1 commit: 7124a95392e1a6b99db7b3fc5763d1269606c5f3 gpu: AMD Radeon RX 9070 XT title: A newer retail game seconds: 60 exit: 0x0 frames shown: 1680 (PresentX 1680) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14843 MB ``` **Not tested** - Retail title, debug-layer validation, and the end-to-end kickoff/copy path. The budget-exhausted fallback and its logging are unchanged. **AI use** - Codex (GPT-6): wrote implementation and unit tests, ran validation, and drafted this description.
pvfreis commented 2026-11-24 17:06:30 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by pvfreis on 2026-11-24T16:34:32Z.


Test report for 7124a95392 (this PR's head) merged onto main 1d027e5c76 (git auto-merged list_x.rs, no conflict). (Edited after a rerun. The first version covered 4c65020 onto b7aa9f3: 770 passed, 1 failed, 41 ignored; main 769/1/41, and noted the log line was missing; 7124a95 added it.) The new test passes on NVIDIA; no other test result changed. I opened #1408. Of its "Expected": a busy scratch moves to released, still charged to the budget, and a new one is made within it; the log line when the budget forces the fallback is now there.

Tested

  • RTX 3060 12 GB (driver 617.14), Ryzen 9 5900XT, Windows 11 26H2 (10.0.26300), Rust 1.100.0 stable MSVC, debug
  • cargo build --workspace --locked --offline, then cargo test --workspace --locked --offline --no-fail-fast -- --test-threads=4:
    • main 1d027e5: 958 passed, 1 failed, 43 ignored
    • this PR merged onto 1d027e5: 959 passed, 1 failed, 43 ignored. The difference is busy_copy_scratch_is_retired_when_budget_allows_a_replacement, which passes; the other two copy-scratch tests pass too, and the log has the new warning (emitted once per process) for a request of 67108864 bytes
  • SKIPPED, the same 22 lines on both: 18 no wave64 (16 in gpu::recomp::lower / lower_dxil, gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware), 3 refused wave32 per-lane cases in f16_programs_on_the_gpu / f32_programs_on_the_gpu, and heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows)
  • The 1 failure is the same on both and not from this PR: test_title_runs_and_game_folder_is_untouched (e2e, presents 0), because these runs are in an isolated non-interactive session where CreateSwapChainForHwnd returns 0x887A0022.

Not tested

  • main after 1d027e5 (689f2db now; the commits since touch only gpu/dxil and gpu/recomp)
  • the warning has no test asserting it
  • kickoff_x / copy_memory_x end to end, the debug layer on this path
  • AMD, Intel; a retail title (no smoke run here)

Run and written with Claude Code (Claude Opus 5.5); counts recomputed from the logs by a second agent (Claude Opus 5.5); text reviewed with Claude Fable 5.2. The runs are real, on the hardware above.

<!-- greyfinch-sync:ivall/xcl:comment:7137880197 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1421#issuecomment-7137880197). Originally posted by [pvfreis](https://github.com/pvfreis) on 2026-11-24T16:34:32Z. --- Test report for 7124a95392e1a6b99db7b3fc5763d1269606c5f3 (this PR's head) merged onto main 1d027e5c76 (git auto-merged `list_x.rs`, no conflict). (Edited after a rerun. The first version covered 4c65020 onto b7aa9f3: 770 passed, 1 failed, 41 ignored; main 769/1/41, and noted the log line was missing; 7124a95 added it.) The new test passes on NVIDIA; no other test result changed. I opened #1408. Of its "Expected": a busy scratch moves to `released`, still charged to the budget, and a new one is made within it; the log line when the budget forces the fallback is now there. **Tested** - RTX 3060 12 GB (driver 617.14), Ryzen 9 5900XT, Windows 11 26H2 (10.0.26300), Rust 1.100.0 stable MSVC, debug - `cargo build --workspace --locked --offline`, then `cargo test --workspace --locked --offline --no-fail-fast -- --test-threads=4`: - main 1d027e5: 958 passed, 1 failed, 43 ignored - this PR merged onto 1d027e5: 959 passed, 1 failed, 43 ignored. The difference is `busy_copy_scratch_is_retired_when_budget_allows_a_replacement`, which passes; the other two copy-scratch tests pass too, and the log has the new warning (emitted once per process) for a request of 67108864 bytes - SKIPPED, the same 22 lines on both: 18 `no wave64` (16 in `gpu::recomp::lower` / `lower_dxil`, `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`), 3 refused wave32 per-lane cases in `f16_programs_on_the_gpu` / `f32_programs_on_the_gpu`, and `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows) - The 1 failure is the same on both and not from this PR: `test_title_runs_and_game_folder_is_untouched` (e2e, `presents` 0), because these runs are in an isolated non-interactive session where `CreateSwapChainForHwnd` returns 0x887A0022. **Not tested** - main after 1d027e5 (689f2db now; the commits since touch only `gpu/dxil` and `gpu/recomp`) - the warning has no test asserting it - `kickoff_x` / `copy_memory_x` end to end, the debug layer on this path - AMD, Intel; a retail title (no smoke run here) Run and written with Claude Code (Claude Opus 5.5); counts recomputed from the logs by a second agent (Claude Opus 5.5); text reviewed with Claude Fable 5.2. The runs are real, on the hardware above.
srcamarda commented 2026-11-24 17:06:40 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by srcamarda on 2026-11-24T16:54:00Z.


Test report for 4c65020 merged onto main 2008399: AMD RDNA3, with the debug layer installed; the retail title does not reach the #1408 path in its first 150 s

Tested

  • AMD Radeon RX 7800 XT 16 GB (RDNA3), driver 32.0.32029.2010; Ryzen 5 5600G, 32 GB; Windows 11 Pro 26300 with Graphics Tools (D3D12 debug layer); rustc 1.100.0; debug for the tests, release for the title.
  • This PR merged onto main 2008399 locally (clean merge, not pushed).
  • cargo test --workspace --no-fail-fast -- --test-threads=4: 752 passed, 0 failed, 41 ignored. No SKIPPED lines. The two debug-layer tests your description lists as skipped ran and passed here: test_title_draws_with_a_root_signature_under_the_debug_layer (which asserts no "invalid for use as a source buffer" since #993) and uploads_start_from_each_subresources_state. The three copy-scratch tests pass, including busy_copy_scratch_is_retired_when_budget_allows_a_replacement.

Retail title under the debug layer

  • Retail title 1.0.2.1, XCL_D3D12_DEBUG=1 XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_RUN_SECONDS=150, Enter (= A) at 30 / 40 / 50 s (title screens into the start of loading). Interleaved main, this PR, main, this PR.
  • XCL logs only the first 8 messages of each id, and id 538 fills that from 2.9 s with other state errors. So for these runs both builds carried the same local diagnostic, not part of this PR: messages that mention CopyBufferRegion are logged with no cap.
  • CopyBufferRegion state errors: 0 in all four runs, main and this PR alike. No device removal or crash; frames shown: main 2157 / 2008, this PR 1698 / 2009.
  • So in these 150 s the title does not reach a copy within one window after a resubmitted list, and this run does not show the effect of the change either way. It also shows no regression.

The id 538 errors the title does hit (same in both builds, and on main 47efa2e before #993; for whoever looks at them, not this PR's):

  • ClearRenderTargetView on a resource in UNORDERED_ACCESS (also once in COPY_SOURCE);
  • CopyResource with its source in RENDER_TARGET;
  • Draw with a render target in NON_PIXEL_SHADER_RESOURCE | PIXEL_SHADER_RESOURCE.

Not tested

  • The world load and later (the title's crash at +0x23cf683, #534, comes after these 150 s on this machine).
  • This PR on its own base; the budget-exhausted fallback.

Claude Code (Claude Opus 5.5), from runs on the hardware above.

<!-- greyfinch-sync:ivall/xcl:comment:7138379461 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1421#issuecomment-7138379461). Originally posted by [srcamarda](https://github.com/srcamarda) on 2026-11-24T16:54:00Z. --- **Test report for `4c65020` merged onto `main` `2008399`: AMD RDNA3, with the debug layer installed; the retail title does not reach the #1408 path in its first 150 s** **Tested** - AMD Radeon RX 7800 XT 16 GB (RDNA3), driver 32.0.32029.2010; Ryzen 5 5600G, 32 GB; Windows 11 Pro 26300 with Graphics Tools (D3D12 debug layer); rustc 1.100.0; debug for the tests, release for the title. - This PR merged onto `main` `2008399` locally (clean merge, not pushed). - `cargo test --workspace --no-fail-fast -- --test-threads=4`: 752 passed, 0 failed, 41 ignored. No `SKIPPED` lines. The two debug-layer tests your description lists as skipped **ran and passed** here: `test_title_draws_with_a_root_signature_under_the_debug_layer` (which asserts no "invalid for use as a source buffer" since #993) and `uploads_start_from_each_subresources_state`. The three copy-scratch tests pass, including `busy_copy_scratch_is_retired_when_budget_allows_a_replacement`. **Retail title under the debug layer** - Retail title 1.0.2.1, `XCL_D3D12_DEBUG=1 XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_RUN_SECONDS=150`, Enter (= A) at 30 / 40 / 50 s (title screens into the start of loading). Interleaved `main`, this PR, `main`, this PR. - XCL logs only the first 8 messages of each id, and id 538 fills that from 2.9 s with other state errors. So for these runs both builds carried the same local diagnostic, not part of this PR: messages that mention `CopyBufferRegion` are logged with no cap. - **`CopyBufferRegion` state errors: 0 in all four runs**, `main` and this PR alike. No device removal or crash; frames shown: `main` 2157 / 2008, this PR 1698 / 2009. - So in these 150 s the title does not reach a copy within one window after a resubmitted list, and this run does not show the effect of the change either way. It also shows no regression. **The id 538 errors the title does hit** (same in both builds, and on `main` `47efa2e` before #993; for whoever looks at them, not this PR's): - `ClearRenderTargetView` on a resource in `UNORDERED_ACCESS` (also once in `COPY_SOURCE`); - `CopyResource` with its source in `RENDER_TARGET`; - `Draw` with a render target in `NON_PIXEL_SHADER_RESOURCE | PIXEL_SHADER_RESOURCE`. **Not tested** - The world load and later (the title's crash at `+0x23cf683`, #534, comes after these 150 s on this machine). - This PR on its own base; the budget-exhausted fallback. _Claude Code (Claude Opus 5.5), from runs on the hardware above._
DavidM1911 commented 2026-11-24 18:08:59 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T17:21:23Z.


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

  • cargo test -p xcl --lib: all passed, 0 failed, ~21 ignored.

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7139070008 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1421#issuecomment-7139070008). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T17:21:23Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~21 ignored. Thanks!
enderrr9 commented 2026-11-24 18:09:17 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by enderrr9 on 2026-11-24T18:00:31Z.


Test report: NVIDIA, 32-lane waves, head 4c65020

Tested

  • NVIDIA GeForce RTX 3050 Laptop GPU (4 GB, driver 621.24), AMD Ryzen 5 4600H, Windows 11 build 26300, rustc 1.100.0 (MSVC), DXC 1.8.2502.11, debug build
  • cargo test -p xcl --lib copy_scratch -- --test-threads=4 --nocapture: 3 passed, 0 failed (a_new_list_takes_no_copy_scratch_of_an_earlier_one, busy_copy_scratch_is_retired_when_budget_allows_a_replacement, copy_scratch_budget_counts_resources_until_gpu_completion), none SKIPPED
  • cargo test --workspace -- --test-threads=4: 752 passed, 0 failed, 41 ignored. SKIPPED: gpu_geometry_wave32_prefix_count_over_a_mask (no wave64), gpu_wave32_program_in_wave64_hardware (no wave64)

Not tested

  • a retail title (I have none), the D3D12 debug layer, whether the new test fails without the change

Report written and the tests run with Claude Code (Claude Opus 5.5).

<!-- greyfinch-sync:ivall/xcl:comment:7140022836 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1421#issuecomment-7140022836). Originally posted by [enderrr9](https://github.com/enderrr9) on 2026-11-24T18:00:31Z. --- **Test report: NVIDIA, 32-lane waves**, head `4c65020` **Tested** - NVIDIA GeForce RTX 3050 Laptop GPU (4 GB, driver 621.24), AMD Ryzen 5 4600H, Windows 11 build 26300, rustc 1.100.0 (MSVC), DXC 1.8.2502.11, debug build - `cargo test -p xcl --lib copy_scratch -- --test-threads=4 --nocapture`: 3 passed, 0 failed (`a_new_list_takes_no_copy_scratch_of_an_earlier_one`, `busy_copy_scratch_is_retired_when_budget_allows_a_replacement`, `copy_scratch_budget_counts_resources_until_gpu_completion`), none SKIPPED - `cargo test --workspace -- --test-threads=4`: 752 passed, 0 failed, 41 ignored. SKIPPED: `gpu_geometry_wave32_prefix_count_over_a_mask` (no wave64), `gpu_wave32_program_in_wave64_hardware` (no wave64) **Not tested** - a retail title (I have none), the D3D12 debug layer, whether the new test fails without the change Report written and the tests run with Claude Code (Claude Opus 5.5).
hajduzsolt commented 2026-11-24 21:08:47 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by hajduzsolt on 2026-11-24T19:23:35Z.


Thanks for noting the missing diagnostic. Budget-driven scratch refusals now emit a one-time warning before using the in-place fallback, including requests larger than the budget. The existing budget-exhaustion test and cargo test --workspace -- --test-threads=2 passed (708 library tests passed, 21 ignored).

<!-- greyfinch-sync:ivall/xcl:comment:7142030915 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1421#issuecomment-7142030915). Originally posted by [hajduzsolt](https://github.com/hajduzsolt) on 2026-11-24T19:23:35Z. --- Thanks for noting the missing diagnostic. Budget-driven scratch refusals now emit a one-time warning before using the in-place fallback, including requests larger than the budget. The existing budget-exhaustion test and `cargo test --workspace -- --test-threads=2` passed (708 library tests passed, 21 ignored).
DavidM1911 commented 2026-11-26 06:06:38 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T05:13:07Z.


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

  • cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.

Thanks!

— Devin

<!-- greyfinch-sync:ivall/xcl:comment:7183286912 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1421#issuecomment-7183286912). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-26T05:13:07Z. --- Re-verification on RTX 3060 Ti (Windows 11), new head merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved. Thanks! — Devin
Foniass commented 2026-12-01 05:41:50 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T05:41:50Z.


Triage (#1607) – head 7124a95

No open or merged PR makes the same change; main's CopyScratchCache::acquire still returns None when the list's scratch is still in flight. #3111 also touches the copy scratch, but only moves the drop outside the lock.
No problems found in the diff: the busy scratch moves to released and stays charged until its fence passes, and the budget is checked before the replacement is made.
Recommendation: keep open.

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:7302041021 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1421#issuecomment-7302041021). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T05:41:50Z. --- **Triage (#1607)** – head 7124a95 No open or merged PR makes the same change; main's `CopyScratchCache::acquire` still returns `None` when the list's scratch is still in flight. #3111 also touches the copy scratch, but only moves the drop outside the lock. No problems found in the diff: the busy scratch moves to `released` and stays charged until its fence passes, and the budget is checked before the replacement is made. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
fromthemoonx commented 2026-12-01 13:27:25 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by fromthemoonx on 2026-12-01T13:27:25Z.


merge-check
base: b2b1f109d2
head: 7124a95392
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2902 passed, 1 failed, 51 ignored (second run; base alone: 2902 passed, 0 failed, 51 ignored); SKIPPED: 25 (22 no wave64, 2 no heap windows, 1 no GPU_UPLOAD heaps), same set as base; failing: not this PR. Run 2: hle::xaudio2::tests::xma2_source_voice_decodes_and_manages_lifetime (left: 2, right: 1 at xaudio2.rs:1793) failed once; it passes 3 of 3 alone on both the merge and base, and hle::xaudio2:: 5 of 5 at 8 threads on both. Run 1: the lib binary was ended with exit code 0x7C10003 by uma_driver::tests::mixed_window_keeps_its_bytes_and_the_gpu_sees_every_segment ("coherent window could not be restored"), the known problem #3187 addresses.
review: no correctness problem found after reading the whole diff (1 file, +61 -8). A list reset while its scratch is still in flight now moves that scratch to released (charged until its fence passes) and makes a new one when the budget allows, instead of returning None; budget refusals warn once.

  • The new busy_copy_scratch_is_retired_when_budget_allows_a_replacement and the two older copy-scratch tests pass 30 of 30 alone each on this GPU (it creates a real device and fence, not skipped).
  • Mutation: the busy path back to return None (main's behaviour) fails the new test. Good.
  • list_x::tests:: 60 runs at --test-threads=8: no copy-scratch test failed. bundle_generations_propagate_and_final_release_runs_outside_lists ("final COM Release ran under LISTS") failed 7 of 60 on the merge and 8 of 60 on base (2 of 30 on the merge with the new test skipped), so it is a pre-existing flake, not this PR. One E_OUTOFMEMORY in write_buffer_immediate_on_open_existing_heap_visible_to_cpu, a known parallel flake.
  • Minor, from reading only: a scratch whose submission could not be fenced (untracked_submission, when CreateFence/Signal fails in copy_scratch_submitted) never becomes idle. On main that list keeps its one stuck scratch and gets None. With this PR each reset moves it to released, where it stays charged for good, and a new one is made, so repeated resets can fill the 64 MB budget for every list. Only reached when fencing fails (e.g. a lost device). Keeping the old behaviour when untracked_submission is set would avoid it.
  • No retail title on this machine: the copy path in a real title was not run here (the PR's own smoke pair is on an RX 9070 XT).
    performance: not measured here. Up to one extra scratch per list in flight, inside the existing 64 MB budget; copies that used to take the in-place fallback while the scratch was busy now get a scratch.
    verdict: safe to merge
    hardware / tool and model: RTX 3060 12 GB (610.88), Ryzen 7 5700X, Windows 11 Pro 26300 / Claude Code (Claude Opus 5.5)
<!-- greyfinch-sync:ivall/xcl:comment:7312653692 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1421#issuecomment-7312653692). Originally posted by [fromthemoonx](https://github.com/fromthemoonx) on 2026-12-01T13:27:25Z. --- merge-check base: b2b1f109d27e746a62ec95b04dd1f9924452e682 head: 7124a95392e1a6b99db7b3fc5763d1269606c5f3 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2902 passed, 1 failed, 51 ignored (second run; base alone: 2902 passed, 0 failed, 51 ignored); SKIPPED: 25 (22 no wave64, 2 no heap windows, 1 no GPU_UPLOAD heaps), same set as base; failing: not this PR. Run 2: `hle::xaudio2::tests::xma2_source_voice_decodes_and_manages_lifetime` (`left: 2, right: 1` at xaudio2.rs:1793) failed once; it passes 3 of 3 alone on both the merge and base, and `hle::xaudio2::` 5 of 5 at 8 threads on both. Run 1: the lib binary was ended with exit code 0x7C10003 by `uma_driver::tests::mixed_window_keeps_its_bytes_and_the_gpu_sees_every_segment` ("coherent window could not be restored"), the known problem #3187 addresses. review: no correctness problem found after reading the whole diff (1 file, +61 -8). A list reset while its scratch is still in flight now moves that scratch to `released` (charged until its fence passes) and makes a new one when the budget allows, instead of returning `None`; budget refusals warn once. - The new `busy_copy_scratch_is_retired_when_budget_allows_a_replacement` and the two older copy-scratch tests pass 30 of 30 alone each on this GPU (it creates a real device and fence, not skipped). - Mutation: the busy path back to `return None` (main's behaviour) fails the new test. Good. - `list_x::tests::` 60 runs at --test-threads=8: no copy-scratch test failed. `bundle_generations_propagate_and_final_release_runs_outside_lists` ("final COM Release ran under LISTS") failed 7 of 60 on the merge and 8 of 60 on base (2 of 30 on the merge with the new test skipped), so it is a pre-existing flake, not this PR. One E_OUTOFMEMORY in `write_buffer_immediate_on_open_existing_heap_visible_to_cpu`, a known parallel flake. - Minor, from reading only: a scratch whose submission could not be fenced (`untracked_submission`, when `CreateFence`/`Signal` fails in `copy_scratch_submitted`) never becomes idle. On main that list keeps its one stuck scratch and gets `None`. With this PR each reset moves it to `released`, where it stays charged for good, and a new one is made, so repeated resets can fill the 64 MB budget for every list. Only reached when fencing fails (e.g. a lost device). Keeping the old behaviour when `untracked_submission` is set would avoid it. - No retail title on this machine: the copy path in a real title was not run here (the PR's own smoke pair is on an RX 9070 XT). performance: not measured here. Up to one extra scratch per list in flight, inside the existing 64 MB budget; copies that used to take the in-place fallback while the scratch was busy now get a scratch. verdict: safe to merge hardware / tool and model: RTX 3060 12 GB (610.88), Ryzen 7 5700X, Windows 11 Pro 26300 / Claude Code (Claude Opus 5.5)
vasanex commented 2026-12-02 00:54:03 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by vasanex on 2026-12-02T00:54:03Z.


merge-check claim
head: 7124a95392

<!-- greyfinch-sync:ivall/xcl:comment:7331083832 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1421#issuecomment-7331083832). Originally posted by [vasanex](https://github.com/vasanex) on 2026-12-02T00:54:03Z. --- merge-check claim head: 7124a95392e1a6b99db7b3fc5763d1269606c5f3
vasanex commented 2026-12-02 01:07:16 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by vasanex on 2026-12-02T01:07:16Z.


merge-check
base: 1c8b551475
head: 7124a95392
merge: clean (merged tree a0b9a608, git diff --check clean)
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2910 passed, 0 failed, 51 ignored; SKIPPED: 25 (22 no wave64, 2 no heap windows, 1 cannot disable the driver cache), the same set as on the base; failing: none. Base alone, same machine: 2909 passed, 0 failed, 51 ignored. The new test busy_copy_scratch_is_retired_when_budget_allows_a_replacement and the two existing copy-scratch tests pass.
review: whole diff read (one file, list_x.rs, +61/-8), in the merge result. No blocking finding. Before, a list whose scratch was still in flight on another queue got no scratch (None, the in-place fallback); now the busy buffer moves to released, stays counted in self.bytes until its fences are done (collect_released), and a new one is made if the 64 MiB budget has room for both, else None as before. The budget is checked before the move and again before the allocation, so the total cannot pass the cap. The idle and recorded cases are unchanged apart from the indentation. The warning is logged once per process. Small points: the test builds the busy state by hand (recorded = false plus a fence mark), so the real reset-while-executing path is covered by reasoning only; the once-only warning gives the first request's size, later ones are silent.
performance: 60 s smoke of the same title, release, default settings, same machine, one run each. Base 1c8b5514: 1608 frames shown, presents per 2 s (last 3) 60 60 61, 0 device removals, 0 crashes, peak commit 19911 MB. Merge result (local merge commit): 1539 frames shown, 60 60 60, 0 device removals, 0 crashes, peak commit 19677 MB. 96 % of the base's frames with the same rate at the end; I take the difference as start-up spread (one run each), not as an effect. The run logged no copy-scratch warning, so it did not reach the budget. By default the change can hold up to 64 MiB of scratch, the existing cap, where main fell back to the in-place path.
verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 3080 10 GB (driver 621.40), AMD Ryzen 9 7950X, Windows 11 Pro 26200, rustc 1.100.0, debug suite and release smoke / Claude Code with Claude Fable 5.2. Run and posted without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7331337785 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1421#issuecomment-7331337785). Originally posted by [vasanex](https://github.com/vasanex) on 2026-12-02T01:07:16Z. --- merge-check base: 1c8b551475e1e7bfe48f94448492a4c3544a2e0f head: 7124a95392e1a6b99db7b3fc5763d1269606c5f3 merge: clean (merged tree a0b9a608, `git diff --check` clean) build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2910 passed, 0 failed, 51 ignored; SKIPPED: 25 (22 no wave64, 2 no heap windows, 1 cannot disable the driver cache), the same set as on the base; failing: none. Base alone, same machine: 2909 passed, 0 failed, 51 ignored. The new test `busy_copy_scratch_is_retired_when_budget_allows_a_replacement` and the two existing copy-scratch tests pass. review: whole diff read (one file, list_x.rs, +61/-8), in the merge result. No blocking finding. Before, a list whose scratch was still in flight on another queue got no scratch (`None`, the in-place fallback); now the busy buffer moves to `released`, stays counted in `self.bytes` until its fences are done (`collect_released`), and a new one is made if the 64 MiB budget has room for both, else `None` as before. The budget is checked before the move and again before the allocation, so the total cannot pass the cap. The idle and recorded cases are unchanged apart from the indentation. The warning is logged once per process. Small points: the test builds the busy state by hand (`recorded = false` plus a fence mark), so the real reset-while-executing path is covered by reasoning only; the once-only warning gives the first request's size, later ones are silent. performance: 60 s smoke of the same title, release, default settings, same machine, one run each. Base 1c8b5514: 1608 frames shown, presents per 2 s (last 3) 60 60 61, 0 device removals, 0 crashes, peak commit 19911 MB. Merge result (local merge commit): 1539 frames shown, 60 60 60, 0 device removals, 0 crashes, peak commit 19677 MB. 96 % of the base's frames with the same rate at the end; I take the difference as start-up spread (one run each), not as an effect. The run logged no copy-scratch warning, so it did not reach the budget. By default the change can hold up to 64 MiB of scratch, the existing cap, where main fell back to the in-place path. verdict: safe to merge hardware / tool and model: NVIDIA GeForce RTX 3080 10 GB (driver 621.40), AMD Ryzen 9 7950X, Windows 11 Pro 26200, rustc 1.100.0, debug suite and release smoke / Claude Code with Claude Fable 5.2. Run and posted without a human check of each point.
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/1421:upstream-pr/1421'
git switch 'upstream-pr/1421'

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/1421'
git switch 'upstream-pr/1421'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1421'
git switch 'upstream-pr/1421'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1421'
git switch 'main'
git merge --squash 'upstream-pr/1421'
git switch 'main'
git merge --ff-only 'upstream-pr/1421'
git switch 'main'
git merge 'upstream-pr/1421'
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!1411
No description provided.