D3D12.X: a reused spare keeps the allocator of deferred work still on the GPU #2539

Open
tiagonleal wants to merge 1 commit from upstream-pr/2549 into main
tiagonleal commented 2026-11-25 22:41:22 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by tiagonleal on 2026-11-25T22:41:22Z.


Since #2118 a dispatch whose pipeline is still being built gets a segment of its own, recorded at the submit on an allocator that prepare_deferred_segment creates and keeps in the ListState of the recording's first segment (own_alloc). That ListState holds the only reference. When the first segment is a stand-in (#1452: the title reset the list while its last submit was on the GPU), the next Reset puts it among the wrapper's spares. A later split_recording takes the spare as soon as its own submit is done, removes its ListState and drops it, and the allocator is released. on_release keeps such an allocator while alloc_pool::allocator_in_flight says the GPU may still use it; split_recording had no such guard.

The deferred segments can still be running then. With a Wait64BitValueX between the first segment and a deferred dispatch, execute_with_waits_on submits them in two blocks with their own fence values, so the first segment's block can finish while the block with the deferred segment is still waiting for its producer. The GPU then runs a list whose allocator was destroyed.

split_recording now keeps own_alloc of the reused spare's old state, moved into its new one, only while alloc_pool::allocator_in_flight says the GPU may still run work recorded on it. Kept, the allocator stays with its PC list as it did while the list was a spare, and on_release keeps it while it is in flight. Once the GPU is done with it, it goes with the old state, released outside the LISTS lock as before this change. Moving it unconditionally would leave it, and the scratch of its split dispatches (dispatch_chain::RECORDINGS), charged against XCL_SPLIT_SCRATCH_TOTAL_MB: from then on the list is reset only through alloc_pool::reset_list (split_recording, prepare_deferred_segment, record_deferred), not reset_pc, so reset_own_alloc does not run for it. No tracked issue covers this; #2118 added the allocator, and #2320 and #2417 touch the same code without changing how it is kept.

Rebased onto main 0fe06eb0; split_recording still drops the old own_alloc, the conflict was only where the tests sit.

What is in it

  • list_x.rs: split_recording keeps the own_alloc of a spare it reuses while allocator_in_flight says the GPU may still use it, and releases it with the old state otherwise
  • Test a_spare_reused_by_a_split_keeps_an_own_allocator_still_on_the_gpu: a spare holding the allocator of a deferred segment held on the GPU by a queue Wait is reused by a split; the allocator must still be referenced
  • Test a_spare_reused_by_a_split_drops_an_own_allocator_the_gpu_is_done_with: the same spare once the GPU is done with it; the reused spare's state must not keep the allocator

Tested

  • Windows 11 Pro 10.0.26300, NVIDIA GeForce RTX 5070 Ti 16 GB (driver 617.42), AMD Ryzen 7 9800X3D, 32 GB RAM, rustc 1.100.0
  • New tests: cargo test -p xcl --lib -- a_spare_reused_by_a_split: 2 passed, 0 failed, 3 of 3 runs on 468f8dfb. With main's behaviour (the allocator dropped with the old state) the first fails: the allocator of work still on the GPU stays held, reference count 2, 3 expected. With the allocator moved unconditionally, as in the first version of this PR, the second fails: the reused spare's state keeps no allocator the GPU is done with.
  • cargo test -p xcl --lib -- hle::d3d12x --test-threads=4 (run on the earlier head a0418344, not repeated on 468f8dfb), 3 runs: 254 passed, 0 failed, 2 ignored in two runs; in one run 253 passed, 1 failed (a_dispatch_with_a_pipeline_still_building_waits_at_the_submit, 289 segments of 421). That test fails the same way now and then on main 6d12f58a without this change (127 of 421 in an earlier run here).
  • cargo test --workspace --no-fail-fast -- --test-threads=4, run twice on 468f8dfb: 1421 passed, 4 failed, 46 ignored both times (25 SKIPPED lines). The 4 failures are gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3 (E_OUTOFMEMORY), which failed the same way on this machine without this change in earlier runs.
  • After the rebase onto main 0fe06eb0 (head 72843a1d): cargo test --workspace --no-fail-fast -j 8 -- --test-threads=4: 2739 passed, 0 failed, 49 ignored (27 SKIPPED lines); main 0fe06eb0 on this machine: 2737 passed, 0 failed, 49 ignored. This is the third run on this head: the first two ended early when the lib test binary aborted, the first in the xcl-pso-ahead abort described in #3180 (a test of main this PR does not touch); I did not keep the log of the second. The other results in this section are from the earlier heads named in them.

Regression run
scripts/smoke.ps1 -Seconds 60 -Title 9cc6a39e (Newer Retail Game), release builds of both commits in clean trees, main 0fe06eb0 first, one run each, in one queue with this account's other PRs. Both runs had XCL_PREPARE=0 and the same warm DXIL cache. A warm-up run of main came before them and is not shown. A second run of main at the end of the queue showed 1697 frames and a peak commit of 15618 MB, so differences of a few tens of frames between runs are noise here.

main (0fe06eb0):

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

This PR (72843a1d):

xcl-smoke v1
commit: 72843a1d4d9f2194cee4a1ab41d397e84ba13554
gpu: NVIDIA GeForce RTX 5070 Ti
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1698 (PresentX 1698)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15531 MB

Not tested

  • Whether the retail title records a deferred dispatch after a Wait64BitValueX on a list with a stand-in first segment: not known. No device removal on the retail title has been traced to this; the fix comes from reading the code and the unit test.
  • The same unguarded drop in on_create (a list created at the address of one whose release was not seen) is left as it is: it needs a lost Release and has no test here.
  • AMD, other drivers; the debug layer was not run.
  • @GodlyBDS saw the test fixture fault (0xc0000005 inside split) under Agility SDK v620, with and without this change; not reproduced here and not looked into.

