D3D12.X: drop alloc_pool fences on queue release and skip real::FENCES #1935

Open
Decodere wants to merge 1 commit from upstream-pr/1945 into main
Decodere commented 2026-11-24 23:46:31 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-11-24T23:46:31Z.


Stops allocator-pool internal fences from leaking with Refcount: 2 across released command queues.

Two compounding paths kept every fence created in alloc_pool::executed alive after its command queue hit final Release:

  1. Calling d.CreateFence on the adopted title device went through real::dev_create_fence, which permanently AddRefd the fence into real::FENCES (alloc_pool only signals and polls these internal fences and never waits on them, so end_title does not need them).
  2. alloc_pool::State.fences (and State.last_submit, added in #2163) kept the per-queue ID3D12Fence after queue release because real::q_release never notified alloc_pool when a queue's refcount reached zero.

Fixes #1909

What is in it

  • crates/xcl/src/hle/d3d12x/real.rs: add create_pc_fence calling the native CreateFence slot via orig_fn on adopted devices (falling back to dev.CreateFence on unhooked test devices), notify alloc_pool::forget_queue in q_release when n == 0, and expose is_fence as pub(super) for testing.
  • crates/xcl/src/hle/d3d12x/alloc_pool.rs: use real::create_pc_fence in executed, add forget_queue to remove State.fences, prune completed Backing.marks (moving still-pending GPU marks to Backing.retired so queue-address reuse cannot overwrite in-flight work before completion), and prune completed State.last_submit entries for the released queue (clearing last.queue = 0 on still-in-flight entries so queue-address reuse cannot report same_queue in note_resubmits, and reaping orphaned completed entries on subsequent releases). Clear retired on backing reuse in title_reset_in, drop removed/replaced fences outside STATE.lock() in forget_list, forget_queue, and executed, clean up the unadopted list and queue in a_recording_outlives_the_reset_of_the_titles_allocator via forget_list/forget_queue before dropping them so recycled addresses do not inherit stale state across tests, and add CPU (AtomicU64/AtomicU32 fake COM fence) and GPU regression tests (forget_queue_prunes_completed_and_preserves_pending_across_address_reuse and released_queue_frees_alloc_pool_fence_and_skips_title_fences).

Tested

  • NVIDIA GeForce RTX 4060 8 GB (driver 621.14), Intel Core i5-11400F, 32 GB RAM, Windows 11 Home 26200, Rust 1.100.0 (stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5; release build.
  • Pre-fix reproduction: confirmed released_queue_frees_alloc_pool_fence_and_skips_title_fences fails independently without create_pc_fence (fence registered in real::FENCES) and without q_release → alloc_pool::forget_queue (State.fences and State.last_submit retain released queue's fence), and reproduced the deterministic left: 4, right: 1 test-order failure under --test-threads=1 before adding forget_queue cleanup to a_recording_outlives_the_reset_of_the_titles_allocator.
  • cargo test --release -p xcl --lib hle::d3d12x::alloc_pool::tests:
    • -- --test-threads=1 --nocapture (3 consecutive runs, RTX 4060): 6 passed, 0 failed, 0 ignored each run.
    • -- --test-threads=4 --nocapture (RTX 4060): 6 passed, 0 failed, 0 ignored.
    • XCL_ADAPTER="Microsoft Basic Render Driver" -- --test-threads=1 --nocapture (WARP): 6 passed, 0 failed, 0 ignored.
  • cargo build --release --workspace + cargo test --release --workspace --no-fail-fast -- --test-threads=4 --nocapture: 1243 passed, 2 pre-existing failures on parent 96331383 (fixed on main immediately after in #2245: gpu::recomp::pso::shader_cache_tests::rerouted_disk_entries_follow_the_direct_translator and hle::d3d12x::device_x::tests::pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa), 46 ignored across 23 test binaries.
  • SKIPPED lines on stderr (27 total):
    • 20 no wave64 (gpu::recomp::lower::tests (4), gpu::recomp::lower_dxil::tests (14), gpu::recomp::tests (2))
    • 3 wave32 per-lane #1426 refusals (gpu::recomp::lower_dxil::tests: f16_programs_on_the_gpu (2), f32_programs_on_the_gpu (1))
    • 1 shaders::tests::pso_measurement_compiles_an_exact_synthetic_record (cannot disable driver cache without Windows Developer Mode)
    • 1 heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows)
    • 2 D3D12 debug-layer tests (test_title_draws_with_a_root_signature_under_the_debug_layer, uploads_start_from_each_subresources_state: no d3d12SDKLayers.dll)

Regression run

main:

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

this PR:

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

Not tested

  • AMD and Intel GPUs, or wave64-capable hardware (this pass ran on RTX 4060 and WARP only).
  • Running with the D3D12 Debug Layer live-object reporter (d3d12SDKLayers.dll is not installed on this machine), debug-profile full workspace test run, or stacked on top of open #1691's queue-retention fix across multi-cycle synthetic copy workloads; the smoke run above is a regression check only.

AI use

  • Google Antigravity (Gemini 4 Neon): investigated #1909, the CI test-order failure, and the #2163 State.last_submit rebase integration, wrote the fix, CPU/GPU regression tests, and this description, and ran the workspace test suite and paired smoke runs on the hardware listed above.
<!-- greyfinch-sync:ivall/xcl:issue:5482299518 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1945). Originally posted by [Decodere](https://github.com/Decodere) on 2026-11-24T23:46:31Z. --- Stops allocator-pool internal fences from leaking with `Refcount: 2` across released command queues. Two compounding paths kept every fence created in `alloc_pool::executed` alive after its command queue hit final `Release`: 1. Calling `d.CreateFence` on the adopted title device went through `real::dev_create_fence`, which permanently `AddRef`d the fence into `real::FENCES` (`alloc_pool` only signals and polls these internal fences and never waits on them, so `end_title` does not need them). 2. `alloc_pool::State.fences` (and `State.last_submit`, added in #2163) kept the per-queue `ID3D12Fence` after queue release because `real::q_release` never notified `alloc_pool` when a queue's refcount reached zero. Fixes #1909 **What is in it** - `crates/xcl/src/hle/d3d12x/real.rs`: add `create_pc_fence` calling the native `CreateFence` slot via `orig_fn` on adopted devices (falling back to `dev.CreateFence` on unhooked test devices), notify `alloc_pool::forget_queue` in `q_release` when `n == 0`, and expose `is_fence` as `pub(super)` for testing. - `crates/xcl/src/hle/d3d12x/alloc_pool.rs`: use `real::create_pc_fence` in `executed`, add `forget_queue` to remove `State.fences`, prune completed `Backing.marks` (moving still-pending GPU marks to `Backing.retired` so queue-address reuse cannot overwrite in-flight work before completion), and prune completed `State.last_submit` entries for the released queue (clearing `last.queue = 0` on still-in-flight entries so queue-address reuse cannot report `same_queue` in `note_resubmits`, and reaping orphaned completed entries on subsequent releases). Clear `retired` on backing reuse in `title_reset_in`, drop removed/replaced fences outside `STATE.lock()` in `forget_list`, `forget_queue`, and `executed`, clean up the unadopted list and queue in `a_recording_outlives_the_reset_of_the_titles_allocator` via `forget_list`/`forget_queue` before dropping them so recycled addresses do not inherit stale state across tests, and add CPU (`AtomicU64`/`AtomicU32` fake COM fence) and GPU regression tests (`forget_queue_prunes_completed_and_preserves_pending_across_address_reuse` and `released_queue_frees_alloc_pool_fence_and_skips_title_fences`). **Tested** - NVIDIA GeForce RTX 4060 8 GB (driver 621.14), Intel Core i5-11400F, 32 GB RAM, Windows 11 Home 26200, Rust 1.100.0 (`stable-x86_64-pc-windows-msvc`), DXC 1.9.2609.5; release build. - Pre-fix reproduction: confirmed `released_queue_frees_alloc_pool_fence_and_skips_title_fences` fails independently without `create_pc_fence` (fence registered in `real::FENCES`) and without `q_release` → `alloc_pool::forget_queue` (`State.fences` and `State.last_submit` retain released queue's fence), and reproduced the deterministic `left: 4, right: 1` test-order failure under `--test-threads=1` before adding `forget_queue` cleanup to `a_recording_outlives_the_reset_of_the_titles_allocator`. - `cargo test --release -p xcl --lib hle::d3d12x::alloc_pool::tests`: - `-- --test-threads=1 --nocapture` (3 consecutive runs, RTX 4060): 6 passed, 0 failed, 0 ignored each run. - `-- --test-threads=4 --nocapture` (RTX 4060): 6 passed, 0 failed, 0 ignored. - `XCL_ADAPTER="Microsoft Basic Render Driver"` `-- --test-threads=1 --nocapture` (WARP): 6 passed, 0 failed, 0 ignored. - `cargo build --release --workspace` + `cargo test --release --workspace --no-fail-fast -- --test-threads=4 --nocapture`: 1243 passed, 2 pre-existing failures on parent `96331383` (fixed on `main` immediately after in #2245: `gpu::recomp::pso::shader_cache_tests::rerouted_disk_entries_follow_the_direct_translator` and `hle::d3d12x::device_x::tests::pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa`), 46 ignored across 23 test binaries. - `SKIPPED` lines on stderr (27 total): - 20 `no wave64` (`gpu::recomp::lower::tests` (4), `gpu::recomp::lower_dxil::tests` (14), `gpu::recomp::tests` (2)) - 3 wave32 per-lane `#1426` refusals (`gpu::recomp::lower_dxil::tests`: `f16_programs_on_the_gpu` (2), `f32_programs_on_the_gpu` (1)) - 1 `shaders::tests::pso_measurement_compiles_an_exact_synthetic_record` (cannot disable driver cache without Windows Developer Mode) - 1 `heap_window_out_of_memory_falls_back_to_the_switch_form` (`no heap windows`) - 2 D3D12 debug-layer tests (`test_title_draws_with_a_root_signature_under_the_debug_layer`, `uploads_start_from_each_subresources_state`: no `d3d12SDKLayers.dll`) **Regression run** main: ``` xcl-smoke v1 commit: 963313835813f475037b3a9f5fcc3cb591696928 gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1526 (PresentX 1526) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14482 MB ``` this PR: ``` xcl-smoke v1 commit: ace754ce635c06a03068601c12afcdc1ff60770c gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1530 (PresentX 1530) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14468 MB ``` **Not tested** - AMD and Intel GPUs, or wave64-capable hardware (this pass ran on RTX 4060 and WARP only). - Running with the D3D12 Debug Layer live-object reporter (`d3d12SDKLayers.dll` is not installed on this machine), debug-profile full workspace test run, or stacked on top of open `#1691`'s queue-retention fix across multi-cycle synthetic copy workloads; the smoke run above is a regression check only. **AI use** - Google Antigravity (Gemini 4 Neon): investigated #1909, the CI test-order failure, and the #2163 `State.last_submit` rebase integration, wrote the fix, CPU/GPU regression tests, and this description, and ran the workspace test suite and paired smoke runs on the hardware listed above.
DEViANCEVxXXxM commented 2026-11-25 00:09:06 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DEViANCEVxXXxM on 2026-11-24T23:55:03Z.


Independent validation — PASS

Tested exact commit 907cf34cc587eb74c763ce87de4911c55037cbf1 on my RTX 3090, driver 621.01, Windows 26H1.

  • All five allocator-pool tests passed.
  • Both new regression tests passed.
  • No skipped GPU tests.
  • No reported device errors.
  • No local source modifications.

I also checked three-way merge compatibility with #1691 (81f6397). The only reported content conflict is in real.rs, inside q_release().

When integrating both PRs, allocator-pool cleanup needs to be preserved on both final-release paths introduced by #1691.

I have a prepared three-cycle synthetic workload with D3D12 live-object reporting that can validate the combined fix once this integration is resolved.

Thanks for addressing #1909!

AI assistance: ChatGPT (GPT-6.2). Synthetic tests only.

<!-- greyfinch-sync:ivall/xcl:comment:7147936230 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1945#issuecomment-7147936230). Originally posted by [DEViANCEVxXXxM](https://github.com/DEViANCEVxXXxM) on 2026-11-24T23:55:03Z. --- **Independent validation — PASS** Tested exact commit `907cf34cc587eb74c763ce87de4911c55037cbf1` on my RTX 3090, driver 621.01, Windows 26H1. - All five allocator-pool tests passed. - Both new regression tests passed. - No skipped GPU tests. - No reported device errors. - No local source modifications. I also checked three-way merge compatibility with #1691 (`81f6397`). The only reported content conflict is in `real.rs`, inside `q_release()`. When integrating both PRs, allocator-pool cleanup needs to be preserved on both final-release paths introduced by #1691. I have a prepared three-cycle synthetic workload with D3D12 live-object reporting that can validate the combined fix once this integration is resolved. Thanks for addressing #1909! AI assistance: ChatGPT (GPT-6.2). Synthetic tests only.
futurepro62 commented 2026-11-25 00:09:06 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T23:57:11Z.


Full-suite run, since this PR has no test report yet. Tested exact head 907cf34 (on its base 20cf130).

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::dxil::fuzz_tests: 968 passed, 0 failed, 43 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, 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: forget_queue_prunes_completed_and_preserves_pending_across_address_reuse, released_queue_frees_alloc_pool_fence_and_skips_title_fences.
  • 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: 977 passed, 0 failed, 45 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 62265d3 too, not because of this PR. On NVIDIA: heap_window_out_of_memory_falls_back_to_the_switch_form (#1651) and the four gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu tests (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:7147975903 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1945#issuecomment-7147975903). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-24T23:57:11Z. --- Full-suite run, since this PR has no test report yet. Tested exact head `907cf34` (on its base `20cf130`). **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::dxil::fuzz_tests`: **968 passed, 0 failed, 43 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`, `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: `forget_queue_prunes_completed_and_preserves_pending_across_address_reuse`, `released_queue_frees_alloc_pool_fence_and_skips_title_fences`. - 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`: **977 passed, 0 failed, 45 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 `62265d3` too, not because of this PR. On NVIDIA: `heap_window_out_of_memory_falls_back_to_the_switch_form` (#1651) and the four `gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu` tests ([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.
upipibi commented 2026-11-25 00:09:07 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-24T23:57:20Z.


Heads-up from reading the diff (not run): alloc_pool::forget_queue goes in the if n == 0 branch of q_release. #1819 and #1899 put their hooks on that same line, so the four PRs conflict there (git merge-tree of this head 907cf34 with each of #1691, #1819 and #1899 reports a conflict).

The other point is when that branch runs. On main, present keeps a reference to every queue the title submitted to (#1668), so a queue the title submitted to rarely gets to n == 0, and forget_queue would rarely run until #1691 is in. #1691 adds a second path, n == 1 && present::forget_queue(this), which releases again and calls list_x::on_queue_release when the count reaches 0. A hook only in the first branch misses that path. Details are in https://github.com/xcl-dev/xcl/pull/1899#issuecomment-7146729916. A single per-queue cleanup function, called from both places where n reaches 0, would let these PRs merge in any order.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ivall/xcl:comment:7147978597 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1945#issuecomment-7147978597). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-24T23:57:20Z. --- Heads-up from reading the diff (not run): `alloc_pool::forget_queue` goes in the `if n == 0` branch of `q_release`. #1819 and #1899 put their hooks on that same line, so the four PRs conflict there (`git merge-tree` of this head `907cf34` with each of #1691, #1819 and #1899 reports a conflict). The other point is when that branch runs. On `main`, `present` keeps a reference to every queue the title submitted to (#1668), so a queue the title submitted to rarely gets to `n == 0`, and `forget_queue` would rarely run until #1691 is in. #1691 adds a second path, `n == 1 && present::forget_queue(this)`, which releases again and calls `list_x::on_queue_release` when the count reaches 0. A hook only in the first branch misses that path. Details are in https://github.com/xcl-dev/xcl/pull/1899#issuecomment-7146729916. A single per-queue cleanup function, called from both places where `n` reaches 0, would let these PRs merge in any order. AI-assisted (Claude Code).
raylitebull commented 2026-11-25 02:09:01 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T01:54:20Z.


Code review on 907cf34:

  • forget_queue + Backing.retired + create_pc_fence (crates/xcl/src/hle/d3d12x/alloc_pool.rs, real.rs) cleanly handles queue address reuse while marks are still in flight and keeps internal tracking fences out of real::FENCES, with strong unit and GPU test coverage (forget_queue_prunes_completed_and_preserves_pending_across_address_reuse, released_queue_frees_alloc_pool_fence_and_skips_title_fences).
  • Diff audited and CI workflow approved (running). Note #1967 touches the same q_release hook.

Remaining before merge: Build and test finishing green plus AMD verification on 907cf34.

<!-- greyfinch-sync:ivall/xcl:comment:7150095168 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1945#issuecomment-7150095168). Originally posted by [raylitebull](https://github.com/raylitebull) on 2026-11-25T01:54:20Z. --- Code review on `907cf34`: - `forget_queue` + `Backing.retired` + `create_pc_fence` (`crates/xcl/src/hle/d3d12x/alloc_pool.rs`, `real.rs`) cleanly handles queue address reuse while marks are still in flight and keeps internal tracking fences out of `real::FENCES`, with strong unit and GPU test coverage (`forget_queue_prunes_completed_and_preserves_pending_across_address_reuse`, `released_queue_frees_alloc_pool_fence_and_skips_title_fences`). - Diff audited and `CI` workflow approved (running). Note `#1967` touches the same `q_release` hook. **Remaining before merge:** `Build and test` finishing green plus **AMD** verification on `907cf34`.
raylitebull commented 2026-11-25 02:09:07 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T02:04:11Z.


CI update on 907cf34:

  • Build and test (Windows, no GPU) failed in hle::d3d12x::alloc_pool::tests::released_queue_frees_alloc_pool_fence_and_skips_title_fences at crates/xcl/src/hle/d3d12x/alloc_pool.rs:646 (left: 4, right: 1 on the no-GPU/WARP runner — likely WARP retaining internal fence references across queue/command work before device destruction).
  • Also note @upipibi's point above about q_release's present::forget_queue(this) branch (n == 1) if #1691 lands alongside this.
<!-- greyfinch-sync:ivall/xcl:comment:7150280094 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1945#issuecomment-7150280094). Originally posted by [raylitebull](https://github.com/raylitebull) on 2026-11-25T02:04:11Z. --- CI update on `907cf34`: - `Build and test (Windows, no GPU)` failed in `hle::d3d12x::alloc_pool::tests::released_queue_frees_alloc_pool_fence_and_skips_title_fences` at `crates/xcl/src/hle/d3d12x/alloc_pool.rs:646` (`left: 4, right: 1` on the no-GPU/WARP runner — likely WARP retaining internal fence references across queue/command work before device destruction). - Also note `@upipibi`'s point above about `q_release`'s `present::forget_queue(this)` branch (`n == 1`) if `#1691` lands alongside this.
Decodere commented 2026-11-25 03:05:35 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-11-25T02:14:11Z.


@raylitebull Found and fixed the exact cause of the Build and test failure (alloc_pool.rs:646: left: 4, right: 1) and rebased cleanly onto main (3da2abb8) at f5810578:

  • Root cause (signaled == 4 vs 1): Under --test-threads=1 (as on CI), a_recording_outlives_the_reset_of_the_titles_allocator ran earlier without real::adopt(dev), called executed(queue, ...) 3 times, and dropped queue without going through q_release, leaving (q_key -> (fence, 3)) in STATE.fences. When released_queue_frees_alloc_pool_fence_and_skips_title_fences then created a queue at the recycled pointer q_key, executed incremented 3 -> 4 (rather than WARP retaining a fence ref).
  • Fix: Cleaned up forget_queue(queue.as_raw() as usize); before drop(queue); in a_recording_outlives_the_reset_of_the_titles_allocator and added defensive forget_queue(q_key) / forget_queue(q2_key) guards in released_queue_frees_alloc_pool_fence_and_skips_title_fences; runtime code in alloc_pool.rs and real.rs is unchanged from 907cf34.
  • Re-verified (release): Reproduced left: 4, right: 1 deterministically under --test-threads=1; after the fix, hle::d3d12x::alloc_pool::tests passed 5/5 x3 under --test-threads=1 (RTX 4060), 5/5 parallel (RTX 4060), and 5/5 under --test-threads=1 on WARP (XCL_ADAPTER="Microsoft Basic Render Driver"), plus full workspace 1,113 passed, 0 failed, 46 ignored and paired 60 s scripts/smoke.ps1 (1,582 -> 1,547 frames, 0 crashes/removals).
  • #1691 / #1967 note: Checked live main (#1691 is still open so present::forget_queue(this) is not in q_release yet); if #1691 merges first, we will rebase immediately so both paths stay intact on final queue release. (Note futurepro62 also verified the identical runtime fix on AMD Radeon iGPU in #issuecomment-7147975903.)

Ready for CI re-run!

AI use: Google Antigravity (Gemini 4 Neon).

<!-- greyfinch-sync:ivall/xcl:comment:7150475891 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1945#issuecomment-7150475891). Originally posted by [Decodere](https://github.com/Decodere) on 2026-11-25T02:14:11Z. --- @raylitebull Found and fixed the exact cause of the `Build and test` failure (`alloc_pool.rs:646`: `left: 4, right: 1`) and rebased cleanly onto `main` (`3da2abb8`) at `f5810578`: - **Root cause (`signaled == 4` vs `1`):** Under `--test-threads=1` (as on CI), `a_recording_outlives_the_reset_of_the_titles_allocator` ran earlier without `real::adopt(dev)`, called `executed(queue, ...)` 3 times, and dropped `queue` without going through `q_release`, leaving `(q_key -> (fence, 3))` in `STATE.fences`. When `released_queue_frees_alloc_pool_fence_and_skips_title_fences` then created a queue at the recycled pointer `q_key`, `executed` incremented `3 -> 4` (rather than WARP retaining a fence ref). - **Fix:** Cleaned up `forget_queue(queue.as_raw() as usize);` before `drop(queue);` in `a_recording_outlives_the_reset_of_the_titles_allocator` and added defensive `forget_queue(q_key)` / `forget_queue(q2_key)` guards in `released_queue_frees_alloc_pool_fence_and_skips_title_fences`; runtime code in `alloc_pool.rs` and `real.rs` is unchanged from `907cf34`. - **Re-verified (release):** Reproduced `left: 4, right: 1` deterministically under `--test-threads=1`; after the fix, `hle::d3d12x::alloc_pool::tests` passed `5/5` x3 under `--test-threads=1` (RTX 4060), `5/5` parallel (RTX 4060), and `5/5` under `--test-threads=1` on WARP (`XCL_ADAPTER="Microsoft Basic Render Driver"`), plus full workspace `1,113 passed, 0 failed, 46 ignored` and paired 60 s `scripts/smoke.ps1` (`1,582 -> 1,547` frames, `0` crashes/removals). - **`#1691` / `#1967` note:** Checked live `main` (`#1691` is still open so `present::forget_queue(this)` is not in `q_release` yet); if `#1691` merges first, we will rebase immediately so both paths stay intact on final queue release. (Note `futurepro62` also verified the identical runtime fix on AMD Radeon iGPU in `#issuecomment-7147975903`.) Ready for CI re-run! AI use: Google Antigravity (Gemini 4 Neon).
DEViANCEVxXXxM commented 2026-11-25 03:05:47 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DEViANCEVxXXxM on 2026-11-25T02:38:55Z.


Independent validation of f5810578ae1da2a34808ea6c75373cc9e5b36050 on RTX 3090 / Windows.

  • Release build: successful.
  • Individual allocator-pool tests in separate processes: 5/5 passed.
  • Three runs with --test-threads=1: 15/15 passed.
  • Three runs with --test-threads=5: 15/15 passed.
  • No detected device errors, timeouts, or skipped tests.

Total: 35/35 passed.

The exact upstream revision was tested without source modifications.

The updated test cleanup appears stable in these runs. However, passing repeated tests does not establish the absence of data races or resolve the separate Cell<u64> synchronization concern.

Testing and report analysis assisted by ChatGPT (GPT-6.2).

<!-- greyfinch-sync:ivall/xcl:comment:7150996871 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1945#issuecomment-7150996871). Originally posted by [DEViANCEVxXXxM](https://github.com/DEViANCEVxXXxM) on 2026-11-25T02:38:55Z. --- Independent validation of `f5810578ae1da2a34808ea6c75373cc9e5b36050` on RTX 3090 / Windows. - Release build: successful. - Individual allocator-pool tests in separate processes: 5/5 passed. - Three runs with `--test-threads=1`: 15/15 passed. - Three runs with `--test-threads=5`: 15/15 passed. - No detected device errors, timeouts, or skipped tests. Total: **35/35 passed**. The exact upstream revision was tested without source modifications. The updated test cleanup appears stable in these runs. However, passing repeated tests does not establish the absence of data races or resolve the separate `Cell<u64>` synchronization concern. Testing and report analysis assisted by ChatGPT (GPT-6.2).
DavidM1911 commented 2026-11-25 03:05:51 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T02:50:31Z.


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

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7151255980 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1945#issuecomment-7151255980). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T02:50:31Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
DEViANCEVxXXxM commented 2026-11-25 05:08:22 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DEViANCEVxXXxM on 2026-11-25T04:36:06Z.


Follow-up validation for #1909.

I tested the updated PR revision f581057, both independently and combined with #1691 (81f6397), against main cbc296ab.

Results:

  • All five allocator-pool tests passed.
  • The combined D3D12.X regression suite passed: 181 passed, 0 failed, 2 expected timing tests ignored.
  • 210/210 focused stress test executions passed.
  • 96 completed-fence lifecycle cycles passed.
  • 96 simulated pending-fence lifecycle cycles passed.

The additional cross-PR tests exercised submit tracking and allocator-pool cleanup on the same command queue, with and without an outstanding reader reference.

Verified behavior includes:

  • Internal allocator fences are not registered in real::FENCES.
  • Completed marks are removed on final queue release.
  • Pending marks survive queue release in Backing.retired.
  • Pending marks prevent premature allocator reuse.
  • Retired marks are reclaimed after completion.
  • The internal fence reaches COM reference count zero after cleanup.

Pending completion was modeled using a native D3D12 fence with CPU signaling, rather than deliberately blocking outstanding GPU work.

Integration note: #1691 and #1945 conflict in real.rs::q_release. Moving the final-zero cleanup after #1691's tracking-reference removal preserves both fixes. The resulting combined tree (81f0dbb) passed all the above checks.

The retail-title crash remains present on main, both individual PRs, and the combined build. This should be investigated separately and does not invalidate the allocator lifecycle test results.

AI assistance: ChatGPT (GPT-6.2). All reported builds and tests were executed on actual Windows hardware.

<!-- greyfinch-sync:ivall/xcl:comment:7152992810 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1945#issuecomment-7152992810). Originally posted by [DEViANCEVxXXxM](https://github.com/DEViANCEVxXXxM) on 2026-11-25T04:36:06Z. --- Follow-up validation for #1909. I tested the updated PR revision `f581057`, both independently and combined with #1691 (`81f6397`), against main `cbc296ab`. **Results:** - All five allocator-pool tests passed. - The combined D3D12.X regression suite passed: 181 passed, 0 failed, 2 expected timing tests ignored. - 210/210 focused stress test executions passed. - 96 completed-fence lifecycle cycles passed. - 96 simulated pending-fence lifecycle cycles passed. The additional cross-PR tests exercised submit tracking and allocator-pool cleanup on the same command queue, with and without an outstanding reader reference. Verified behavior includes: - Internal allocator fences are not registered in `real::FENCES`. - Completed marks are removed on final queue release. - Pending marks survive queue release in `Backing.retired`. - Pending marks prevent premature allocator reuse. - Retired marks are reclaimed after completion. - The internal fence reaches COM reference count zero after cleanup. Pending completion was modeled using a native D3D12 fence with CPU signaling, rather than deliberately blocking outstanding GPU work. **Integration note:** #1691 and #1945 conflict in `real.rs::q_release`. Moving the final-zero cleanup after #1691's tracking-reference removal preserves both fixes. The resulting combined tree (`81f0dbb`) passed all the above checks. The retail-title crash remains present on main, both individual PRs, and the combined build. This should be investigated separately and does not invalidate the allocator lifecycle test results. AI assistance: ChatGPT (GPT-6.2). All reported builds and tests were executed on actual Windows hardware.
upipibi commented 2026-11-25 07:05:33 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-25T06:26:32Z.


Update, merged with main: ace754c merged --no-ff onto main 08db802 (merge commit 0548a52, clean), same card and settings: cargo test -p xcl --lib -- --skip hle::xaudio2 --test-threads=4: 1302 passed, 0 failed, 27 ignored (the same 25 SKIPPED lines as main); cargo test -p xcl --lib -- hle::d3d12x --test-threads=4, 3 runs: 256 passed, 0 failed each time. This is the merge, not the head: ace754c on its own base still fails the two base tests below until it is rebased.

Update, head ace754c (on base 9633138; RTX 3070, driver 616.56, Windows 11, debug, --skip hle::xaudio2):

  • cargo test -p xcl --lib -- --test-threads=4: 1165 passed, 2 failed, 26 ignored: hle::d3d12x::device_x::tests::pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa ("format 85 kept", left 28, right 85) and gpu::recomp::pso::shader_cache_tests::rerouted_disk_entries_follow_the_direct_translator.
  • cargo test -p xcl --lib -- hle::d3d12x --test-threads=4, 3 runs: 207 passed, 1 failed each time (the pc_resource_desc_… test).
  • Both tests also fail 3 of 3 on the base 9633138 alone, and this PR touches neither file (alloc_pool.rs, real.rs only). main has since changed device_x.rs and pso.rs; on main 08db802 the full suite passes (1295 passed, 0 failed) and the hle::d3d12x filter passed in 2 of 3 runs, with an unrelated a_dispatch_with_a_pipeline_still_building_waits_at_the_submit failure once. So the two failures belong to the base; a rebase onto main should clear them. I haven't run the rebased branch.

Test report at the current head f581057: RTX 3070 (Ampere, driver 616.56), Windows 11, debug.

  • cargo test -p xcl --lib -- hle::d3d12x --test-threads=4, 3 runs: 166 passed, 0 failed each time. main 6ea813a with the same command, alternated with these runs: 177 passed, 0 failed each time.
  • One earlier full cargo test -p xcl --lib -- --test-threads=4 run ended in a device hang (0x887a0006) right after a Wait64BitValueX was bridged to a GPU queue wait. That is the fence area this PR changes, but it didn't come back in the 3 targeted runs above, so I can't attribute it to the PR.
  • XCL_DIRECT_DXIL=1 ... gpu_: 125 passed, 2 failed. Both come from the PR's older base: gpu_fmt_encode_int_sat_and_f16_rtz is fixed on main by #2043, and gpu_image_get_resinfo_1d_array also fails on main (#2046).

AI-assisted (Claude Code). Synthetic tests only.

<!-- greyfinch-sync:ivall/xcl:comment:7154794162 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1945#issuecomment-7154794162). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-25T06:26:32Z. --- **Update, merged with `main`:** `ace754c` merged `--no-ff` onto `main` `08db802` (merge commit `0548a52`, clean), same card and settings: `cargo test -p xcl --lib -- --skip hle::xaudio2 --test-threads=4`: 1302 passed, 0 failed, 27 ignored (the same 25 `SKIPPED` lines as `main`); `cargo test -p xcl --lib -- hle::d3d12x --test-threads=4`, 3 runs: 256 passed, 0 failed each time. This is the merge, not the head: `ace754c` on its own base still fails the two base tests below until it is rebased. **Update, head `ace754c`** (on base `9633138`; RTX 3070, driver 616.56, Windows 11, debug, `--skip hle::xaudio2`): - `cargo test -p xcl --lib -- --test-threads=4`: 1165 passed, **2 failed**, 26 ignored: `hle::d3d12x::device_x::tests::pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa` ("format 85 kept", left 28, right 85) and `gpu::recomp::pso::shader_cache_tests::rerouted_disk_entries_follow_the_direct_translator`. - `cargo test -p xcl --lib -- hle::d3d12x --test-threads=4`, 3 runs: 207 passed, 1 failed each time (the `pc_resource_desc_…` test). - Both tests also fail 3 of 3 on the base `9633138` alone, and this PR touches neither file (`alloc_pool.rs`, `real.rs` only). `main` has since changed `device_x.rs` and `pso.rs`; on `main` `08db802` the full suite passes (1295 passed, 0 failed) and the `hle::d3d12x` filter passed in 2 of 3 runs, with an unrelated `a_dispatch_with_a_pipeline_still_building_waits_at_the_submit` failure once. So the two failures belong to the base; a rebase onto `main` should clear them. I haven't run the rebased branch. --- Test report at the current head `f581057`: RTX 3070 (Ampere, driver 616.56), Windows 11, debug. - `cargo test -p xcl --lib -- hle::d3d12x --test-threads=4`, 3 runs: 166 passed, 0 failed each time. `main` `6ea813a` with the same command, alternated with these runs: 177 passed, 0 failed each time. - One earlier full `cargo test -p xcl --lib -- --test-threads=4` run ended in a device hang (`0x887a0006`) right after a `Wait64BitValueX` was bridged to a GPU queue wait. That is the fence area this PR changes, but it didn't come back in the 3 targeted runs above, so I can't attribute it to the PR. - `XCL_DIRECT_DXIL=1 ... gpu_`: 125 passed, 2 failed. Both come from the PR's older base: `gpu_fmt_encode_int_sat_and_f16_rtz` is fixed on `main` by #2043, and `gpu_image_get_resinfo_1d_array` also fails on `main` (#2046). AI-assisted (Claude Code). Synthetic tests only.
Decodere commented 2026-11-25 12:06:22 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-11-25T11:28:44Z.


Rebased onto 96331383 (clean against main 426a5a74) -> ace754ce:

  • Resolved the alloc_pool.rs conflict with #2163 (State.last_submit / note_resubmits): forget_queue now also prunes completed State.last_submit entries for the released queue (and completed orphaned entries), zeroes last.queue = 0 on still-in-flight entries so queue-address reuse cannot report same_queue, and drops all removed/replaced COM fence handles outside STATE.lock().
  • Re-verified alloc_pool::tests (6/6 x3 --test-threads=1, 6/6 --test-threads=4, 6/6 WARP) and paired 60 s RTX 4060 smoke (1526 -> 1530 frames, 0 removals/crashes, 14482 -> 14468 MB).

AI use: rebased, tested, and drafted with Google Antigravity (Gemini 4 Neon).

<!-- greyfinch-sync:ivall/xcl:comment:7161099864 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1945#issuecomment-7161099864). Originally posted by [Decodere](https://github.com/Decodere) on 2026-11-25T11:28:44Z. --- Rebased onto `96331383` (clean against `main` `426a5a74`) -> `ace754ce`: - Resolved the `alloc_pool.rs` conflict with #2163 (`State.last_submit` / `note_resubmits`): `forget_queue` now also prunes completed `State.last_submit` entries for the released queue (and completed orphaned entries), zeroes `last.queue = 0` on still-in-flight entries so queue-address reuse cannot report `same_queue`, and drops all removed/replaced COM fence handles outside `STATE.lock()`. - Re-verified `alloc_pool::tests` (`6/6` x3 `--test-threads=1`, `6/6` `--test-threads=4`, `6/6` WARP) and paired 60 s RTX 4060 smoke (`1526 -> 1530` frames, `0` removals/crashes, `14482 -> 14468 MB`). _AI use: rebased, tested, and drafted with Google Antigravity (Gemini 4 Neon)._
thehollowedone commented 2026-11-25 12:06:26 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-25T11:42:23Z.


Independent Windows run on ace754c. Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti (621.35), Rust 1.99.1 MSVC, debug.

cargo build --offline --locked --workspace passed on the exact revision. cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --nocapture reported 1,243 passed, 2 failed, 46 ignored. Both failures were the stale assertions fixed by #2245. With this revision merged locally into 426a5a7, the same commands reported 1,245 passed, 0 failed, 46 ignored. Each run had 25 runtime skips included in Cargo's pass count.

I reran the simulated queue-key reuse check with native D3D12 fences. Releasing the old key left its old list marked in flight and cleared the queue identity from that submission. Finishing the newer native submission kept both the older list in flight and the backing busy. Signaling the old fence cleared both conditions, and the next queue cleanup removed the old submission record. No live work was blocked and no allocator was reset.

On the exact revision, cargo test --offline --locked -p xcl --lib released_queue_key_reuse_keeps_the_older_pending_fence -- --test-threads=1 --nocapture passed 1/0/0 with zero skips. Earlier side-by-side check on #1967.

Synthetic coverage only. AI-assisted. Codex (GPT-6, exact variant unavailable) extended the fixture, ran the tests, and drafted this report.

<!-- greyfinch-sync:ivall/xcl:comment:7161392639 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1945#issuecomment-7161392639). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-11-25T11:42:23Z. --- Independent Windows run on [ace754c](https://github.com/xcl-dev/xcl/commit/ace754ce635c06a03068601c12afcdc1ff60770c). Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti (621.35), Rust 1.99.1 MSVC, debug. `cargo build --offline --locked --workspace` passed on the exact revision. `cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --nocapture` reported **1,243 passed, 2 failed, 46 ignored**. Both failures were the stale assertions fixed by #2245. With this revision merged locally into [426a5a7](https://github.com/xcl-dev/xcl/commit/426a5a745db4d5e4b037449ede0b70cb342f5192), the same commands reported **1,245 passed, 0 failed, 46 ignored**. Each run had 25 runtime skips included in Cargo's pass count. I reran the simulated queue-key reuse check with native D3D12 fences. Releasing the old key left its old list marked in flight and cleared the queue identity from that submission. Finishing the newer native submission kept both the older list in flight and the backing busy. Signaling the old fence cleared both conditions, and the next queue cleanup removed the old submission record. No live work was blocked and no allocator was reset. On the exact revision, `cargo test --offline --locked -p xcl --lib released_queue_key_reuse_keeps_the_older_pending_fence -- --test-threads=1 --nocapture` passed 1/0/0 with zero skips. [Earlier side-by-side check on #1967](https://github.com/xcl-dev/xcl/pull/1967#issuecomment-7160727046). Synthetic coverage only. AI-assisted. Codex (GPT-6, exact variant unavailable) extended the fixture, ran the tests, and drafted this report.
upstream-sync closed this pull request 2026-11-25 23:07:51 +00:00
CalvyPZ commented 2026-11-25 23:09:16 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by CalvyPZ on 2026-11-25T22:44:04Z.


This PR has been marked as a duplicate and closed after multiple agreeing checks in #1607. If you believe this is incorrect please re-open with why.

<!-- greyfinch-sync:ivall/xcl:comment:7176723911 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1945#issuecomment-7176723911). Originally posted by [CalvyPZ](https://github.com/CalvyPZ) on 2026-11-25T22:44:04Z. --- This PR has been marked as a duplicate and closed after multiple agreeing checks in #1607. If you believe this is incorrect please re-open with why.
Decodere commented 2026-11-25 23:09:19 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-11-25T22:52:03Z.


@CalvyPZ Could you please reopen #1945? (GitHub returns HTTP 422 when a non-collaborator PR author attempts to reopen a PR closed by a collaborator.)

  • Both PRs in #1607 group D72 (#1945 and #1967) were closed in the 22:44Z sweep, leaving #1909 open with no active PR.
  • #1607's own D72 row is rated different approaches across all 4 checks (oni-swr, upipibi, iggyvilla, safesearch77), and #1909's comparison (JJAutoCompare) explicitly recommended advancing #1945 over #1967 (ace754ce creates internal allocator-pool fences via the native slot outside real::FENCES, preserves still-pending marks in Backing::retired across queue-address reuse, and prunes State::last_submit).
  • #1945 (ace754ce) is MERGEABLE/CLEAN with green CI and independent RTX 3080 Ti verification (thehollowedone).
<!-- greyfinch-sync:ivall/xcl:comment:7176878859 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1945#issuecomment-7176878859). Originally posted by [Decodere](https://github.com/Decodere) on 2026-11-25T22:52:03Z. --- `@CalvyPZ` Could you please reopen `#1945`? (GitHub returns `HTTP 422` when a non-collaborator PR author attempts to reopen a PR closed by a collaborator.) - Both PRs in `#1607` group `D72` (`#1945` and `#1967`) were closed in the `22:44Z` sweep, leaving `#1909` open with no active PR. - `#1607`'s own `D72` row is rated `different approaches` across all 4 checks (`oni-swr`, `upipibi`, `iggyvilla`, `safesearch77`), and `#1909`'s comparison (`JJAutoCompare`) explicitly recommended advancing `#1945` over `#1967` (`ace754ce` creates internal allocator-pool fences via the native slot outside `real::FENCES`, preserves still-pending marks in `Backing::retired` across queue-address reuse, and prunes `State::last_submit`). - `#1945` (`ace754ce`) is `MERGEABLE`/`CLEAN` with green CI and independent RTX 3080 Ti verification (`thehollowedone`).
upstream-sync reopened this pull request 2026-11-26 00:04:44 +00:00
futurepro62 commented 2026-11-26 06:06:48 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-26T05:51:16Z.


NVIDIA and AMD full-suite run of head ace754ce, on its own base 9633138 and merged with current main b49be183, to go with the reports above by thehollowedone, upipibi, since none of them covers AMD. On its base, the 3 failures come from changes made on main after that base (#2245 and ea088a5); merged with main, both cards pass. The bare-head runs come first.

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: 1163 passed, 2 failed, 24 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, 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.
  • Failed: gpu::recomp::pso::shader_cache_tests::rerouted_disk_entries_follow_the_direct_translator, hle::d3d12x::device_x::tests::pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa. (stale on this base, fixed on main by #2245; see the merged run below)
  • The new tests ran and passed: forget_queue_prunes_completed_and_preserves_pending_across_address_reuse, released_queue_frees_alloc_pool_fence_and_skips_title_fences.
  • 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: 1172 passed, 3 failed, 26 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))).
  • --skip leaves out tests that fail on main b49be183 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.
  • AMD failures on this base: rerouted_disk_entries_follow_the_direct_translator (#2245), gpu_image_get_resinfo_past_last_level (ea088a5), pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa (#2245).
  • Merged with main b49be183 (git merge --no-ff, clean, local only): NVIDIA XCL_REQUIRE_GPU=mesh cargo test --workspace with the same skips: 1425 passed, 0 failed, 45 ignored; AMD Radeon iGPU (XCL_ADAPTER=radeon, same skips): 1436 passed, 0 failed, 47 ignored.

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:7183865108 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1945#issuecomment-7183865108). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-26T05:51:16Z. --- NVIDIA and AMD full-suite run of head `ace754ce`, on its own base `9633138` and merged with current `main` `b49be183`, to go with the reports above by thehollowedone, upipibi, since none of them covers AMD. On its base, the 3 failures come from changes made on `main` after that base (#2245 and `ea088a5`); merged with `main`, both cards pass. The bare-head runs come first. **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`: **1163 passed, 2 failed, 24 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`, `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`. - Failed: `gpu::recomp::pso::shader_cache_tests::rerouted_disk_entries_follow_the_direct_translator`, `hle::d3d12x::device_x::tests::pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa`. (stale on this base, fixed on `main` by #2245; see the merged run below) - The new tests ran and passed: `forget_queue_prunes_completed_and_preserves_pending_across_address_reuse`, `released_queue_frees_alloc_pool_fence_and_skips_title_fences`. - 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`: **1172 passed, 3 failed, 26 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))). - `--skip` leaves out tests that fail on main `b49be183` 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`. - AMD failures on this base: `rerouted_disk_entries_follow_the_direct_translator` (#2245), `gpu_image_get_resinfo_past_last_level` (`ea088a5`), `pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa` (#2245). - **Merged with `main` `b49be183`** (`git merge --no-ff`, clean, local only): NVIDIA `XCL_REQUIRE_GPU=mesh cargo test --workspace` with the same skips: **1425 passed, 0 failed, 45 ignored**; AMD Radeon iGPU (`XCL_ADAPTER=radeon`, same skips): **1436 passed, 0 failed, 47 ignored**. **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-26 07:03:38 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T06:41:24Z.


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:7184683128 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1945#issuecomment-7184683128). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-26T06:41:24Z. --- 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
throny commented 2026-11-27 19:24:31 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-27T19:24:31Z.


merge-check claim
head: ace754ce63

<!-- greyfinch-sync:ivall/xcl:comment:7226497375 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1945#issuecomment-7226497375). Originally posted by [throny](https://github.com/throny) on 2026-11-27T19:24:31Z. --- merge-check claim head: ace754ce635c06a03068601c12afcdc1ff60770c
throny commented 2026-11-27 19:43:49 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-27T19:43:49Z.


merge-check
base: 6089122a
head: ace754ce63
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 1467 passed, 0 failed, 47 ignored (26 SKIPPED lines); base alone: 1465 passed, 0 failed, 47 ignored
review: one blocking finding: allocator_in_flight (alloc_pool.rs, unchanged by this PR) looks at a backing's marks only, not at the new retired list. After forget_queue moves a still-pending mark to retired, list_x can see the allocator as idle and reset or drop a PC allocator the GPU is still using; before this PR the mark stayed in marks. Backing::free() does check retired. Otherwise fine: fences are released outside STATE, the hand-written test fence is test-only and its reference counts add up, and the tests would not pass without the change. Open from earlier: forget_queue hooks only the last-release branch of q_release.
performance: one small Vec push and a usually empty scan per ExecuteCommandLists (reasoned).
verdict: not yet: allocator_in_flight must also count retired (with a test); I will rerun the suite on the new head.
hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).

<!-- greyfinch-sync:ivall/xcl:comment:7226814240 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1945#issuecomment-7226814240). Originally posted by [throny](https://github.com/throny) on 2026-11-27T19:43:49Z. --- merge-check base: 6089122a head: ace754ce635c06a03068601c12afcdc1ff60770c merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 1467 passed, 0 failed, 47 ignored (26 SKIPPED lines); base alone: 1465 passed, 0 failed, 47 ignored review: one blocking finding: allocator_in_flight (alloc_pool.rs, unchanged by this PR) looks at a backing's marks only, not at the new retired list. After forget_queue moves a still-pending mark to retired, list_x can see the allocator as idle and reset or drop a PC allocator the GPU is still using; before this PR the mark stayed in marks. Backing::free() does check retired. Otherwise fine: fences are released outside STATE, the hand-written test fence is test-only and its reference counts add up, and the tests would not pass without the change. Open from earlier: forget_queue hooks only the last-release branch of q_release. performance: one small Vec push and a usually empty scan per ExecuteCommandLists (reasoned). verdict: not yet: allocator_in_flight must also count retired (with a test); I will rerun the suite on the new head. hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).
RavenCurseBurg commented 2026-11-27 20:11:31 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by RavenCurseBurg on 2026-11-27T20:11:31Z.


I prepared a candidate fix for the allocator query following the merge check. It applies to this PR after merging main 6089122a1c96 into head ace754ce635c. The query is present on the merged source. The candidate uses one pending-fence predicate for both backing reuse and allocator activity, while only backing reuse checks whether a list still owns its recording.

Tested

On Windows 11 (Core i7-13700), a CPU-only Python model checked 50 combinations of live marks, retired marks and recording ownership, plus four allocator lookup cases. I checked the candidate source against those predicates and ran git diff --check. The existing mock-fence Rust test now checks the allocator query after queue release, after queue-address reuse, and after completion.

Not tested

This machine has no configured Rust toolchain. The candidate is awaiting a native run of cargo test -p xcl --lib forget_queue_prunes_completed_and_preserves_pending_across_address_reuse. No Rust build, GPU run or retail smoke was performed here.

OpenAI Codex (GPT-6) prepared the patch and ran the model checks.

<!-- greyfinch-sync:ivall/xcl:comment:7227263467 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1945#issuecomment-7227263467). Originally posted by [RavenCurseBurg](https://github.com/RavenCurseBurg) on 2026-11-27T20:11:31Z. --- I prepared a [candidate fix for the allocator query](https://github.com/RavenCurseBurg/xcl/commit/ebb00b11fe7764f676da0508c46d4ad4354a69eb) following the [merge check](https://github.com/xcl-dev/xcl/pull/1945#issuecomment-7226814240). It applies to this PR after merging main `6089122a1c96` into head `ace754ce635c`. The query is present on the merged source. The candidate uses one pending-fence predicate for both backing reuse and allocator activity, while only backing reuse checks whether a list still owns its recording. **Tested** On Windows 11 (Core i7-13700), a CPU-only Python model checked 50 combinations of live marks, retired marks and recording ownership, plus four allocator lookup cases. I checked the candidate source against those predicates and ran `git diff --check`. The existing mock-fence Rust test now checks the allocator query after queue release, after queue-address reuse, and after completion. **Not tested** This machine has no configured Rust toolchain. The candidate is awaiting a native run of `cargo test -p xcl --lib forget_queue_prunes_completed_and_preserves_pending_across_address_reuse`. No Rust build, GPU run or retail smoke was performed here. OpenAI Codex (GPT-6) prepared the patch and ran the model checks.
KOLESNiii commented 2026-11-28 00:18:45 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-28T00:18:45Z.


merge-check claim
head: ace754ce63

<!-- greyfinch-sync:ivall/xcl:comment:7230813973 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1945#issuecomment-7230813973). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-11-28T00:18:45Z. --- merge-check claim head: ace754ce635c06a03068601c12afcdc1ff60770c
KOLESNiii commented 2026-11-28 01:10:48 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-28T01:10:48Z.


merge-check
base: 2c717a043c
head: ace754ce63
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 1468 passed, 0 failed, 47 ignored, 25 SKIPPED: 21 no wave64, 3 per-lane f16/f32 forms refused (#1426 semantics), 1 no heap windows; failing: none. The suite ran on this PC at the same time as 5 other PRs' suites, in one queued job.
review: none. Whole diff read (alloc_pool.rs: Backing.retired, forget_list, forget_queue, executed, note_resubmits, title_reset_in + 3 tests; real.rs create_pc_fence, q_release, is_fence). Pending marks of a released queue move to retired and keep the backing busy until the GPU passes them; fences are released outside STATE's lock; the internal per-queue fence is created through the original CreateFence, so it is not adopted or added to FENCES. Note: #1967 changes the same q_release line and also adds queue-release cleanup to alloc_pool.rs; the two conflict.
performance: reasoned, not measured: executed() (per ExecuteCommandLists) also polls the backing's retired list, normally empty; the rest runs on queue release only.
verdict: safe to merge
hardware / tool and model: Windows 11 build 26300.9974, NVIDIA GeForce RTX 2070 SUPER 8 GB (driver 621.40, wave32 only), AMD Ryzen 5 3600XT; rustc 1.100.1 (20ddd0171 2026-11-25) x86_64-pc-windows-msvc, debug test profile; trial merge 6f619f83851af02f38151d294993eb4e10b097a9 (local, not pushed). Claude Code: Claude Opus 5.5 (coordination, full-diff review, draft).

<!-- greyfinch-sync:ivall/xcl:comment:7231478256 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1945#issuecomment-7231478256). Originally posted by [KOLESNiii](https://github.com/KOLESNiii) on 2026-11-28T01:10:48Z. --- merge-check base: 2c717a043c8488938179fca81da4bb9e7913a358 head: ace754ce635c06a03068601c12afcdc1ff60770c merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 1468 passed, 0 failed, 47 ignored, 25 SKIPPED: 21 no wave64, 3 per-lane f16/f32 forms refused (#1426 semantics), 1 no heap windows; failing: none. The suite ran on this PC at the same time as 5 other PRs' suites, in one queued job. review: none. Whole diff read (alloc_pool.rs: Backing.retired, forget_list, forget_queue, executed, note_resubmits, title_reset_in + 3 tests; real.rs create_pc_fence, q_release, is_fence). Pending marks of a released queue move to retired and keep the backing busy until the GPU passes them; fences are released outside STATE's lock; the internal per-queue fence is created through the original CreateFence, so it is not adopted or added to FENCES. Note: #1967 changes the same q_release line and also adds queue-release cleanup to alloc_pool.rs; the two conflict. performance: reasoned, not measured: executed() (per ExecuteCommandLists) also polls the backing's retired list, normally empty; the rest runs on queue release only. verdict: safe to merge hardware / tool and model: Windows 11 build 26300.9974, NVIDIA GeForce RTX 2070 SUPER 8 GB (driver 621.40, wave32 only), AMD Ryzen 5 3600XT; rustc 1.100.1 (20ddd0171 2026-11-25) x86_64-pc-windows-msvc, debug test profile; trial merge 6f619f83851af02f38151d294993eb4e10b097a9 (local, not pushed). Claude Code: Claude Opus 5.5 (coordination, full-diff review, draft).
thehollowedone commented 2026-11-28 03:11:42 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-28T03:11:42Z.


Follow-up to the allocator-query candidate: it covers the reported case where a queue is fully cleaned up before its address is reused. I found a separate interleaving that its test does not cover.

In q_release, native Release returns zero before forget_queue removes the old address-keyed fence. If another thread creates a queue at that address and submits before cleanup, executed can signal the old fence on the new queue. That can make pending work on the old queue appear complete; a submission using the same backing can also replace its pending mark. The delayed cleanup can then remove the new queue's state. This requires concurrent address reuse; I have traced the source path, not observed it on a GPU.

A focused regression could pause A after native Release returns zero, adopt and submit B at A's address, then resume A's cleanup. B must use a fresh fence, its state must survive A's cleanup, and A's allocator must remain busy until A's own fence completes. The smallest safe fix appears to be a generation for each adopted queue, with retirement of the old generation before publishing the new one and release cleanup conditional on the generation captured before native Release. The address-keyed state in list_x also needs the same ordering. Holding a global lock across native Release risks reentrant COM release, so I would avoid that shortcut.

AI use: Codex (GPT-6.2 Sol and GPT-6.2 Astra) traced the source and drafted this review. No build or runtime test was run for this interleaving.

<!-- greyfinch-sync:ivall/xcl:comment:7232870158 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1945#issuecomment-7232870158). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-11-28T03:11:42Z. --- Follow-up to the [allocator-query candidate](https://github.com/RavenCurseBurg/xcl/commit/ebb00b11fe7764f676da0508c46d4ad4354a69eb): it covers the reported case where a queue is fully cleaned up before its address is reused. I found a separate interleaving that its test does not cover. In [`q_release`](https://github.com/xcl-dev/xcl/blob/ace754ce635c06a03068601c12afcdc1ff60770c/crates/xcl/src/hle/d3d12x/real.rs#L7182-L7189), native `Release` returns zero before `forget_queue` removes the old address-keyed fence. If another thread creates a queue at that address and submits before cleanup, [`executed`](https://github.com/xcl-dev/xcl/blob/ace754ce635c06a03068601c12afcdc1ff60770c/crates/xcl/src/hle/d3d12x/alloc_pool.rs#L264-L288) can signal the old fence on the new queue. That can make pending work on the old queue appear complete; a submission using the same backing can also replace its pending mark. The delayed cleanup can then remove the new queue's state. This requires concurrent address reuse; I have traced the source path, not observed it on a GPU. A focused regression could pause A after native `Release` returns zero, adopt and submit B at A's address, then resume A's cleanup. B must use a fresh fence, its state must survive A's cleanup, and A's allocator must remain busy until A's own fence completes. The smallest safe fix appears to be a generation for each adopted queue, with retirement of the old generation before publishing the new one and release cleanup conditional on the generation captured before native `Release`. The address-keyed state in `list_x` also needs the same ordering. Holding a global lock across native `Release` risks reentrant COM release, so I would avoid that shortcut. AI use: Codex (GPT-6.2 Sol and GPT-6.2 Astra) traced the source and drafted this review. No build or runtime test was run for this interleaving.
RavenCurseBurg commented 2026-11-28 04:25:39 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by RavenCurseBurg on 2026-11-28T04:25:39Z.


Following up on the queue lifetime feedback with a candidate for current main. It is based on e429936c. The earlier ebb00b11 candidate now conflicts in alloc_pool.rs and real.rs.

The candidate uses main’s retirement worker to clear the allocator and command-list caches while it still holds a reference to the queue. It registers PC-created queues before returning them to the caller. After the native reference count reaches zero, release can remove only the lease it captured for that queue. The regular submission marker, receipt marker and retirement marker use Decodere’s private fence constructor from this PR.

I checked eight source properties against main, including the release routing, cleanup order, marker identity check and title-fence registry. Five edited Rust files had no additional tree-sitter diagnostics, and git diff --check passed. I extended the lease unit test and added GPU tests for ownership before the first submission and for private fence registration. I could not build or run the Rust tests on this host. Native Windows verification of the candidate, including GPU and retail coverage, is still pending.

AI use — OpenAI Codex (GPT-6) prepared the port, tests and source checks.

<!-- greyfinch-sync:ivall/xcl:comment:7234031589 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1945#issuecomment-7234031589). Originally posted by [RavenCurseBurg](https://github.com/RavenCurseBurg) on 2026-11-28T04:25:39Z. --- Following up on the queue lifetime feedback with a [candidate for current main](https://github.com/RavenCurseBurg/xcl/commit/6c7e9da5c46460d3a8e9f8829431d21d88923b6d). It is based on `e429936c`. The earlier `ebb00b11` candidate now conflicts in `alloc_pool.rs` and `real.rs`. The candidate uses main’s retirement worker to clear the allocator and command-list caches while it still holds a reference to the queue. It registers PC-created queues before returning them to the caller. After the native reference count reaches zero, release can remove only the lease it captured for that queue. The regular submission marker, receipt marker and retirement marker use Decodere’s private fence constructor from this PR. I checked eight source properties against main, including the release routing, cleanup order, marker identity check and title-fence registry. Five edited Rust files had no additional tree-sitter diagnostics, and `git diff --check` passed. I extended the lease unit test and added GPU tests for ownership before the first submission and for private fence registration. I could not build or run the Rust tests on this host. Native Windows verification of the candidate, including GPU and retail coverage, is still pending. AI use — OpenAI Codex (GPT-6) prepared the port, tests and source checks.
Foniass commented 2026-12-01 07:08:57 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T07:08:57Z.


Triage (#1607) – head ace754c

Part of this PR is now on main. Commit 4a4c5f7b added alloc_pool::forget_queue, which present::invalidate_queue_caches calls once a released queue's retirement mark completes. It drops State.fences, the backing marks and the last_submit entries.
So the forget_queue / retired / q_release part here repeats main and conflicts with it.
The real::create_pc_fence part is not on main and is still needed for #1909. On main, alloc_pool's internal fences are still made through dev_create_fence, which AddRefs them and records them in FENCES, so they are never freed. That is the Refcount: 2 reported in #1909.
#1967 makes the same queue-release change, smaller.
Recommendation: keep open (rebase down to the create_pc_fence change).

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:7303702019 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1945#issuecomment-7303702019). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T07:08:57Z. --- **Triage (#1607)** – head ace754c Part of this PR is now on main. Commit 4a4c5f7b added `alloc_pool::forget_queue`, which `present::invalidate_queue_caches` calls once a released queue's retirement mark completes. It drops `State.fences`, the backing `marks` and the `last_submit` entries. So the `forget_queue` / `retired` / `q_release` part here repeats main and conflicts with it. The `real::create_pc_fence` part is not on main and is still needed for #1909. On main, alloc_pool's internal fences are still made through `dev_create_fence`, which AddRefs them and records them in `FENCES`, so they are never freed. That is the `Refcount: 2` reported in #1909. #1967 makes the same queue-release change, smaller. Recommendation: keep open (rebase down to the `create_pc_fence` change). AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

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

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