AI use

  • Claude Code with Claude Fable 5.2 and Anthropic subagents (Claude Opus 5.5) helped developing.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:5500422732 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2549). Originally posted by [tiagonleal](https://github.com/tiagonleal) on 2026-11-25T22:41:22Z. --- Since #2118 a dispatch whose pipeline is still being built gets a segment of its own, recorded at the submit on an allocator that `prepare_deferred_segment` creates and keeps in the `ListState` of the recording's first segment (`own_alloc`). That `ListState` holds the only reference. When the first segment is a stand-in (#1452: the title reset the list while its last submit was on the GPU), the next Reset puts it among the wrapper's spares. A later `split_recording` takes the spare as soon as its own submit is done, removes its `ListState` and drops it, and the allocator is released. `on_release` keeps such an allocator while `alloc_pool::allocator_in_flight` says the GPU may still use it; `split_recording` had no such guard. The deferred segments can still be running then. With a `Wait64BitValueX` between the first segment and a deferred dispatch, `execute_with_waits_on` submits them in two blocks with their own fence values, so the first segment's block can finish while the block with the deferred segment is still waiting for its producer. The GPU then runs a list whose allocator was destroyed. `split_recording` now keeps `own_alloc` of the reused spare's old state, moved into its new one, only while `alloc_pool::allocator_in_flight` says the GPU may still run work recorded on it. Kept, the allocator stays with its PC list as it did while the list was a spare, and `on_release` keeps it while it is in flight. Once the GPU is done with it, it goes with the old state, released outside the `LISTS` lock as before this change. Moving it unconditionally would leave it, and the scratch of its split dispatches (`dispatch_chain::RECORDINGS`), charged against `XCL_SPLIT_SCRATCH_TOTAL_MB`: from then on the list is reset only through `alloc_pool::reset_list` (`split_recording`, `prepare_deferred_segment`, `record_deferred`), not `reset_pc`, so `reset_own_alloc` does not run for it. No tracked issue covers this; #2118 added the allocator, and #2320 and #2417 touch the same code without changing how it is kept. *Rebased onto `main` `0fe06eb0`; `split_recording` still drops the old `own_alloc`, the conflict was only where the tests sit.* **What is in it** - `list_x.rs`: `split_recording` keeps the `own_alloc` of a spare it reuses while `allocator_in_flight` says the GPU may still use it, and releases it with the old state otherwise - Test `a_spare_reused_by_a_split_keeps_an_own_allocator_still_on_the_gpu`: a spare holding the allocator of a deferred segment held on the GPU by a queue Wait is reused by a split; the allocator must still be referenced - Test `a_spare_reused_by_a_split_drops_an_own_allocator_the_gpu_is_done_with`: the same spare once the GPU is done with it; the reused spare's state must not keep the allocator **Tested** - Windows 11 Pro 10.0.26300, NVIDIA GeForce RTX 5070 Ti 16 GB (driver 617.42), AMD Ryzen 7 9800X3D, 32 GB RAM, rustc 1.100.0 - New tests: `cargo test -p xcl --lib -- a_spare_reused_by_a_split`: 2 passed, 0 failed, 3 of 3 runs on 468f8dfb. With `main`'s behaviour (the allocator dropped with the old state) the first fails: `the allocator of work still on the GPU stays held`, reference count 2, 3 expected. With the allocator moved unconditionally, as in the first version of this PR, the second fails: `the reused spare's state keeps no allocator the GPU is done with`. - `cargo test -p xcl --lib -- hle::d3d12x --test-threads=4` (run on the earlier head a0418344, not repeated on 468f8dfb), 3 runs: 254 passed, 0 failed, 2 ignored in two runs; in one run 253 passed, 1 failed (`a_dispatch_with_a_pipeline_still_building_waits_at_the_submit`, 289 segments of 421). That test fails the same way now and then on `main` 6d12f58a without this change (127 of 421 in an earlier run here). - `cargo test --workspace --no-fail-fast -- --test-threads=4`, run twice on 468f8dfb: 1421 passed, 4 failed, 46 ignored both times (25 `SKIPPED` lines). The 4 failures are `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3` (E_OUTOFMEMORY), which failed the same way on this machine without this change in earlier runs. - After the rebase onto `main` `0fe06eb0` (head `72843a1d`): `cargo test --workspace --no-fail-fast -j 8 -- --test-threads=4`: 2739 passed, 0 failed, 49 ignored (27 `SKIPPED` lines); `main` `0fe06eb0` on this machine: 2737 passed, 0 failed, 49 ignored. This is the third run on this head: the first two ended early when the lib test binary aborted, the first in the `xcl-pso-ahead` abort described in #3180 (a test of `main` this PR does not touch); I did not keep the log of the second. The other results in this section are from the earlier heads named in them. **Regression run** `scripts/smoke.ps1 -Seconds 60 -Title 9cc6a39e` (Newer Retail Game), release builds of both commits in clean trees, `main` `0fe06eb0` first, one run each, in one queue with this account's other PRs. Both runs had `XCL_PREPARE=0` and the same warm DXIL cache. A warm-up run of `main` came before them and is not shown. A second run of `main` at the end of the queue showed 1697 frames and a peak commit of 15618 MB, so differences of a few tens of frames between runs are noise here. `main` (`0fe06eb0`): ``` xcl-smoke v1 commit: 0fe06eb0f05459007ebfffc67bb9983acb3a832d gpu: NVIDIA GeForce RTX 5070 Ti title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1687 (PresentX 1687) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15383 MB ``` This PR (`72843a1d`): ``` xcl-smoke v1 commit: 72843a1d4d9f2194cee4a1ab41d397e84ba13554 gpu: NVIDIA GeForce RTX 5070 Ti title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1698 (PresentX 1698) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15531 MB ``` **Not tested** - Whether the retail title records a deferred dispatch after a `Wait64BitValueX` on a list with a stand-in first segment: not known. No device removal on the retail title has been traced to this; the fix comes from reading the code and the unit test. - The same unguarded drop in `on_create` (a list created at the address of one whose release was not seen) is left as it is: it needs a lost Release and has no test here. - AMD, other drivers; the debug layer was not run. - @GodlyBDS saw the test fixture fault (0xc0000005 inside `split`) under Agility SDK v620, with and without this change; not reproduced here and not looked into. **AI use** - Claude Code with Claude Fable 5.2 and Anthropic subagents (Claude Opus 5.5) helped developing. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
copilot-pull-request-reviewer[bot] commented 2026-11-25 22:41:36 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-25T22:41:36Z.

Review: COMMENTED


Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

<!-- greyfinch-sync:ivall/xcl:review:6065983756 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2549#pullrequestreview-6065983756). Originally posted by [copilot-pull-request-reviewer[bot]](https://github.com/apps/copilot-pull-request-reviewer) on 2026-11-25T22:41:36Z. **Review:** COMMENTED --- Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level. An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. [Learn about Copilot code review billing](https://docs.github.com/en/copilot/concepts/agents/code-review#code-review-usage).
xpatfussy69x commented 2026-11-25 23:09:20 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by xpatfussy69x on 2026-11-25T22:57:10Z.


Test run on exact head a041834 (a041834420f21e8d80e3eb76ee85d180b6509993, on its base e1d84b7, current main), clean tree.

Tested

  • NVIDIA GeForce RTX 3060 12 GB (driver 32.0.16.2124, 32-lane waves only), AMD Ryzen 5 7500F, Windows 11, Rust 1.100.0; debug build for the tests, release for the smoke runs
  • cargo test --workspace -- --test-threads=4: 1424 passed, 0 failed, 46 ignored
  • SKIPPED (25): 21 × no wave64; 1 × no heap windows; 3 × per-lane form refused V_MUL_F16 / V_PK_MUL_F16 / V_CVT_F16_F32 (on main too)
  • cargo test -p xcl --lib a_spare_reused_by_a_split: 1 passed, 0 failed
  • This PR's new tests in the workspace run:
    • a_spare_reused_by_a_split_keeps_an_own_allocator_still_on_the_gpu: ok
  • Conflicts with #2548 in crates/xcl/src/hle/d3d12x/list_x.rs (git merge-tree of both heads); whichever lands second needs a rebase

Regression run (60 s, default settings, a retail title)

main:

xcl-smoke v1
commit: e1d84b7d9153f86a97d2ec5d209d196046fc0bea
gpu: NVIDIA GeForce RTX 3060
title: c3f791f3
seconds: 60
exit: 0x0
frames shown: 1091 (PresentX 1091)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14814 MB

this PR:

xcl-smoke v1
commit: a041834420f21e8d80e3eb76ee85d180b6509993
gpu: NVIDIA GeForce RTX 3060
title: c3f791f3
seconds: 60
exit: 0x0
frames shown: 1099 (PresentX 1099)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14787 MB

No crash or device removal; frames 101 % of main's, peak commit 100 %.

Not tested

  • Whether the title reuses a spare list for a split dispatch in this run: a regression check only
  • AMD / native wave64

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and both smoke runs on the machine above and wrote this report.
<!-- greyfinch-sync:ivall/xcl:comment:7176975883 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2549#issuecomment-7176975883). Originally posted by [xpatfussy69x](https://github.com/xpatfussy69x) on 2026-11-25T22:57:10Z. --- Test run on exact head `a041834` (`a041834420f21e8d80e3eb76ee85d180b6509993`, on its base `e1d84b7`, current `main`), clean tree. **Tested** - NVIDIA GeForce RTX 3060 12 GB (driver 32.0.16.2124, 32-lane waves only), AMD Ryzen 5 7500F, Windows 11, Rust 1.100.0; debug build for the tests, release for the smoke runs - `cargo test --workspace -- --test-threads=4`: 1424 passed, 0 failed, 46 ignored - SKIPPED (25): 21 × no wave64; 1 × no heap windows; 3 × per-lane form refused `V_MUL_F16` / `V_PK_MUL_F16` / `V_CVT_F16_F32` (on `main` too) - `cargo test -p xcl --lib a_spare_reused_by_a_split`: 1 passed, 0 failed - This PR's new tests in the workspace run: - `a_spare_reused_by_a_split_keeps_an_own_allocator_still_on_the_gpu`: ok - Conflicts with #2548 in `crates/xcl/src/hle/d3d12x/list_x.rs` (`git merge-tree` of both heads); whichever lands second needs a rebase **Regression run** (60 s, default settings, a retail title) main: ``` xcl-smoke v1 commit: e1d84b7d9153f86a97d2ec5d209d196046fc0bea gpu: NVIDIA GeForce RTX 3060 title: c3f791f3 seconds: 60 exit: 0x0 frames shown: 1091 (PresentX 1091) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14814 MB ``` this PR: ``` xcl-smoke v1 commit: a041834420f21e8d80e3eb76ee85d180b6509993 gpu: NVIDIA GeForce RTX 3060 title: c3f791f3 seconds: 60 exit: 0x0 frames shown: 1099 (PresentX 1099) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14787 MB ``` No crash or device removal; frames 101 % of `main`'s, peak commit 100 %. **Not tested** - Whether the title reuses a spare list for a split dispatch in this run: a regression check only - AMD / native wave64 **AI use** - Claude Code (Claude Opus 5.5) ran the tests and both smoke runs on the machine above and wrote this report.
futurepro62 commented 2026-11-25 23:09:21 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-25T22:55:40Z.


Full-suite run, since this PR has no test report yet. Tested exact head a041834 (on its base e1d84b7).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests: 1412 passed, 0 failed, 44 ignored. SKIPPED (no wave64): a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu, a_per_lane_2d_or_3d_group_runs_on_the_gpu, coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu, cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu, dispatch_chain_native_wave64_builds_whole, gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware, the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu.
  • The new tests ran and passed: a_spare_reused_by_a_split_keeps_an_own_allocator_still_on_the_gpu.
  • Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 1423 passed, 0 failed, 46 ignored. SKIPPED: f16_programs_on_the_gpu (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), f32_programs_on_the_gpu (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), f32_programs_on_the_gpu (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • --skip leaves out tests that fail on main e1d84b7 too, not because of this PR. On NVIDIA: heap_window_out_of_memory_falls_back_to_the_switch_form (#1651), the four gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu tests, const_and_null_mask_operands_agree_with_hlsl_on_the_gpu and mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu (follow-up on #1651) fail because runner::skip_test turns their skips into failures under XCL_REQUIRE_GPU=mesh, and gpu::dxil::fuzz_tests seeds 70, 545, 1019 and 1507 fail CreateComputePipelineState with E_OUTOFMEMORY on this card (drivers 616.64 and 621.40). On AMD: fuzz_validate_and_gpu_1 fails on seed 540 (res[833] 0x7 vs CPU 0x6). The AMD run does not set XCL_REQUIRE_GPU.

Not tested

  • a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
<!-- greyfinch-sync:ivall/xcl:comment:7176947584 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2549#issuecomment-7176947584). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-25T22:55:40Z. --- Full-suite run, since this PR has no test report yet. Tested exact head `a041834` (on its base `e1d84b7`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests`: **1412 passed, 0 failed, 44 ignored**. SKIPPED (no wave64): `a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu`, `a_per_lane_2d_or_3d_group_runs_on_the_gpu`, `coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu`, `cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu`, `dispatch_chain_native_wave64_builds_whole`, `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`, `the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu`. - The new tests ran and passed: `a_spare_reused_by_a_split_keeps_an_own_allocator_still_on_the_gpu`. - Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1`: **1423 passed, 0 failed, 46 ignored**. SKIPPED: `f16_programs_on_the_gpu` (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), `f32_programs_on_the_gpu` (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), `f32_programs_on_the_gpu` (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). - `--skip` leaves out tests that fail on main `e1d84b7` too, not because of this PR. On NVIDIA: `heap_window_out_of_memory_falls_back_to_the_switch_form` (#1651), the four `gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu` tests, `const_and_null_mask_operands_agree_with_hlsl_on_the_gpu` and `mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu` ([follow-up on #1651](https://github.com/xcl-dev/xcl/issues/1651#issuecomment-7146069648)) fail because `runner::skip_test` turns their skips into failures under `XCL_REQUIRE_GPU=mesh`, and `gpu::dxil::fuzz_tests` seeds 70, 545, 1019 and 1507 fail `CreateComputePipelineState` with `E_OUTOFMEMORY` on this card (drivers 616.64 and 621.40). On AMD: `fuzz_validate_and_gpu_1` fails on seed 540 (`res[833]` 0x7 vs CPU 0x6). The AMD run does not set `XCL_REQUIRE_GPU`. **Not tested** - a release build, a game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
DavidM1911 commented 2026-11-25 23:09:23 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T23:06:52Z.


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

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

Thanks!

— Devin

<!-- greyfinch-sync:ivall/xcl:comment:7177162184 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2549#issuecomment-7177162184). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T23:06:52Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, 26 ignored. Thanks! — Devin
emirduran707 commented 2026-11-26 00:05:43 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by emirduran707 on 2026-11-25T23:43:43Z.


Independent AMD RDNA4 (native wave64) verification of exact PR head a041834420f21e8d80e3eb76ee85d180b6509993 on Windows 11 Pro 26300 (AMD Radeon RX 9060 XT 16 GB, driver 32.0.31044.16, Ryzen 5 5600, Rust 1.100.0 MSVC, DXC 1.9.2602.17).

Tested

  • cargo build --workspace (debug): passed (0 errors).
  • cargo test --workspace --no-fail-fast -- --test-threads=4: 1422 passed, 2 failed, 46 ignored (8 SKIPPED: 6 per-lane DXIL forms refused by host adapter/driver, 1 heap_window_out_of_memory_falls_back_to_the_switch_form no heap windows, 1 pso_measurement_compiles_an_exact_synthetic_record Windows Developer Mode off).
    • The new test hle::d3d12x::list_x::tests::a_spare_reused_by_a_split_keeps_an_own_allocator_still_on_the_gpu passed.
    • The 2 failures (gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1 and fuzz_validate_and_gpu_3) are pre-existing on unmodified main on this RX 9060 XT / driver 32.0.31044.16.
  • cargo build --release -p xcl + 60 s retail-title smoke test (scripts/smoke.ps1, offline; first attempt exited early with no frames logged, second 60 s run completed cleanly):
xcl-smoke v1
commit: a041834420f21e8d80e3eb76ee85d180b6509993
gpu: AMD Radeon RX 9060 XT
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1567 (PresentX 1567)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 17703 MB

(Compare against main 08db8020 on this machine: 1553 frames, 13966 MB peak, 0 device removals, 0 crashes.)

Not tested

  • NVIDIA / Intel GPUs, Linux / Wine.

AI use

  • Verification run and report prepared with Antigravity (Gemini 4 Neon); all build, test, and smoke results are from live runs on this machine.
<!-- greyfinch-sync:ivall/xcl:comment:7177965976 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2549#issuecomment-7177965976). Originally posted by [emirduran707](https://github.com/emirduran707) on 2026-11-25T23:43:43Z. --- Independent AMD RDNA4 (native wave64) verification of exact PR head `a041834420f21e8d80e3eb76ee85d180b6509993` on Windows 11 Pro 26300 (AMD Radeon RX 9060 XT 16 GB, driver `32.0.31044.16`, Ryzen 5 5600, Rust 1.100.0 MSVC, DXC `1.9.2602.17`). **Tested** - `cargo build --workspace` (debug): passed (`0` errors). - `cargo test --workspace --no-fail-fast -- --test-threads=4`: `1422 passed, 2 failed, 46 ignored` (`8 SKIPPED`: 6 per-lane DXIL forms refused by host adapter/driver, 1 `heap_window_out_of_memory_falls_back_to_the_switch_form` no heap windows, 1 `pso_measurement_compiles_an_exact_synthetic_record` Windows Developer Mode off). - The new test `hle::d3d12x::list_x::tests::a_spare_reused_by_a_split_keeps_an_own_allocator_still_on_the_gpu` passed. - The 2 failures (`gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1` and `fuzz_validate_and_gpu_3`) are pre-existing on unmodified `main` on this RX 9060 XT / driver `32.0.31044.16`. - `cargo build --release -p xcl` + 60 s retail-title smoke test (`scripts/smoke.ps1`, offline; first attempt exited early with no frames logged, second 60 s run completed cleanly): ``` xcl-smoke v1 commit: a041834420f21e8d80e3eb76ee85d180b6509993 gpu: AMD Radeon RX 9060 XT title: 21222967 seconds: 60 exit: 0x0 frames shown: 1567 (PresentX 1567) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 17703 MB ``` (Compare against `main` `08db8020` on this machine: `1553 frames, 13966 MB peak, 0 device removals, 0 crashes`.) **Not tested** - NVIDIA / Intel GPUs, Linux / Wine. **AI use** - Verification run and report prepared with Antigravity (Gemini 4 Neon); all build, test, and smoke results are from live runs on this machine.
xpatfussy69x commented 2026-11-26 01:05:37 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by xpatfussy69x on 2026-11-26T00:18:21Z.


A question on a041834: the moved own_alloc now lives in the state of a split segment, not a recording's first segment. reset_own_alloc runs from reset_pc and deferred_segment reads the first segment's own_alloc, and split segments are reset through alloc_pool::reset_list, so as far as I can see nothing resets the inherited allocator once its GPU work is done. Its split dispatches' scratch (dispatch_chain::RECORDINGS, freed in allocator_reset) would then stay charged against XCL_SPLIT_SCRATCH_TOTAL_MB until that segment's state is removed. Is that intended, or should split reset it (or drop it) once allocator_in_flight says the GPU is done?

AI use: Claude Code (Claude Opus 5.5) reviewed the diff; I checked the reasoning but did not reproduce it.

<!-- greyfinch-sync:ivall/xcl:comment:7178617351 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2549#issuecomment-7178617351). Originally posted by [xpatfussy69x](https://github.com/xpatfussy69x) on 2026-11-26T00:18:21Z. --- A question on `a041834`: the moved `own_alloc` now lives in the state of a split segment, not a recording's first segment. `reset_own_alloc` runs from `reset_pc` and `deferred_segment` reads the first segment's `own_alloc`, and split segments are reset through `alloc_pool::reset_list`, so as far as I can see nothing resets the inherited allocator once its GPU work is done. Its split dispatches' scratch (`dispatch_chain::RECORDINGS`, freed in `allocator_reset`) would then stay charged against `XCL_SPLIT_SCRATCH_TOTAL_MB` until that segment's state is removed. Is that intended, or should `split` reset it (or drop it) once `allocator_in_flight` says the GPU is done? AI use: Claude Code (Claude Opus 5.5) reviewed the diff; I checked the reasoning but did not reproduce it.
SlopTart commented 2026-11-26 05:05:46 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-26T05:04:38Z.


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): 165 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_spare_reused_by_a_split_keeps_an_own_allocator_still_on_the_gpu: 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:7183158868 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2549#issuecomment-7183158868). Originally posted by [SlopTart](https://github.com/SlopTart) on 2026-11-26T05:04:38Z. --- **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): 165 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_spare_reused_by_a_split_keeps_an_own_allocator_still_on_the_gpu`: 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.
GodlyBDS commented 2026-11-26 11:05:14 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by GodlyBDS on 2026-11-26T11:00:35Z.


RTX 3090 Ti Windows validation of the allocator-lifetime regression

Windows 10, NVIDIA 621.40, Rust 1.98.1 MSVC. Local nvidia-dev af2cecc40886a8682ecf3267f5328c6dc4b66ad7 with the same startup and memory diagnostics on both arms. Backported a041834420f21e8d80e3eb76ee85d180b6509993, adapting the test's list-state access to the NVIDIA branch's per-list shard. The fixture releases the synthetic queue wait before asserting its collected observations.

  • Windows in-box D3D12: a_spare_reused_by_a_split_keeps_an_own_allocator_still_on_the_gpu passes with the two production changes (1 pass, 0 failures, no skips). With those two changes removed, it fails as expected after GPU completion (observed COM count 2, expected 3).
  • Agility SDK v620: the same fixture reaches submission of the gated list, then faults inside split with 0xc0000005 in both the patched and unpatched tree. This predates the backport. Two existing neighboring tests (a_reset_while_the_last_submit_runs_records_on_another_pc_list and a_dispatch_with_a_pipeline_still_building_waits_at_the_submit) passed on the patched tree with the configured SDK directory. Exact cause of the Agility-specific fixture failure remains open.

The unpatched af2 retail run had its render thread in native command-list Reset under record_deferred after the final logged native PSO creation had finished. It was stopped after several minutes with no submits, and did not log device removal. This is a separate observed symptom. The synthetic test confirms the ownership repair, and it does not yet establish a connection to that retail stall. A matched-cache replay with the backport and read-only allocator fence logging is running.

Matched retail replay update. The backport reproduced the same submit-thread native Reset wait on this NVIDIA branch. The last logged native PSO finished at 149.162 s. At 195.037 s the submit thread was in D3D12Core below alloc_pool::reset_list → list_x::record_deferred. Added allocator fence samples show one queue at submitted 6 and completed 5 from 88.317 s through the controlled window close after 323 s. The four other tracked queues were caught up in the static interval. No new device removal was logged. This backport did not resolve that stall in one matched-seed traversal. The pending submission's producer and contributing lifetime remain under investigation. The observed win32u.dll offset is inside that installed binary’s NtGdiDdDDIDestroyAllocation2 export. That places the block in the native allocation-destruction path under Reset, without identifying the destroyed allocation.

AI use: Codex (GPT-6) adapted the backport and fixture, ran these tests and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7190137295 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2549#issuecomment-7190137295). Originally posted by [GodlyBDS](https://github.com/GodlyBDS) on 2026-11-26T11:00:35Z. --- **RTX 3090 Ti Windows validation of the allocator-lifetime regression** Windows 10, NVIDIA 621.40, Rust 1.98.1 MSVC. Local `nvidia-dev af2cecc40886a8682ecf3267f5328c6dc4b66ad7` with the same startup and memory diagnostics on both arms. Backported `a041834420f21e8d80e3eb76ee85d180b6509993`, adapting the test's list-state access to the NVIDIA branch's per-list shard. The fixture releases the synthetic queue wait before asserting its collected observations. - **Windows in-box D3D12:** `a_spare_reused_by_a_split_keeps_an_own_allocator_still_on_the_gpu` passes with the two production changes (1 pass, 0 failures, no skips). With those two changes removed, it fails as expected after GPU completion (observed COM count 2, expected 3). - **Agility SDK v620:** the same fixture reaches submission of the gated list, then faults inside `split` with `0xc0000005` in both the patched and unpatched tree. This predates the backport. Two existing neighboring tests (`a_reset_while_the_last_submit_runs_records_on_another_pc_list` and `a_dispatch_with_a_pipeline_still_building_waits_at_the_submit`) passed on the patched tree with the configured SDK directory. Exact cause of the Agility-specific fixture failure remains open. The unpatched af2 retail run had its render thread in native command-list Reset under `record_deferred` after the final logged native PSO creation had finished. It was stopped after several minutes with no submits, and did not log device removal. This is a separate observed symptom. The synthetic test confirms the ownership repair, and it does not yet establish a connection to that retail stall. A matched-cache replay with the backport and read-only allocator fence logging is running. **Matched retail replay update.** The backport reproduced the same submit-thread native `Reset` wait on this NVIDIA branch. The last logged native PSO finished at 149.162 s. At 195.037 s the submit thread was in D3D12Core below `alloc_pool::reset_list → list_x::record_deferred`. Added allocator fence samples show one queue at submitted 6 and completed 5 from 88.317 s through the controlled window close after 323 s. The four other tracked queues were caught up in the static interval. No new device removal was logged. This backport did not resolve that stall in one matched-seed traversal. The pending submission's producer and contributing lifetime remain under investigation. The observed `win32u.dll` offset is inside that installed binary’s `NtGdiDdDDIDestroyAllocation2` export. That places the block in the native allocation-destruction path under `Reset`, without identifying the destroyed allocation. AI use: Codex (GPT-6) adapted the backport and fixture, ran these tests and wrote this report.
tiagonleal commented 2026-11-26 12:07:01 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by tiagonleal on 2026-11-26T11:52:29Z.


That was not intended. After a split reuses the spare, the list is reset only through alloc_pool::reset_list, so reset_own_alloc in reset_pc never runs for the moved allocator, and the scratch of its split dispatches stayed charged against XCL_SPLIT_SCRATCH_TOTAL_MB.

Fixed in 468f8dfb (the two commits are squashed into it, and the message no longer says reset_pc resets the allocator). split now keeps own_alloc only while allocator_in_flight says the GPU may still run work recorded on it. Once the GPU is done with it, it goes with the old state and is released outside the LISTS lock, as before this PR. New test: a_spare_reused_by_a_split_drops_an_own_allocator_the_gpu_is_done_with.

Run on 468f8dfb: cargo test -p xcl --lib -- a_spare_reused_by_a_split, 2 passed, 3 of 3 runs. The first test fails without the change (reference count 2, expected 3). The second fails when the allocator is moved unconditionally, as in the first version of this PR. cargo test --workspace --no-fail-fast -- --test-threads=4, twice: 1421 passed, 4 failed, 46 ignored; the 4 failures are gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3 (E_OUTOFMEMORY, known on this machine). 60 s smoke runs on e1d84b7d and 468f8dfb: both exit 0, no device removals, 1625 and 1619 frames shown (a first run of e1d84b7d gave 914 frames, so I repeated it).

Not run: the four fuzz tests on main today.

<!-- greyfinch-sync:ivall/xcl:comment:7191275435 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2549#issuecomment-7191275435). Originally posted by [tiagonleal](https://github.com/tiagonleal) on 2026-11-26T11:52:29Z. --- That was not intended. After a split reuses the spare, the list is reset only through `alloc_pool::reset_list`, so `reset_own_alloc` in `reset_pc` never runs for the moved allocator, and the scratch of its split dispatches stayed charged against `XCL_SPLIT_SCRATCH_TOTAL_MB`. Fixed in 468f8dfb (the two commits are squashed into it, and the message no longer says `reset_pc` resets the allocator). `split` now keeps `own_alloc` only while `allocator_in_flight` says the GPU may still run work recorded on it. Once the GPU is done with it, it goes with the old state and is released outside the `LISTS` lock, as before this PR. New test: `a_spare_reused_by_a_split_drops_an_own_allocator_the_gpu_is_done_with`. Run on 468f8dfb: `cargo test -p xcl --lib -- a_spare_reused_by_a_split`, 2 passed, 3 of 3 runs. The first test fails without the change (reference count 2, expected 3). The second fails when the allocator is moved unconditionally, as in the first version of this PR. `cargo test --workspace --no-fail-fast -- --test-threads=4`, twice: 1421 passed, 4 failed, 46 ignored; the 4 failures are `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3` (E_OUTOFMEMORY, known on this machine). 60 s smoke runs on e1d84b7d and 468f8dfb: both exit 0, no device removals, 1625 and 1619 frames shown (a first run of e1d84b7d gave 914 frames, so I repeated it). Not run: the four fuzz tests on `main` today.
tiagonleal commented 2026-11-26 15:03:48 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by tiagonleal on 2026-11-26T14:53:26Z.


@raylitebull a note for amd-dev, where 8549b14d adapted this PR:

amd-dev already keeps own_alloc when split reuses a spare (8549b14d), by moving it unconditionally, so the released-while-in-flight case is closed there.
What this PR still differs in: it moves it only while alloc_pool::allocator_in_flight says the GPU may run work on it (take_if); once the GPU is done it goes with the old state. Moving it always leaves the allocator, and the scratch of its split dispatches, charged against XCL_SPLIT_SCRATCH_TOTAL_MB, because that list is reset only through alloc_pool::reset_list, not reset_pc, so reset_own_alloc never runs for it (argument from this PR's body; not re-measured on amd-dev).
It also adds two tests (still on the GPU: kept; GPU done: dropped). The commit conflicts with amd-dev in the two split hunks; the change on amd-dev is one line: o.own_alloc.take() -> o.own_alloc.take_if(|a| super::alloc_pool::allocator_in_flight(a.as_raw() as usize)).
Commit 4886319e (real.rs, the title's own alloc_release) is a different path and does not touch this.

AI use: Claude Code with Claude Fable 5.2 and Anthropic subagents (Claude Sonnet 5.5) compared the trees and wrote this; I checked it.

<!-- greyfinch-sync:ivall/xcl:comment:7195481708 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2549#issuecomment-7195481708). Originally posted by [tiagonleal](https://github.com/tiagonleal) on 2026-11-26T14:53:26Z. --- @raylitebull a note for `amd-dev`, where 8549b14d adapted this PR: amd-dev already keeps `own_alloc` when `split` reuses a spare (8549b14d), by moving it unconditionally, so the released-while-in-flight case is closed there. What this PR still differs in: it moves it only while `alloc_pool::allocator_in_flight` says the GPU may run work on it (`take_if`); once the GPU is done it goes with the old state. Moving it always leaves the allocator, and the scratch of its split dispatches, charged against XCL_SPLIT_SCRATCH_TOTAL_MB, because that list is reset only through `alloc_pool::reset_list`, not `reset_pc`, so `reset_own_alloc` never runs for it (argument from this PR's body; not re-measured on amd-dev). It also adds two tests (still on the GPU: kept; GPU done: dropped). The commit conflicts with amd-dev in the two `split` hunks; the change on amd-dev is one line: `o.own_alloc.take()` -> `o.own_alloc.take_if(|a| super::alloc_pool::allocator_in_flight(a.as_raw() as usize))`. Commit 4886319e (real.rs, the title's own `alloc_release`) is a different path and does not touch this. AI use: Claude Code with Claude Fable 5.2 and Anthropic subagents (Claude Sonnet 5.5) compared the trees and wrote this; I checked it.
Decodere commented 2026-11-26 16:36:05 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-11-26T16:36:05Z.


Independent RTX 4060 (8 GB) / Windows 11 release verification of PR #2549 updated head 468f8dfb3d45f99ad532fd1d5d3edf6cf7e4d97a (with the spare-reuse own_alloc lifetime fix; exact parent & merge-base e1d84b7d9153f86a97d2ec5d209d196046fc0bea). Measurements and targeted test results only; not a full source review.

Setup

  • GPU: NVIDIA GeForce RTX 4060 (8 GB / 7956 MiB reported by D3D12), driver 32.0.16.2114 (NVIDIA 621.14, WDDM 3.2)
  • CPU / RAM / OS: Intel Core i5-11400F (6 cores / 12 threads), 32 GB RAM (31.9 GiB usable), Windows 11 Home 26200
  • Toolchain / caches: rustc 1.100.0 (0ef1bc386 2026-11-09), DXC 1.9.2609.5, release builds, warm DXIL/pipeline caches, quiet machine (zero concurrent builds/tests during timed runs)
  • Workload: Retail workload title: 29640639 via scripts/smoke.ps1 -Seconds 60 (XCL_NETWORK=0, default flags, no input)

Targeted RTX 4060 release unit & GPU tests (468f8dfb)

  • cargo test --release -p xcl --lib a_spare_reused_by_a_split_keeps_an_own_allocator_still_on_the_gpu -- --nocapture: 1 passed, 0 failed, 0 ignored (0.20 s, 0 SKIPPED).
  • cargo test --release -p xcl --lib a_spare_reused_by_a_split_drops_an_own_allocator_the_gpu_is_done_with -- --nocapture: 1 passed, 0 failed, 0 ignored (0.21 s, 0 SKIPPED).
  • cargo test --release -p xcl --lib hle::d3d12x::list_x:: (3 consecutive parallel passes): 42 passed, 0 failed, 0 ignored on all 3 passes (0.83 s / 0.83 s / 0.82 s, 0 SKIPPED).
  • cargo test --release -p xcl --lib hle::d3d12x::alloc_pool:: (3 consecutive parallel passes): 4 passed, 0 failed, 0 ignored on all 3 passes (0.21 s / 0.22 s / 0.22 s, 0 SKIPPED).

Paired 60 s RTX 4060 smoke (exact parent e1d84b7d vs 468f8dfb)

Both runs completed cleanly at steady 60/2 s pacing with 0 device removals and 0 crashes (468f8dfb vs e1d84b7d xcl.log: 6,176 / 6,115 MB vs 6,116 / 6,116 MB peak/end local VRAM, 4,683 MB vs 4,650 MB end non-local VRAM, 19,411 vs 19,261 translated draws / 1,024 dispatches with 0 skipped; live spare PC command-list reuse #1–#4 and allocator put-aside #1–#4 logged cleanly).

Exact parent (e1d84b7d):

xcl-smoke v1
commit: e1d84b7d9153f86a97d2ec5d209d196046fc0bea
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1531 (PresentX 1531)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13982 MB

PR #2549 head (468f8dfb):

xcl-smoke v1
commit: 468f8dfb3d45f99ad532fd1d5d3edf6cf7e4d97a
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1577 (PresentX 1578)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14008 MB

Limits of coverage

  • Full workspace test suite was not run on 468f8dfb (only the 2 new tests individually, 3 parallel passes each of hle::d3d12x::list_x:: and hle::d3d12x::alloc_pool::, release build, and exact-parent paired 60 s smokes).
  • While live spare PC command-list reuse and allocator put-aside ran during the 60 s smoke, mid-list Write64/Wait64 split reuse of a spare holding an own_alloc was exercised specifically by the two targeted D3D12 unit tests (a_spare_reused_by_a_split_keeps_an_own_allocator_still_on_the_gpu and a_spare_reused_by_a_split_drops_an_own_allocator_the_gpu_is_done_with).
  • Single discrete NVIDIA 8 GB GPU (RTX 4060) on native Windows 11; no AMD, Intel, or Wine/Linux run on this host.

AI use

Ran the targeted release unit/GPU tests, release build, and exact-parent paired quiet 60 s smoke runs with assistance from Google Antigravity (Gemini 4 Neon); all test counts, timings, memory figures, and smoke blocks were extracted directly from cargo test, xcl.log, and scripts/smoke.ps1 outputs.

<!-- greyfinch-sync:ivall/xcl:comment:7197857818 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2549#issuecomment-7197857818). Originally posted by [Decodere](https://github.com/Decodere) on 2026-11-26T16:36:05Z. --- **Independent RTX 4060 (8 GB) / Windows 11 release verification of PR #2549 updated head `468f8dfb3d45f99ad532fd1d5d3edf6cf7e4d97a`** (with the spare-reuse `own_alloc` lifetime fix; exact parent & merge-base `e1d84b7d9153f86a97d2ec5d209d196046fc0bea`). Measurements and targeted test results only; not a full source review. ### Setup - **GPU:** NVIDIA GeForce RTX 4060 (8 GB / `7956 MiB` reported by D3D12), driver `32.0.16.2114` (NVIDIA `621.14`, WDDM 3.2) - **CPU / RAM / OS:** Intel Core i5-11400F (6 cores / 12 threads), 32 GB RAM (`31.9 GiB` usable), Windows 11 Home `26200` - **Toolchain / caches:** `rustc 1.100.0 (0ef1bc386 2026-11-09)`, DXC `1.9.2609.5`, release builds, warm DXIL/pipeline caches, quiet machine (zero concurrent builds/tests during timed runs) - **Workload:** Retail workload `title: 29640639` via `scripts/smoke.ps1 -Seconds 60` (`XCL_NETWORK=0`, default flags, no input) ### Targeted RTX 4060 release unit & GPU tests (`468f8dfb`) - `cargo test --release -p xcl --lib a_spare_reused_by_a_split_keeps_an_own_allocator_still_on_the_gpu -- --nocapture`: **1 passed, 0 failed, 0 ignored** (`0.20 s`, `0` `SKIPPED`). - `cargo test --release -p xcl --lib a_spare_reused_by_a_split_drops_an_own_allocator_the_gpu_is_done_with -- --nocapture`: **1 passed, 0 failed, 0 ignored** (`0.21 s`, `0` `SKIPPED`). - `cargo test --release -p xcl --lib hle::d3d12x::list_x::` (3 consecutive parallel passes): **42 passed, 0 failed, 0 ignored** on all 3 passes (`0.83 s` / `0.83 s` / `0.82 s`, `0` `SKIPPED`). - `cargo test --release -p xcl --lib hle::d3d12x::alloc_pool::` (3 consecutive parallel passes): **4 passed, 0 failed, 0 ignored** on all 3 passes (`0.21 s` / `0.22 s` / `0.22 s`, `0` `SKIPPED`). ### Paired 60 s RTX 4060 smoke (exact parent `e1d84b7d` vs `468f8dfb`) Both runs completed cleanly at steady 60/2 s pacing with `0` device removals and `0` crashes (`468f8dfb` vs `e1d84b7d` `xcl.log`: `6,176` / `6,115 MB` vs `6,116` / `6,116 MB` peak/end local VRAM, `4,683 MB` vs `4,650 MB` end non-local VRAM, `19,411` vs `19,261` translated draws / `1,024` dispatches with `0` skipped; live spare PC command-list reuse `#1`–`#4` and allocator put-aside `#1`–`#4` logged cleanly). Exact parent (`e1d84b7d`): ``` xcl-smoke v1 commit: e1d84b7d9153f86a97d2ec5d209d196046fc0bea gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1531 (PresentX 1531) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 13982 MB ``` PR #2549 head (`468f8dfb`): ``` xcl-smoke v1 commit: 468f8dfb3d45f99ad532fd1d5d3edf6cf7e4d97a gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1577 (PresentX 1578) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14008 MB ``` ### Limits of coverage - Full workspace test suite was not run on `468f8dfb` (only the 2 new tests individually, 3 parallel passes each of `hle::d3d12x::list_x::` and `hle::d3d12x::alloc_pool::`, release build, and exact-parent paired 60 s smokes). - While live spare PC command-list reuse and allocator put-aside ran during the 60 s smoke, mid-list `Write64`/`Wait64` split reuse of a spare holding an `own_alloc` was exercised specifically by the two targeted D3D12 unit tests (`a_spare_reused_by_a_split_keeps_an_own_allocator_still_on_the_gpu` and `a_spare_reused_by_a_split_drops_an_own_allocator_the_gpu_is_done_with`). - Single discrete NVIDIA 8 GB GPU (`RTX 4060`) on native Windows 11; no AMD, Intel, or Wine/Linux run on this host. ### AI use Ran the targeted release unit/GPU tests, release build, and exact-parent paired quiet 60 s smoke runs with assistance from Google Antigravity (Gemini 4 Neon); all test counts, timings, memory figures, and smoke blocks were extracted directly from `cargo test`, `xcl.log`, and `scripts/smoke.ps1` outputs.
ClosetPie107 commented 2026-11-27 12:51:49 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ClosetPie107 on 2026-11-27T12:51:49Z.


Independent test report under Wine/Proton (not native Windows) for head 468f8dfb.

Setup

  • AMD Radeon RX 9070 (RDNA4, RADV GFX1201, Mesa 26.3.1), Ryzen 5 9600X, CachyOS Linux 7.3.5
  • Proton Experimental experimental-11.0-20261112, vkd3d-proton master ec207194 with a local patch dropping the lpVtbl checks in d3d12_command_allocator_from_iface / d3d12_command_list_from_iface, DXC 1.9.2609.5, Rust 1.96.0, x86_64-pc-windows-gnu
  • Head merged onto main 83b00818, test commit 1cffc79d

Tests (debug, XCL_REQUIRE_GPU=wave64, --test-threads=1)

  • hle::d3d12x::list_x::: 42 passed, 0 failed (main: 40 passed, 0 failed), including both a_spare_reused_by_a_split_… tests
  • cargo test --workspace --no-fail-fast -- --test-threads=4, lib binary: 1323 passed, 8 failed, 27 ignored (main the same run: 1320 passed, 9 failed, 27 ignored). The failures are all among main's.

Retail title, 300 s (release, from a copy of the same warm-cache snapshot; XCL_DIRECT_DXIL=1 XCL_PREPARE=1 XCL_PSO_PRELOAD=1 XCL_PSO_WAIT_MS=50 XCL_TEXTURE_LEVEL_PAGES=1 XCL_COHERENT_MB=1024 VKD3D_CONFIG=ignore_shared_fence, A pressed every 10 s)

  • 1 run: exit 0, no crash, no device removal, 1,768 presents. main, 4 runs: all clean, 1,892–2,122, so this one run is a little below main's range; one run is not enough to say more.

Not tested

  • Native Windows, NVIDIA/Intel

AI use

  • Claude Code (Claude Opus 5.5) wrote the test scripts, ran the tests and runs on this machine and wrote this report.
<!-- greyfinch-sync:ivall/xcl:comment:7218765809 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2549#issuecomment-7218765809). Originally posted by [ClosetPie107](https://github.com/ClosetPie107) on 2026-11-27T12:51:49Z. --- Independent test report under Wine/Proton (not native Windows) for head `468f8dfb`. **Setup** - AMD Radeon RX 9070 (RDNA4, RADV GFX1201, Mesa 26.3.1), Ryzen 5 9600X, CachyOS Linux 7.3.5 - Proton Experimental `experimental-11.0-20261112`, vkd3d-proton master `ec207194` with a local patch dropping the `lpVtbl` checks in `d3d12_command_allocator_from_iface` / `d3d12_command_list_from_iface`, DXC `1.9.2609.5`, Rust 1.96.0, `x86_64-pc-windows-gnu` - Head merged onto `main` `83b00818`, test commit `1cffc79d` **Tests** (debug, `XCL_REQUIRE_GPU=wave64`, `--test-threads=1`) - `hle::d3d12x::list_x::`: 42 passed, 0 failed (`main`: 40 passed, 0 failed), including both `a_spare_reused_by_a_split_…` tests - `cargo test --workspace --no-fail-fast -- --test-threads=4`, lib binary: 1323 passed, 8 failed, 27 ignored (`main` the same run: 1320 passed, 9 failed, 27 ignored). The failures are all among `main`'s. **Retail title, 300 s** (release, from a copy of the same warm-cache snapshot; `XCL_DIRECT_DXIL=1 XCL_PREPARE=1 XCL_PSO_PRELOAD=1 XCL_PSO_WAIT_MS=50 XCL_TEXTURE_LEVEL_PAGES=1 XCL_COHERENT_MB=1024 VKD3D_CONFIG=ignore_shared_fence`, `A` pressed every 10 s) - 1 run: exit 0, no crash, no device removal, 1,768 presents. `main`, 4 runs: all clean, 1,892–2,122, so this one run is a little below `main`'s range; one run is not enough to say more. **Not tested** - Native Windows, NVIDIA/Intel **AI use** - Claude Code (Claude Opus 5.5) wrote the test scripts, ran the tests and runs on this machine and wrote this report.
Foniass commented 2026-12-01 08:21:16 +00:00 (Migrated from github.com)

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


Triage (#1607) – head 72843a1

No open or merged PR makes the same change. #2725 and #3004 change how spares are handed out and parked, not own_alloc. On main, split_recording still runs m.remove(&next_pc) and drops the old state's own_alloc while deferred segments may still run on it. on_release already guards this case (allocator_in_flight -> mem::forget). This change carries the allocator over to the continuation state in that case, and the two GPU tests cover both cases (in flight / done).
No problems found in the diff.
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:7305206538 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2549#issuecomment-7305206538). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T08:21:16Z. --- **Triage (#1607)** – head 72843a1 No open or merged PR makes the same change. #2725 and #3004 change how spares are handed out and parked, not `own_alloc`. On main, `split_recording` still runs `m.remove(&next_pc)` and drops the old state's `own_alloc` while deferred segments may still run on it. `on_release` already guards this case (`allocator_in_flight` -> `mem::forget`). This change carries the allocator over to the continuation state in that case, and the two GPU tests cover both cases (in flight / done). No problems found in the diff. 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-02 19:39:54 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by fromthemoonx on 2026-12-02T19:39:54Z.


merge-check
base: 5ad98adbc3
head: 72843a1d4d
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 3007 passed, 0 failed, 52 ignored (3004 / 0 / 52 on 817eb1f, plus this PR's 2 tests and 1 that main gained since); SKIPPED: 25 (22 no wave64, 2 no heap windows, 1 no GPU_UPLOAD heaps); failing: none. This is the second run. In the first, the lib test binary ended with 0xc0000005 while it was writing thread dumps, before this PR's tests ran. That matches #3586, which happens on main too.
review: read the whole diff (1 file, +128 -2).

  1. Main already fixes this another way, so the new code has nothing left to do. Since 765b2c5b (#3203), which is in this PR's base 0fe06eb0, prepare_deferred_segment keeps own_alloc on the wrapper's primary PC list and record_deferred looks it up there. Its comment names this case: the first segment can be a stand-in that goes back to the spares, "and a split that takes it again replaces what is kept of it". The description still says the allocator is kept in the first segment's state.
  2. I checked that on this GPU with a scratch test that takes the real path: a list reset while its submit is held on the GPU, a put-off dispatch on the stand-in, the submit, then the next Reset. Same result in 3 of 3 runs:
result
a stand-in records yes
allocator on the primary list yes
allocator on the stand-in or any other segment no
after the next Reset: the stand-in is a spare yes
the primary is a spare no
spares that hold an allocator 0 of 3
  1. I also printed a line whenever split_recording reuses a spare that holds an allocator, and ran the whole suite again. Only this PR's two tests reached it, and both put the allocator on the spare by hand. That is why the first one fails without the change although the path no longer leads there.
  2. From reading: own_alloc is set in one place, always on the primary, and I found no path that puts a primary among the spares.
  3. The change looks harmless if someone wants it as a guard, but then the description and the tests' comments should say so.
  4. Not tested: a retail title (none on this machine).
    performance: one check of an empty field per split (reasoned)
    verdict: not yet: the bug it describes is already fixed on main by #3203; close it, or say what path still puts an allocator on a spare
    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:7356529502 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2549#issuecomment-7356529502). Originally posted by [fromthemoonx](https://github.com/fromthemoonx) on 2026-12-02T19:39:54Z. --- merge-check base: 5ad98adbc360225ac8a57ad9661e16fe8df9d8dd head: 72843a1d4d9f2194cee4a1ab41d397e84ba13554 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 3007 passed, 0 failed, 52 ignored (3004 / 0 / 52 on 817eb1f, plus this PR's 2 tests and 1 that main gained since); SKIPPED: 25 (22 no wave64, 2 no heap windows, 1 no GPU_UPLOAD heaps); failing: none. This is the second run. In the first, the lib test binary ended with 0xc0000005 while it was writing thread dumps, before this PR's tests ran. That matches #3586, which happens on main too. review: read the whole diff (1 file, +128 -2). 1) Main already fixes this another way, so the new code has nothing left to do. Since 765b2c5b (#3203), which is in this PR's base 0fe06eb0, `prepare_deferred_segment` keeps `own_alloc` on the wrapper's primary PC list and `record_deferred` looks it up there. Its comment names this case: the first segment can be a stand-in that goes back to the spares, "and a split that takes it again replaces what is kept of it". The description still says the allocator is kept in the first segment's state. 2) I checked that on this GPU with a scratch test that takes the real path: a list reset while its submit is held on the GPU, a put-off dispatch on the stand-in, the submit, then the next Reset. Same result in 3 of 3 runs: | | result | |---|---| | a stand-in records | yes | | allocator on the primary list | yes | | allocator on the stand-in or any other segment | no | | after the next Reset: the stand-in is a spare | yes | | the primary is a spare | no | | spares that hold an allocator | 0 of 3 | 3) I also printed a line whenever `split_recording` reuses a spare that holds an allocator, and ran the whole suite again. Only this PR's two tests reached it, and both put the allocator on the spare by hand. That is why the first one fails without the change although the path no longer leads there. 4) From reading: `own_alloc` is set in one place, always on the primary, and I found no path that puts a primary among the spares. 5) The change looks harmless if someone wants it as a guard, but then the description and the tests' comments should say so. 6) Not tested: a retail title (none on this machine). performance: one check of an empty field per split (reasoned) verdict: not yet: the bug it describes is already fixed on main by #3203; close it, or say what path still puts an allocator on a spare hardware / tool and model: RTX 3060 12 GB (610.88), Ryzen 7 5700X, Windows 11 Pro 26300 / Claude Code (Claude Opus 5.5)
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/2549:upstream-pr/2549'
git switch 'upstream-pr/2549'

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