D3D12.X: a queue the title releases is not kept alive by submit tracking #1681

Closed
b3IKK wants to merge 1 commit from upstream-pr/1691 into main
b3IKK commented 2026-11-24 19:20:37 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by b3IKK on 2026-11-24T19:20:37Z.


Fixes #1668.

present::note_execute took a reference to every command queue a title submitted work to (so late_release can fence what it holds), and never dropped it. The queue's own last Release therefore only brought the count to 1, q_release never saw 0, and every queue a title ever submitted to — with the driver memory behind it — stayed allocated for the rest of the process.

That is the asymmetry in the issue: "create and release unused queues" passes 128/128 (no submit, so no reference is taken), while "create, submit, synchronize and release" fails on the 64th queue with E_OUTOFMEMORY.

This drops the reference when a release brings the count down to it (n == 1): the queue is forgotten by the submit tracking (and the present candidate that names it), the fence late_release keeps for that queue is dropped, and the reference goes. The presenter now also holds its own reference to the queue it makes a swap chain for, so that pointer cannot dangle once the title lets its queues go.

Since the review (@upipibi's race, validated by @DEViANCEVxXXxM on an RTX 3090): a tracked queue can now be freed, so the two readers of the list no longer take raw pointers out of it. late_release::drain_known and real::drain_gpu get their references from present::known_queues_held(), which takes them while the list is locked.

And the device loss from the follow-up runs: a queue has to outlive the work submitted to it. Dropping the reference as soon as the title's last release arrived could free a queue the GPU was still executing — 0x887A0005 in 1 of 6 runs on @upipibi's RTX 3070 with this change merged onto main. The released queue's reference now goes to late_release, which signals a value on that queue's fence and lets the reference go once every earlier submission has passed it, exactly as it already holds a resource's last release. list_x's queue list is cleared when that reference finally goes, not before.

What is in it

  • crates/xcl/src/hle/d3d12x/real.rs: in q_release, when the count reaches the one reference the submit tracking holds, hand the queue back (present::forget_queue) and pass the reference to late_release::hold_queue; drain_gpu signals queues it holds a reference to. GPU tests a_queue_the_title_releases_is_not_kept_alive_by_the_submit_tracking, a_tracked_queue_a_reader_holds_outlives_the_titles_release and a_released_queue_is_held_until_its_submitted_work_is_done.
  • crates/xcl/src/hle/d3d12x/present.rs: forget_queue untracks a released queue and drops the present candidate naming it; known_queues_held returns the tracked queues with references taken under the lock; new_presenter holds its own reference to the queue and Presenter::drop releases it.
  • crates/xcl/src/hle/d3d12x/late_release.rs: forget_queue drops the fence kept for a queue that is gone (a sealed batch keeps its own clone); hold_queue fences a released queue and drops its reference once the fence passes; take_released_queues in drain_known; one ensure_thread starts the drain thread for both paths (hold and hold_queue), so a title that does both does not run two.

Tested

  • hardware (GPU + driver, CPU), Windows build, Rust version, debug / release: NVIDIA GeForce RTX 5080 (driver 32.0.16.1088), AMD Ryzen 9 9950X3D, Windows 11 10.0.26300, Rust 1.100.0 (stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5, debug (scripts/test.ps1) and release (scripts/smoke.ps1)
  • .\scripts\test.ps1 (cargo build --workspace + cargo test --workspace -- --test-threads=4): 1246 passed, 0 failed, 46 ignored (SKIPPED: the wave64 / direct-DXIL per-lane tests that need 64-lane hardware or a semantics mode this adapter refuses, no heap windows, and cannot disable the driver cache (Windows Developer Mode is required))
  • cargo test -p xcl --lib -- a_released_queue_is_held: 1 passed. With the deferral taken out: 0 passed, 1 failed — the GPU may still run what was submitted to the queue: its reference is held.
  • the three tests @upipibi named (mid_list_write64_wait64_split_avoids_cycle_and_reuses_spares, rotating_queue_self_deadlock_and_non_monotonic_rescue_do_not_hang, timestamps_outside_unified_memory_land_after_the_queue), --test-threads=2, 5 runs: 3 passed, 0 failed each time.
  • cargo test -p xcl --lib hle::d3d12x:: -- --test-threads=2, 2 runs: 180 passed, 0 failed, 2 ignored each time, no device removal.

Regression run

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

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

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

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

Not tested

  • @upipibi's card. The failure has not reproduced here: 5 runs of the three named tests and 2 runs of the whole hle::d3d12x:: subset with two threads were clean on this RTX 5080, so the deferral is shown by the new test (the released queue is held while its work is in flight) rather than by a device removal that no longer happens.
  • the race itself: a freed queue does not reliably fault, so there is no test that fails on the previous head for it
  • the reporter's synthetic loop (128 create/submit/sync/release) on this machine; @DEViANCEVxXXxM ran it on an RTX 3090 against an earlier head
  • AMD GPUs and native wave64 hardware
  • other titles (Minecraft Preview, Unicorn Overlord, Fortnite, XDefiant) and Linux / Wine

AI use

  • OpenCode, Claude Fable 5.2: traced the queue lifetime from #1668 through present/late_release/q_release, wrote the fix and the tests (and confirmed each fails with the change it covers taken out), applied the reviewers' ownership change and the deferred queue release, rebased onto 568e7db, ran the test suite, the named tests and the scripts/smoke.ps1 runs, and drafted this PR description.
<!-- greyfinch-sync:ivall/xcl:issue:5478771170 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1691). Originally posted by [b3IKK](https://github.com/b3IKK) on 2026-11-24T19:20:37Z. --- Fixes #1668. `present::note_execute` took a reference to every command queue a title submitted work to (so `late_release` can fence what it holds), and never dropped it. The queue's own last `Release` therefore only brought the count to 1, `q_release` never saw 0, and every queue a title ever submitted to — with the driver memory behind it — stayed allocated for the rest of the process. That is the asymmetry in the issue: "create and release unused queues" passes 128/128 (no submit, so no reference is taken), while "create, submit, synchronize and release" fails on the 64th queue with `E_OUTOFMEMORY`. This drops the reference when a release brings the count down to it (`n == 1`): the queue is forgotten by the submit tracking (and the present candidate that names it), the fence `late_release` keeps for that queue is dropped, and the reference goes. The presenter now also holds its own reference to the queue it makes a swap chain for, so that pointer cannot dangle once the title lets its queues go. **Since the review** (@upipibi's race, validated by @DEViANCEVxXXxM on an RTX 3090): a tracked queue can now be freed, so the two readers of the list no longer take raw pointers out of it. `late_release::drain_known` and `real::drain_gpu` get their references from `present::known_queues_held()`, which takes them while the list is locked. **And the device loss from the follow-up runs:** a queue has to outlive the work submitted to it. Dropping the reference as soon as the title's last release arrived could free a queue the GPU was still executing — `0x887A0005` in 1 of 6 runs on @upipibi's RTX 3070 with this change merged onto `main`. The released queue's reference now goes to `late_release`, which signals a value on that queue's fence and lets the reference go once every earlier submission has passed it, exactly as it already holds a resource's last release. `list_x`'s queue list is cleared when that reference finally goes, not before. **What is in it** - `crates/xcl/src/hle/d3d12x/real.rs`: in `q_release`, when the count reaches the one reference the submit tracking holds, hand the queue back (`present::forget_queue`) and pass the reference to `late_release::hold_queue`; `drain_gpu` signals queues it holds a reference to. GPU tests `a_queue_the_title_releases_is_not_kept_alive_by_the_submit_tracking`, `a_tracked_queue_a_reader_holds_outlives_the_titles_release` and `a_released_queue_is_held_until_its_submitted_work_is_done`. - `crates/xcl/src/hle/d3d12x/present.rs`: `forget_queue` untracks a released queue and drops the present candidate naming it; `known_queues_held` returns the tracked queues with references taken under the lock; `new_presenter` holds its own reference to the queue and `Presenter::drop` releases it. - `crates/xcl/src/hle/d3d12x/late_release.rs`: `forget_queue` drops the fence kept for a queue that is gone (a sealed batch keeps its own clone); `hold_queue` fences a released queue and drops its reference once the fence passes; `take_released_queues` in `drain_known`; one `ensure_thread` starts the drain thread for both paths (`hold` and `hold_queue`), so a title that does both does not run two. **Tested** - hardware (GPU + driver, CPU), Windows build, Rust version, debug / release: NVIDIA GeForce RTX 5080 (driver 32.0.16.1088), AMD Ryzen 9 9950X3D, Windows 11 10.0.26300, Rust 1.100.0 (`stable-x86_64-pc-windows-msvc`), DXC 1.9.2609.5, debug (`scripts/test.ps1`) and release (`scripts/smoke.ps1`) - `.\scripts\test.ps1` (`cargo build --workspace` + `cargo test --workspace -- --test-threads=4`): 1246 passed, 0 failed, 46 ignored (SKIPPED: the wave64 / direct-DXIL per-lane tests that need 64-lane hardware or a semantics mode this adapter refuses, `no heap windows`, and `cannot disable the driver cache (Windows Developer Mode is required)`) - `cargo test -p xcl --lib -- a_released_queue_is_held`: 1 passed. With the deferral taken out: 0 passed, 1 failed — `the GPU may still run what was submitted to the queue: its reference is held`. - the three tests @upipibi named (`mid_list_write64_wait64_split_avoids_cycle_and_reuses_spares`, `rotating_queue_self_deadlock_and_non_monotonic_rescue_do_not_hang`, `timestamps_outside_unified_memory_land_after_the_queue`), `--test-threads=2`, 5 runs: 3 passed, 0 failed each time. - `cargo test -p xcl --lib hle::d3d12x:: -- --test-threads=2`, 2 runs: 180 passed, 0 failed, 2 ignored each time, no device removal. **Regression run** main (`426a5a7`, clean tree, no local changes): ``` xcl-smoke v1 commit: 426a5a745db4d5e4b037449ede0b70cb342f5192 gpu: NVIDIA GeForce RTX 5080 title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1642 (PresentX 1642) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15158 MB ``` PR (`f71cf21`, clean tree, no local changes): ``` xcl-smoke v1 commit: f71cf2147ecd3b4aa67b71c53ebcd8cfec326c2b gpu: NVIDIA GeForce RTX 5080 title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1645 (PresentX 1645) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15159 MB ``` **Not tested** - @upipibi's card. The failure has not reproduced here: 5 runs of the three named tests and 2 runs of the whole `hle::d3d12x::` subset with two threads were clean on this RTX 5080, so the deferral is shown by the new test (the released queue is held while its work is in flight) rather than by a device removal that no longer happens. - the race itself: a freed queue does not reliably fault, so there is no test that fails on the previous head for it - the reporter's synthetic loop (128 create/submit/sync/release) on this machine; @DEViANCEVxXXxM ran it on an RTX 3090 against an earlier head - AMD GPUs and native wave64 hardware - other titles (Minecraft Preview, Unicorn Overlord, Fortnite, XDefiant) and Linux / Wine **AI use** - OpenCode, Claude Fable 5.2: traced the queue lifetime from #1668 through `present`/`late_release`/`q_release`, wrote the fix and the tests (and confirmed each fails with the change it covers taken out), applied the reviewers' ownership change and the deferred queue release, rebased onto `568e7db`, ran the test suite, the named tests and the `scripts/smoke.ps1` runs, and drafted this PR description.
DEViANCEVxXXxM commented 2026-11-24 21:08:58 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DEViANCEVxXXxM on 2026-11-24T19:36:49Z.


Thanks for the quick fix! I'm the original reporter of #1668.

I have an RTX 3090 available and can independently validate this PR using the original synthetic regression, concurrent stress, endurance, and GPU data integrity tests.

I'll post the results here for comparison.

<html>

Independent validation — PASS

Tested commit 1de417cca5163665c181d5a3557bff6df77c59e5 on my RTX 3090 (driver 621.01, Windows 26H1 build 28000.3501), with the D3D12 debug layer enabled.

Test | Result -- | -- Original unused queue regression | 128/128 Original submitted queue regression | 128/128 Concurrent stress repeatability | 10/10 runs Single-process endurance | 4096/4096 operations Concurrent GPU copy integrity | 1024/1024 copies Verified data values | 1,048,576/1,048,576 OOM, timeouts, reported D3D12 errors | None

The original failure from #1668 no longer reproduces. All 12 additional stress runs passed using unchanged synthetic test binaries.

One additional observation: during the endurance test, the device reference count was 112, 131, 142, and 161 at rounds 128, 256, 384, and 512 respectively. The final Live Producer refcount was 155. These snapshots were taken under concurrent load, so this is not conclusive evidence of a remaining leak, but may be worth investigating separately.

The original queue exhaustion regression is confirmed fixed in my test environment.

Thanks for the fix!

</html>
<!-- greyfinch-sync:ivall/xcl:comment:7142346204 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1691#issuecomment-7142346204). Originally posted by [DEViANCEVxXXxM](https://github.com/DEViANCEVxXXxM) on 2026-11-24T19:36:49Z. --- Thanks for the quick fix! I'm the original reporter of #1668. I have an RTX 3090 available and can independently validate this PR using the original synthetic regression, concurrent stress, endurance, and GPU data integrity tests. I'll post the results here for comparison. <html> <body> <!--StartFragment--><h2><span>Independent validation — PASS</span></h2><p><span>Tested commit </span><code><span>1de417cca5163665c181d5a3557bff6df77c59e5</span></code><span> on my RTX 3090 (driver 621.01, Windows 26H1 build 28000.3501), with the D3D12 debug layer enabled.</span></p> Test | Result -- | -- Original unused queue regression | 128/128 Original submitted queue regression | 128/128 Concurrent stress repeatability | 10/10 runs Single-process endurance | 4096/4096 operations Concurrent GPU copy integrity | 1024/1024 copies Verified data values | 1,048,576/1,048,576 OOM, timeouts, reported D3D12 errors | None <p><span>The original failure from #1668 no longer reproduces. All 12 additional stress runs passed using unchanged synthetic test binaries.</span></p><p><span>One additional observation: during the endurance test, the device reference count was 112, 131, 142, and 161 at rounds 128, 256, 384, and 512 respectively. The final Live Producer refcount was 155. These snapshots were taken under concurrent load, so this is not conclusive evidence of a remaining leak, but may be worth investigating separately.</span></p><p><span>The original queue exhaustion regression is confirmed fixed in my test environment.</span></p><p><span>Thanks for the fix!</span></p><!--EndFragment--> </body> </html>
upipibi commented 2026-11-24 21:09:05 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-24T19:47:55Z.


Tested on an RTX 3070 (driver 616.56, Windows 11) at 1de417c.

  • a_queue_the_title_releases_is_not_kept_alive_by_the_submit_tracking passes.
  • hle::d3d12x:: 146 passed, 0 failed, 3/3 runs. That's with #1523 applied. Without it, the subset crashes 3/3 with 0xC0000005: that's the fake-fence crash #1523 fixes (it does the same on main), not this PR.

One race this PR opens. Before it, a queue in QUEUES was never freed, so known_queues() returning raw pointers was safe. Now q_release can free a queue right after it leaves the list, and both callers use the pointer after the lock is gone:

  • late_release::drain_known (runs on the late-release thread and on every note_execute): snapshot, then from_raw_borrowed(..).clone().
  • real::drain_gpu: snapshot, then Signal on the borrowed pointer without a reference of its own.

Interleaving: the reader snapshots → the title's last Release takes the count to 1 → forget_queue → the second f(this) frees the queue → the reader AddRefs freed memory. This is from reading the code, not observed. Two threads (one making, submitting to and releasing 3000 queues, one reading known_queues() like drain_known) didn't crash in 5 runs, but a freed queue doesn't reliably fault.

Suggested fix: take the references while the list is locked. forget_queue's return value then decides which thread does the final release, because a reader's reference either lands before the queue is removed (the title's second f(this) then returns 1 and the reader's drop frees it) or the reader doesn't see the queue at all.

diff --git a/crates/xcl/src/hle/d3d12x/late_release.rs b/crates/xcl/src/hle/d3d12x/late_release.rs
index c3fd9b3..eca1ca9 100644
--- a/crates/xcl/src/hle/d3d12x/late_release.rs
+++ b/crates/xcl/src/hle/d3d12x/late_release.rs
@@ -136,13 +136,7 @@ pub unsafe fn drain_known(seal_now: bool) {
     if HELD.lock().unwrap().as_ref().is_none_or(Held::is_empty) {
         return;
     }
-    let mut queues: Vec<ID3D12CommandQueue> = Vec::new();
-    for raw in super::present::known_queues() {
-        let raw = raw as *mut c_void;
-        if let Some(q) = ID3D12CommandQueue::from_raw_borrowed(&raw) {
-            queues.push(q.clone());
-        }
-    }
+    let mut queues: Vec<ID3D12CommandQueue> = super::present::known_queues_held();
     queues.extend(super::sparse::queue());
     queues.extend(super::title_textures::upload_queues());
     let gone = match HELD.lock().unwrap().as_mut() {
diff --git a/crates/xcl/src/hle/d3d12x/present.rs b/crates/xcl/src/hle/d3d12x/present.rs
index 81bf546..3138566 100644
--- a/crates/xcl/src/hle/d3d12x/present.rs
+++ b/crates/xcl/src/hle/d3d12x/present.rs
@@ -247,6 +247,19 @@ pub fn known_queues() -> Vec<usize> {
     QUEUES.lock().unwrap().clone()
 }
 
+/// The queues the title submitted work to, each with a reference of the caller's, taken while
+/// they are listed: since #1668 a queue the title lets go is released by `q_release`, so a raw
+/// pointer from [`known_queues`] may be freed before it is used.
+pub fn known_queues_held() -> Vec<ID3D12CommandQueue> {
+    let q = QUEUES.lock().unwrap();
+    q.iter()
+        .filter_map(|&raw| {
+            let raw = raw as *mut c_void;
+            unsafe { ID3D12CommandQueue::from_raw_borrowed(&raw) }.cloned()
+        })
+        .collect()
+}
+
 /// `queue` is down to the one reference `note_execute` took to keep it valid for `late_release`:
 /// the title is done with it. Forget it – and any use of it here – so the caller can let that
 /// reference go: otherwise every queue a title ever submitted to (and the driver memory behind
diff --git a/crates/xcl/src/hle/d3d12x/real.rs b/crates/xcl/src/hle/d3d12x/real.rs
index 9e894e6..60227d0 100644
--- a/crates/xcl/src/hle/d3d12x/real.rs
+++ b/crates/xcl/src/hle/d3d12x/real.rs
@@ -5434,7 +5434,6 @@ pub fn drain_gpu() {
         // a fence per queue (they finish in any order)
         let mut fences = Vec::new();
-        for q in super::present::known_queues() {
-            let qr = q as *mut c_void;
-            let Some(q) = ID3D12CommandQueue::from_raw_borrowed(&qr) else { continue };
+        for q in super::present::known_queues_held() {
+            let q = &q;
             let submit = || {
                 let f: ID3D12Fence = dev.CreateFence(0, D3D12_FENCE_FLAG_NONE)

With this on top (and #1523): hle::d3d12x:: 146/0, 3/3 runs, and the two-thread test passes.

A side effect on the new test: it asserts release(raw) == 0. While my reader thread ran in parallel, it got left: 2 once in 5 runs, because the reader held a reference at that moment. In a normal parallel suite, any test that calls note_execute (and so drain_known) can do the same. Checking !known_queues().contains(..) after the release, rather than the exact count, would avoid adding another #1487-style flake.

AI-assisted (Claude Code). No game files; synthetic tests only.

<!-- greyfinch-sync:ivall/xcl:comment:7142604086 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1691#issuecomment-7142604086). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-24T19:47:55Z. --- Tested on an RTX 3070 (driver 616.56, Windows 11) at `1de417c`. - `a_queue_the_title_releases_is_not_kept_alive_by_the_submit_tracking` passes. - `hle::d3d12x::` 146 passed, 0 failed, 3/3 runs. That's with #1523 applied. Without it, the subset crashes 3/3 with `0xC0000005`: that's the fake-fence crash #1523 fixes (it does the same on `main`), not this PR. **One race this PR opens.** Before it, a queue in `QUEUES` was never freed, so `known_queues()` returning raw pointers was safe. Now `q_release` can free a queue right after it leaves the list, and both callers use the pointer after the lock is gone: - `late_release::drain_known` (runs on the late-release thread and on every `note_execute`): snapshot, then `from_raw_borrowed(..).clone()`. - `real::drain_gpu`: snapshot, then `Signal` on the borrowed pointer without a reference of its own. Interleaving: the reader snapshots → the title's last `Release` takes the count to 1 → `forget_queue` → the second `f(this)` frees the queue → the reader AddRefs freed memory. This is from reading the code, not observed. Two threads (one making, submitting to and releasing 3000 queues, one reading `known_queues()` like `drain_known`) didn't crash in 5 runs, but a freed queue doesn't reliably fault. Suggested fix: take the references while the list is locked. `forget_queue`'s return value then decides which thread does the final release, because a reader's reference either lands before the queue is removed (the title's second `f(this)` then returns 1 and the reader's drop frees it) or the reader doesn't see the queue at all. ```diff diff --git a/crates/xcl/src/hle/d3d12x/late_release.rs b/crates/xcl/src/hle/d3d12x/late_release.rs index c3fd9b3..eca1ca9 100644 --- a/crates/xcl/src/hle/d3d12x/late_release.rs +++ b/crates/xcl/src/hle/d3d12x/late_release.rs @@ -136,13 +136,7 @@ pub unsafe fn drain_known(seal_now: bool) { if HELD.lock().unwrap().as_ref().is_none_or(Held::is_empty) { return; } - let mut queues: Vec<ID3D12CommandQueue> = Vec::new(); - for raw in super::present::known_queues() { - let raw = raw as *mut c_void; - if let Some(q) = ID3D12CommandQueue::from_raw_borrowed(&raw) { - queues.push(q.clone()); - } - } + let mut queues: Vec<ID3D12CommandQueue> = super::present::known_queues_held(); queues.extend(super::sparse::queue()); queues.extend(super::title_textures::upload_queues()); let gone = match HELD.lock().unwrap().as_mut() { diff --git a/crates/xcl/src/hle/d3d12x/present.rs b/crates/xcl/src/hle/d3d12x/present.rs index 81bf546..3138566 100644 --- a/crates/xcl/src/hle/d3d12x/present.rs +++ b/crates/xcl/src/hle/d3d12x/present.rs @@ -247,6 +247,19 @@ pub fn known_queues() -> Vec<usize> { QUEUES.lock().unwrap().clone() } +/// The queues the title submitted work to, each with a reference of the caller's, taken while +/// they are listed: since #1668 a queue the title lets go is released by `q_release`, so a raw +/// pointer from [`known_queues`] may be freed before it is used. +pub fn known_queues_held() -> Vec<ID3D12CommandQueue> { + let q = QUEUES.lock().unwrap(); + q.iter() + .filter_map(|&raw| { + let raw = raw as *mut c_void; + unsafe { ID3D12CommandQueue::from_raw_borrowed(&raw) }.cloned() + }) + .collect() +} + /// `queue` is down to the one reference `note_execute` took to keep it valid for `late_release`: /// the title is done with it. Forget it – and any use of it here – so the caller can let that /// reference go: otherwise every queue a title ever submitted to (and the driver memory behind diff --git a/crates/xcl/src/hle/d3d12x/real.rs b/crates/xcl/src/hle/d3d12x/real.rs index 9e894e6..60227d0 100644 --- a/crates/xcl/src/hle/d3d12x/real.rs +++ b/crates/xcl/src/hle/d3d12x/real.rs @@ -5434,7 +5434,6 @@ pub fn drain_gpu() { // a fence per queue (they finish in any order) let mut fences = Vec::new(); - for q in super::present::known_queues() { - let qr = q as *mut c_void; - let Some(q) = ID3D12CommandQueue::from_raw_borrowed(&qr) else { continue }; + for q in super::present::known_queues_held() { + let q = &q; let submit = || { let f: ID3D12Fence = dev.CreateFence(0, D3D12_FENCE_FLAG_NONE) ``` With this on top (and #1523): `hle::d3d12x::` 146/0, 3/3 runs, and the two-thread test passes. A side effect on the new test: it asserts `release(raw) == 0`. While my reader thread ran in parallel, it got `left: 2` once in 5 runs, because the reader held a reference at that moment. In a normal parallel suite, any test that calls `note_execute` (and so `drain_known`) can do the same. Checking `!known_queues().contains(..)` after the release, rather than the exact count, would avoid adding another #1487-style flake. AI-assisted (Claude Code). No game files; synthetic tests only.
DEViANCEVxXXxM commented 2026-11-24 21:30:08 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DEViANCEVxXXxM on 2026-11-24T21:27:29Z.


@upipibi I independently validated your exact suggested patch on top of 1de417c on my RTX 3090.

Synthetic regression and stress tests:

  • Original queue regression: 128/128 PASS.
  • Concurrent stress: 10/10 runs PASS.
  • Single-process endurance: 4096/4096 PASS.
  • GPU copy integrity: 1024/1024 copies, all 1,048,576 values verified.
  • No OOM, timeouts, or reported D3D12 errors in these workloads.

Regarding the refcount assertion:

I added an isolated test that explicitly retains an owned queue snapshot during the title's release. All five runs produced:

TITLE_RELEASE_COUNT=2
LISTED_DURING_READER=true
LISTED_AFTER_READER=false

This confirms your observation about the exact refcount assertion. One additional nuance: checking registry membership immediately after the title's release can also be unreliable while a snapshot remains alive. Checking membership after the temporary owner is dropped passed consistently.

Regarding #1523:

I tested all four combinations of the original PR, your ownership patch, and #1523 (1362129).

All eight serial suite runs passed. Four parallel runs also passed, but a subsequent parallel run with both patches encountered DXGI_ERROR_DEVICE_REMOVED / DXGI_ERROR_DEVICE_HUNG, accompanied by an NVIDIA driver event 153.

I stopped the remaining runs after the device loss. I did not reproduce the fake-fence access violation, and I cannot attribute the device loss to either patch.

Your ownership patch preserves the original queue exhaustion fix in my synthetic workloads. Thanks for the review!

<!-- greyfinch-sync:ivall/xcl:comment:7144955093 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1691#issuecomment-7144955093). Originally posted by [DEViANCEVxXXxM](https://github.com/DEViANCEVxXXxM) on 2026-11-24T21:27:29Z. --- @upipibi I independently validated your exact suggested patch on top of `1de417c` on my RTX 3090. **Synthetic regression and stress tests:** - Original queue regression: 128/128 PASS. - Concurrent stress: 10/10 runs PASS. - Single-process endurance: 4096/4096 PASS. - GPU copy integrity: 1024/1024 copies, all 1,048,576 values verified. - No OOM, timeouts, or reported D3D12 errors in these workloads. **Regarding the refcount assertion:** I added an isolated test that explicitly retains an owned queue snapshot during the title's release. All five runs produced: ```text TITLE_RELEASE_COUNT=2 LISTED_DURING_READER=true LISTED_AFTER_READER=false ``` This confirms your observation about the exact refcount assertion. One additional nuance: checking registry membership immediately after the title's release can also be unreliable while a snapshot remains alive. Checking membership after the temporary owner is dropped passed consistently. **Regarding #1523:** I tested all four combinations of the original PR, your ownership patch, and #1523 (`1362129`). All eight serial suite runs passed. Four parallel runs also passed, but a subsequent parallel run with both patches encountered DXGI_ERROR_DEVICE_REMOVED / DXGI_ERROR_DEVICE_HUNG, accompanied by an NVIDIA driver event 153. I stopped the remaining runs after the device loss. I did not reproduce the fake-fence access violation, and I cannot attribute the device loss to either patch. Your ownership patch preserves the original queue exhaustion fix in my synthetic workloads. Thanks for the review!
upipibi commented 2026-11-24 22:06:46 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-24T21:38:07Z.


Thanks, DEViANCEVxXXxM, for the runs and the membership nuance.

The device loss in the parallel run with both patches matches #1727. There, gpu_sparse_vram_descriptors_buffers_and_xmem re-initialises the backend while other tests use it, and parallel whole-lib runs lose the device (nvlddmkm 153). With #614 on top, 0 of 4 runs hung on an RTX 3070, against 3 of 4 on main (numbers). So the device loss is likely neither patch. If you re-run, adding #614 would check that.

<!-- greyfinch-sync:ivall/xcl:comment:7145189694 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1691#issuecomment-7145189694). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-24T21:38:07Z. --- Thanks, DEViANCEVxXXxM, for the runs and the membership nuance. The device loss in the parallel run with both patches matches #1727. There, `gpu_sparse_vram_descriptors_buffers_and_xmem` re-initialises the backend while other tests use it, and parallel whole-lib runs lose the device (nvlddmkm 153). With #614 on top, 0 of 4 runs hung on an RTX 3070, against 3 of 4 on `main` ([numbers](https://github.com/xcl-dev/xcl/issues/1727#issuecomment-7144654315)). So the device loss is likely neither patch. If you re-run, adding #614 would check that.
DavidM1911 commented 2026-11-24 22:06:57 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T22:02:42Z.


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

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

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7145727211 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1691#issuecomment-7145727211). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T22:02:42Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~23 ignored. Thanks!
DEViANCEVxXXxM commented 2026-11-24 22:06:59 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DEViANCEVxXXxM on 2026-11-24T22:04:32Z.


<html>

@upipibi Thanks for pointing me to #1727 and #614.

I ran additional validation on upstream c4d37be with the combined patches, using my RTX 3090 (driver 621.01) in release mode with the default translator.

D3D12.X subset | Passed | Failed | Ignored -- | -- | -- | -- Serial | 156 | 0 | 2 Parallel (4 threads), run 1 | 156 | 0 | 2 Parallel (4 threads), run 2 | 156 | 0 | 2

Both parallel runs completed with:

  • No device removal or hang.

  • No nvlddmkm event 153.

  • One sparse VRAM initialization per process.

  • The queue lifetime regression test passing.

One limitation: this subset does not include gpu_sparse_vram_descriptors_buffers_and_xmem. These results are consistent with improved stability, but do not independently establish #614 as the cause of the improvement.

Synthetic tests only. AI-assisted test planning and log analysis using ChatGPT (GPT-6.2).

</html>
<!-- greyfinch-sync:ivall/xcl:comment:7145768689 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1691#issuecomment-7145768689). Originally posted by [DEViANCEVxXXxM](https://github.com/DEViANCEVxXXxM) on 2026-11-24T22:04:32Z. --- <html> <body> <!--StartFragment--><p><span>@upipibi Thanks for pointing me to #1727 and #614.</span></p><p><span>I ran additional validation on upstream </span><code><span>c4d37be</span></code><span> with the combined patches, using my RTX 3090 (driver 621.01) in release mode with the default translator.</span></p> D3D12.X subset | Passed | Failed | Ignored -- | -- | -- | -- Serial | 156 | 0 | 2 Parallel (4 threads), run 1 | 156 | 0 | 2 Parallel (4 threads), run 2 | 156 | 0 | 2 <p><span>Both parallel runs completed with:</span></p><ul><li><p><span>No device removal or hang.</span></p></li><li><p><span>No nvlddmkm event 153.</span></p></li><li><p><span>One sparse VRAM initialization per process.</span></p></li><li><p><span>The queue lifetime regression test passing.</span></p></li></ul><p><span>One limitation: this subset does not include </span><code><span>gpu_sparse_vram_descriptors_buffers_and_xmem</span></code><span>. These results are consistent with improved stability, but do not independently establish #614 as the cause of the improvement.</span></p><p><span>Synthetic tests only. AI-assisted test planning and log analysis using ChatGPT (GPT-6.2).</span></p><!--EndFragment--> </body> </html>
b3IKK commented 2026-11-24 23:08:15 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by b3IKK on 2026-11-24T22:20:50Z.


@upipibi you are right, and thanks @DEViANCEVxXXxM for running it. Before this PR nothing in QUEUES was ever freed, so the raw pointers known_queues() handed out were safe by accident; with the handoff in q_release they are not.

Pushed 81f6397 (rebased onto 689f2db), which takes your change as proposed:

  • present::known_queues_held() takes the references while the list is locked; late_release::drain_known and real::drain_gpu use it. known_queues() is left for membership checks only.
  • I went through the interleavings against the n == 1 rule. A reader's reference taken before the title's release: the title's release returns 2, the reader's drop goes through the hooked Release, sees 1, forgets the queue and frees it. A reader that gets in between the title's f(this) and forget_queue: the title's second f(this) returns 1 and the reader's drop frees it. In both the queue is removed from the list exactly once, by whichever release sees the count at the tracking's one reference.
  • The test no longer asserts release(raw) == 0. It waits (up to 5 s) for the queue to leave the list, which also covers the nuance about a snapshot still alive right after the release. A second test, a_tracked_queue_a_reader_holds_outlives_the_titles_release, holds a snapshot across the title's release: the release returns at least 2, the queue stays listed, and it goes when the snapshot is dropped.

Both tests fail with the handoff disabled (0 passed, 2 failed) and pass with it. Full suite on this head: 977 passed, 0 failed, 45 ignored; smoke blocks for 689f2db and 81f6397 are in the description (1643 and 1641 frames, 0 crashes, 0 device removals).

What this does not have is a test that fails on the previous head for the race itself: as you found, a freed queue does not reliably fault. That is stated under Not tested.

The device refcount growing during the endurance run (112 → 161) is not addressed here. I have not looked into it.

AI use: OpenCode, Claude Fable 5.2 made the change, ran the tests and wrote this comment.

<!-- greyfinch-sync:ivall/xcl:comment:7146116310 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1691#issuecomment-7146116310). Originally posted by [b3IKK](https://github.com/b3IKK) on 2026-11-24T22:20:50Z. --- @upipibi you are right, and thanks @DEViANCEVxXXxM for running it. Before this PR nothing in `QUEUES` was ever freed, so the raw pointers `known_queues()` handed out were safe by accident; with the handoff in `q_release` they are not. Pushed `81f6397` (rebased onto `689f2db`), which takes your change as proposed: - `present::known_queues_held()` takes the references while the list is locked; `late_release::drain_known` and `real::drain_gpu` use it. `known_queues()` is left for membership checks only. - I went through the interleavings against the `n == 1` rule. A reader's reference taken before the title's release: the title's release returns 2, the reader's drop goes through the hooked `Release`, sees 1, forgets the queue and frees it. A reader that gets in between the title's `f(this)` and `forget_queue`: the title's second `f(this)` returns 1 and the reader's drop frees it. In both the queue is removed from the list exactly once, by whichever release sees the count at the tracking's one reference. - The test no longer asserts `release(raw) == 0`. It waits (up to 5 s) for the queue to leave the list, which also covers the nuance about a snapshot still alive right after the release. A second test, `a_tracked_queue_a_reader_holds_outlives_the_titles_release`, holds a snapshot across the title's release: the release returns at least 2, the queue stays listed, and it goes when the snapshot is dropped. Both tests fail with the handoff disabled (0 passed, 2 failed) and pass with it. Full suite on this head: 977 passed, 0 failed, 45 ignored; smoke blocks for `689f2db` and `81f6397` are in the description (1643 and 1641 frames, 0 crashes, 0 device removals). What this does not have is a test that fails on the previous head for the race itself: as you found, a freed queue does not reliably fault. That is stated under **Not tested**. The device refcount growing during the endurance run (112 → 161) is not addressed here. I have not looked into it. AI use: OpenCode, Claude Fable 5.2 made the change, ran the tests and wrote this comment.
GustavoEllwanger commented 2026-11-25 01:10:41 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by GustavoEllwanger on 2026-11-25T00:26:11Z.


Tested exact head 81f639749f3528ba2b951d4c704cbcd5a7fe4618 on AMD RDNA3 (RX 7600).

Tested

  • cargo test -p xcl --lib a_queue_the_title_releases_is_not_kept_alive_by_the_submit_tracking -- --nocapture: 1 passed, 0 failed.
  • cargo test -p xcl --lib a_tracked_queue_a_reader_holds_outlives_the_titles_release -- --nocapture: 1 passed, 0 failed.
  • XCL_HEAP_WINDOWS=1 cargo test -p xcl --test gpu_compute_e2e heap_window_out_of_memory_falls_back_to_the_switch_form -- --nocapture: 1 passed, 0 failed (RX 7600).
  • cargo test --workspace --no-fail-fast -- --test-threads=4 --skip fuzz_validate_and_gpu_1: 976 passed, 0 failed, 45 ignored, 1 filtered out, 0 wave64/mesh capability skips.
    • 8 SKIPPED lines reported in the default run (not counted as coverage): 6 per-lane #1426 refusals (f16_programs_on_the_gpu / f32_programs_on_the_gpu), 1 pso_measurement_compiles_an_exact_synthetic_record (Windows Developer Mode not enabled, 0x887A002D), 1 heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows, separately verified above with XCL_HEAP_WINDOWS=1).
  • Unfiltered .\scripts\test.ps1 hit only the pre-existing AMD amdxc64 failure in gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1 (seed 722: res[30] = 0x1, CPU 0x7fffffff, documented in 210f773). With XCL_ADAPTER=warp, fuzz_validate_and_gpu_1 validated all 500/500 modules (500..1000, GPU-compared 0).
  • XCL_SAMPLE_* variables were unset.
  • Machine: Windows 11 Home build 26200; AMD Ryzen 5 5600T; AMD Radeon RX 7600 (8133 MiB VRAM, RDNA3, Adrenalin 26.11.2 / driver 32.0.32029.2010); Rust 1.100.0 MSVC x64; DXC/DXIL 1.8.2502.11 (Windows SDK 10.0.26100.0); debug profile.

Not tested

  • Retail-title smoke or world-load run, release builds, or XCL_SAMPLE_* game-data tests.

AI use
Antigravity (Gemini 4 Neon) ran the commands and drafted this report; only the measured results above are posted.

<!-- greyfinch-sync:ivall/xcl:comment:7148507440 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1691#issuecomment-7148507440). Originally posted by [GustavoEllwanger](https://github.com/GustavoEllwanger) on 2026-11-25T00:26:11Z. --- Tested exact head `81f639749f3528ba2b951d4c704cbcd5a7fe4618` on AMD RDNA3 (RX 7600). **Tested** - `cargo test -p xcl --lib a_queue_the_title_releases_is_not_kept_alive_by_the_submit_tracking -- --nocapture`: 1 passed, 0 failed. - `cargo test -p xcl --lib a_tracked_queue_a_reader_holds_outlives_the_titles_release -- --nocapture`: 1 passed, 0 failed. - `XCL_HEAP_WINDOWS=1 cargo test -p xcl --test gpu_compute_e2e heap_window_out_of_memory_falls_back_to_the_switch_form -- --nocapture`: 1 passed, 0 failed (RX 7600). - `cargo test --workspace --no-fail-fast -- --test-threads=4 --skip fuzz_validate_and_gpu_1`: 976 passed, 0 failed, 45 ignored, 1 filtered out, 0 wave64/mesh capability skips. - 8 `SKIPPED` lines reported in the default run (not counted as coverage): 6 per-lane `#1426` refusals (`f16_programs_on_the_gpu` / `f32_programs_on_the_gpu`), 1 `pso_measurement_compiles_an_exact_synthetic_record` (Windows Developer Mode not enabled, `0x887A002D`), 1 `heap_window_out_of_memory_falls_back_to_the_switch_form` (`no heap windows`, separately verified above with `XCL_HEAP_WINDOWS=1`). - Unfiltered `.\scripts\test.ps1` hit only the pre-existing AMD `amdxc64` failure in `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1` (`seed 722: res[30] = 0x1, CPU 0x7fffffff`, documented in `210f773`). With `XCL_ADAPTER=warp`, `fuzz_validate_and_gpu_1` validated all 500/500 modules (`500..1000`, `GPU-compared 0`). - `XCL_SAMPLE_*` variables were unset. - Machine: Windows 11 Home build 26200; AMD Ryzen 5 5600T; AMD Radeon RX 7600 (8133 MiB VRAM, RDNA3, Adrenalin 26.11.2 / driver 32.0.32029.2010); Rust 1.100.0 MSVC x64; DXC/DXIL 1.8.2502.11 (Windows SDK 10.0.26100.0); debug profile. **Not tested** - Retail-title smoke or world-load run, release builds, or `XCL_SAMPLE_*` game-data tests. **AI use** Antigravity (Gemini 4 Neon) ran the commands and drafted this report; only the measured results above are posted.
luckyteagirl commented 2026-11-25 04:10:16 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-25T03:09:36Z.


Tested

  • Exact PR head 81f639749f3528ba2b951d4c704cbcd5a7fe4618 on Windows 11 build 26200, Ryzen 9 5980HX, AMD Radeon RX 6800M driver 30.0.13002.13003 plus an AMD integrated GPU, Rust 1.99.0 MSVC, DXC/DXIL 1.9.2609.5. XCL_ADAPTER=6800M, XCL_REQUIRE_GPU=1, and XCL_DIRECT_DXIL=0 were set for the test commands.
  • a_queue_the_title_releases_is_not_kept_alive_by_the_submit_tracking and a_tracked_queue_a_reader_holds_outlives_the_titles_release each passed as a focused, single-threaded test: 1 passed, 0 failed, 0 ignored per run, with no explicit skip. These tests call D3D12CreateDevice(None) at feature level 12.0 and have no WARP fallback, so they exercised an AMD hardware adapter on this machine. They do not use XCL_ADAPTER to select that device, and I did not capture its LUID to distinguish the RX 6800M from the integrated AMD GPU.
  • cargo test --locked -p xcl --lib -j 2 hle::d3d12x:: -- --test-threads=1 --show-output: 157 passed, 0 failed, 2 ignored. One explicit SKIPPED line reported that the adapter makes no reserved cube with mips. Both queue regressions passed in this broader run too.
  • cargo build --locked --workspace -j 2: passed.

Not tested

  • The original 128-queue submit/synchronize/release endurance reproduction from #1668, the full workspace suite, a retail-title smoke pair, the exact LUID of the tests' default D3D12 adapter, or other drivers and GPUs. The focused tests check tracking and reference ownership for one submitted queue each.

AI use

OpenAI Codex (GPT-6, exact variant not exposed in this session) inspected the test and queue-lifetime paths, ran the AMD-machine tests and build, reviewed the logs, and drafted this report.

<!-- greyfinch-sync:ivall/xcl:comment:7151647689 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1691#issuecomment-7151647689). Originally posted by [luckyteagirl](https://github.com/luckyteagirl) on 2026-11-25T03:09:36Z. --- **Tested** - Exact PR head `81f639749f3528ba2b951d4c704cbcd5a7fe4618` on Windows 11 build 26200, Ryzen 9 5980HX, AMD Radeon RX 6800M driver `30.0.13002.13003` plus an AMD integrated GPU, Rust 1.99.0 MSVC, DXC/DXIL 1.9.2609.5. `XCL_ADAPTER=6800M`, `XCL_REQUIRE_GPU=1`, and `XCL_DIRECT_DXIL=0` were set for the test commands. - `a_queue_the_title_releases_is_not_kept_alive_by_the_submit_tracking` and `a_tracked_queue_a_reader_holds_outlives_the_titles_release` each passed as a focused, single-threaded test: **1 passed, 0 failed, 0 ignored** per run, with no explicit skip. These tests call `D3D12CreateDevice(None)` at feature level 12.0 and have no WARP fallback, so they exercised an AMD hardware adapter on this machine. They do not use `XCL_ADAPTER` to select that device, and I did not capture its LUID to distinguish the RX 6800M from the integrated AMD GPU. - `cargo test --locked -p xcl --lib -j 2 hle::d3d12x:: -- --test-threads=1 --show-output`: **157 passed, 0 failed, 2 ignored**. One explicit `SKIPPED` line reported that the adapter makes no reserved cube with mips. Both queue regressions passed in this broader run too. - `cargo build --locked --workspace -j 2`: passed. **Not tested** - The original 128-queue submit/synchronize/release endurance reproduction from #1668, the full workspace suite, a retail-title smoke pair, the exact LUID of the tests' default D3D12 adapter, or other drivers and GPUs. The focused tests check tracking and reference ownership for one submitted queue each. **AI use** OpenAI Codex (GPT-6, exact variant not exposed in this session) inspected the test and queue-lifetime paths, ran the AMD-machine tests and build, reviewed the logs, and drafted this report.
JJAutoCompare commented 2026-11-25 05:08:21 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T04:33:24Z.


XCL PR #1691 verification

Tested clean detached head 81f639749f3528ba2b951d4c704cbcd5a7fe4618 on STOR-WINLAB. Windows 11 x64 build 10.0.26200.9974, Ryzen 7 3800X, Intel Arc A770 driver 32.0.101.9175, DXC 1.9.2609.5, rustc 1.100.0 (0ef1bc386, x86_64-pc-windows-msvc). Used unoptimized Cargo profiles with debug info and incremental compilation disabled. The diff touches late_release.rs, present.rs, and real.rs under hle/d3d12x.

Tested

  • cargo build --workspace and cargo test --workspace --no-run exited 0 outside the Arc mutex. The latter built 19 test binaries.
  • cargo test -p xcl --lib console_format_query_tests::a_ -- --nocapture --test-threads=1 under Invoke-ArcTest.ps1 with XCL_ADAPTER=A770 returned 2 passed, 0 failed, 0 ignored, and 0 explicit skips. A probe under the same lock confirmed the default D3D12 feature-level 12.0 device was the A770. The tests created real command queues and called submit tracking directly. They verified that title release removes a tracked queue and that a reader's reference keeps it tracked until the reader releases it.
  • cargo test --workspace --no-fail-fast -- --test-threads=4 ran once under the same mutex with XCL_ADAPTER=A770 and RUST_TEST_NOCAPTURE=1. Exit 101. Summing 20 result lines (19 binaries and one doctest harness) gave 952 passed, 25 failed, and 45 ignored. Both queue tests also passed here.

Workspace failures and skips

The library had 24 GPU failures. Twenty reported CreateComputePipelineState error 0x80070057. Four failed assertions on FMA, mip sampling, packed f16, or wave64 reduction. The title E2E test failed its dynamic depth bias pixel check. The log had 25 explicit SKIPPED lines, excluded from coverage. Seventeen cited no wave64, three cited refused per-lane lowering, and five cited tiled tier, driver-cache control, missing debug layers, or heap windows.

Not tested

Matched main run, retail title smoke comparison, issue #1668's 128-queue loop, and AMD/NVIDIA GPUs. No XCL_SAMPLE_* variables were set.

AI use

T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr1691-suite.log and published.

<!-- greyfinch-sync:ivall/xcl:comment:7152950801 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1691#issuecomment-7152950801). Originally posted by [JJAutoCompare](https://github.com/JJAutoCompare) on 2026-11-25T04:33:24Z. --- # XCL PR #1691 verification Tested clean detached head `81f639749f3528ba2b951d4c704cbcd5a7fe4618` on STOR-WINLAB. Windows 11 x64 build 10.0.26200.9974, Ryzen 7 3800X, Intel Arc A770 driver 32.0.101.9175, DXC 1.9.2609.5, rustc 1.100.0 (0ef1bc386, x86_64-pc-windows-msvc). Used unoptimized Cargo profiles with debug info and incremental compilation disabled. The diff touches `late_release.rs`, `present.rs`, and `real.rs` under `hle/d3d12x`. **Tested** - `cargo build --workspace` and `cargo test --workspace --no-run` exited 0 outside the Arc mutex. The latter built 19 test binaries. - `cargo test -p xcl --lib console_format_query_tests::a_ -- --nocapture --test-threads=1` under `Invoke-ArcTest.ps1` with `XCL_ADAPTER=A770` returned 2 passed, 0 failed, 0 ignored, and 0 explicit skips. A probe under the same lock confirmed the default D3D12 feature-level 12.0 device was the A770. The tests created real command queues and called submit tracking directly. They verified that title release removes a tracked queue and that a reader's reference keeps it tracked until the reader releases it. - `cargo test --workspace --no-fail-fast -- --test-threads=4` ran once under the same mutex with `XCL_ADAPTER=A770` and `RUST_TEST_NOCAPTURE=1`. Exit 101. Summing 20 result lines (19 binaries and one doctest harness) gave 952 passed, 25 failed, and 45 ignored. Both queue tests also passed here. **Workspace failures and skips** The library had 24 GPU failures. Twenty reported `CreateComputePipelineState` error `0x80070057`. Four failed assertions on FMA, mip sampling, packed f16, or wave64 reduction. The title E2E test failed its dynamic depth bias pixel check. The log had 25 explicit `SKIPPED ` lines, excluded from coverage. Seventeen cited no wave64, three cited refused per-lane lowering, and five cited tiled tier, driver-cache control, missing debug layers, or heap windows. **Not tested** Matched main run, retail title smoke comparison, issue #1668's 128-queue loop, and AMD/NVIDIA GPUs. No `XCL_SAMPLE_*` variables were set. **AI use** T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against `pr1691-suite.log` and published.
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:03Z.


Independent validation update for #1691 and its interaction with #1945.

Tested revisions:

  • Main: cbc296ab
  • #1691: 81f6397
  • #1945: f581057
  • Locally combined tree: 81f0dbb

Both PRs merge individually with the tested main revision, but combining them requires resolving a conflict in real.rs::q_release.

The resolution preserves #1691's submit-tracking reference removal and calls both list_x::on_queue_release and alloc_pool::forget_queue after the final reference count reaches zero.

Combined validation results:

  • D3D12.X regression suite: 181 passed, 0 failed, 2 expected timing tests ignored.
  • Both queue ownership tests passed individually.
  • 30 focused serial/parallel stress runs: 210/210 test executions passed.
  • 96 additional same-queue completed-fence lifecycle cycles passed, including 48 with an outstanding reader reference.
  • Another 96 simulated pending-fence lifecycle cycles passed.

The four production configurations (main, #1691, #1945, combined) also completed 120-second idle retail-title runs at 30 FPS and exited cleanly.

The existing retail-title crash remains reproducible in all four configurations with an identical exception signature. This does not appear to be a new regression introduced by #1691.

The combined lifecycle results are encouraging, although they do not establish the absence of all concurrent lifetime races.

No changes were made to upstream main.

AI assistance: ChatGPT (GPT-6.2) assisted with source review, test implementation and analysis. All reported test executions were performed on actual Windows hardware (RTX 3090).

<!-- greyfinch-sync:ivall/xcl:comment:7152992163 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1691#issuecomment-7152992163). Originally posted by [DEViANCEVxXXxM](https://github.com/DEViANCEVxXXxM) on 2026-11-25T04:36:03Z. --- Independent validation update for #1691 and its interaction with #1945. **Tested revisions:** - Main: `cbc296ab` - #1691: `81f6397` - #1945: `f581057` - Locally combined tree: `81f0dbb` Both PRs merge individually with the tested main revision, but combining them requires resolving a conflict in `real.rs::q_release`. The resolution preserves #1691's submit-tracking reference removal and calls both `list_x::on_queue_release` and `alloc_pool::forget_queue` after the final reference count reaches zero. **Combined validation results:** - D3D12.X regression suite: 181 passed, 0 failed, 2 expected timing tests ignored. - Both queue ownership tests passed individually. - 30 focused serial/parallel stress runs: 210/210 test executions passed. - 96 additional same-queue completed-fence lifecycle cycles passed, including 48 with an outstanding reader reference. - Another 96 simulated pending-fence lifecycle cycles passed. The four production configurations (main, #1691, #1945, combined) also completed 120-second idle retail-title runs at 30 FPS and exited cleanly. The existing retail-title crash remains reproducible in all four configurations with an identical exception signature. This does not appear to be a new regression introduced by #1691. The combined lifecycle results are encouraging, although they do not establish the absence of all concurrent lifetime races. No changes were made to upstream main. AI assistance: ChatGPT (GPT-6.2) assisted with source review, test implementation and analysis. All reported test executions were performed on actual Windows hardware (RTX 3090).
PracticalStudios commented 2026-11-25 06:05:49 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by PracticalStudios on 2026-11-25T05:24:32Z.


Test report for 81f6397 on Ampere: the two new queue tests pass, but the parallel hle::d3d12x:: subset loses the GPU device with this PR and not on main.

  • RTX 3090 24 GB (driver 621.24), Ryzen 7 9800X3D, Windows 11 26200, Rust 1.89.0, debug; no title running, GPU otherwise ≤ 20 % busy before each run.
  • a_queue_the_title_releases_is_not_kept_alive_by_the_submit_tracking and a_tracked_queue_a_reader_holds_outlives_the_titles_release (--test-threads=1): 1 passed each, 3 of 3 runs, on the PR's base and merged onto main cbc296a.
  • cargo test -p xcl --lib hle::d3d12x:: -- --test-threads=2, runs alternating with main cbc296a:
    • this PR merged onto cbc296a (clean merge): failed 3 of 3 (1–3 failures each) with 0x887A0005 / 0x887A0006 (device suspended / removed) or 0x8007000E, in different tests each run (list_x mid_list_write64_wait64_split…, cross_queue_wait64_before_signal…, cpu_writes readback_u64…, bind execute_indirect_reads…); the same on the PR's own base (3 of 3);
    • main cbc296a alone: passed 3 of 3 (177 passed).
    • The failing tests pass when run alone. I haven't found the cause; only 3 runs per side.
  • cargo test --workspace --no-fail-fast: 927 passed, 1 failed (xmem_virtual_query_marks_cpu_readable_memory, fails on main too, #650).
  • Not tested: the retail title with this PR; a smoke pair.

AI use: Claude Code (Claude Opus 5.5, with a Claude Sonnet subagent, exact version unknown) ran the tests and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7153740974 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1691#issuecomment-7153740974). Originally posted by [PracticalStudios](https://github.com/PracticalStudios) on 2026-11-25T05:24:32Z. --- Test report for `81f6397` on Ampere: the two new queue tests pass, but the parallel `hle::d3d12x::` subset loses the GPU device with this PR and not on `main`. - RTX 3090 24 GB (driver 621.24), Ryzen 7 9800X3D, Windows 11 26200, Rust 1.89.0, debug; no title running, GPU otherwise ≤ 20 % busy before each run. - `a_queue_the_title_releases_is_not_kept_alive_by_the_submit_tracking` and `a_tracked_queue_a_reader_holds_outlives_the_titles_release` (`--test-threads=1`): 1 passed each, 3 of 3 runs, on the PR's base and merged onto `main` `cbc296a`. - `cargo test -p xcl --lib hle::d3d12x:: -- --test-threads=2`, runs alternating with `main` `cbc296a`: - this PR merged onto `cbc296a` (clean merge): failed 3 of 3 (1–3 failures each) with `0x887A0005` / `0x887A0006` (device suspended / removed) or `0x8007000E`, in different tests each run (`list_x` `mid_list_write64_wait64_split…`, `cross_queue_wait64_before_signal…`, `cpu_writes` `readback_u64…`, `bind` `execute_indirect_reads…`); the same on the PR's own base (3 of 3); - `main` `cbc296a` alone: passed 3 of 3 (177 passed). - The failing tests pass when run alone. I haven't found the cause; only 3 runs per side. - `cargo test --workspace --no-fail-fast`: 927 passed, 1 failed (`xmem_virtual_query_marks_cpu_readable_memory`, fails on `main` too, #650). - Not tested: the retail title with this PR; a smoke pair. AI use: Claude Code (Claude Opus 5.5, with a Claude Sonnet subagent, exact version unknown) ran the tests and wrote this report.
upipibi commented 2026-11-25 07:05:31 +00:00 (Migrated from github.com)

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


Update: this compared the PR at its old base with a newer main. A run that controls for the base is here: https://github.com/xcl-dev/xcl/pull/1691#issuecomment-7156141009 (merged onto current main: 1 of 6 runs lost the device, main 0 of 6).

An Ampere data point for the device loss PracticalStudios reported with parallel hle::d3d12x tests. RTX 3070 (driver 616.56), Windows 11, debug, same command (cargo test -p xcl --lib hle::d3d12x:: -- --test-threads=2). I alternated this PR at 81f6397 with main at 6ea813a, 3 runs each, every run holding the GPU alone:

run this PR main
1 156 passed, 1 failed: mid_list_write64_wait64_split_avoids_cycle_and_reuses_spares (E_OUTOFMEMORY at list_x.rs:6069) 177 passed, 0 failed
2 155 passed, 2 failed: rotating_queue_self_deadlock_and_non_monotonic_rescue_do_not_hang (list_x.rs:5895) and timestamps_outside_unified_memory_land_after_the_queue (list_x.rs:5301), both 0x887A0005 (device instance suspended) 177 passed, 0 failed
3 157 passed, 0 failed 177 passed, 0 failed

So the failure isn't specific to the 3090: with two test threads, this PR loses the device or runs out of memory in 2 of 3 runs here, and main doesn't. The test counts differ because the PR's base is older than main. I haven't narrowed down which change causes it.

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

<!-- greyfinch-sync:ivall/xcl:comment:7154762068 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1691#issuecomment-7154762068). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-25T06:24:41Z. --- _Update: this compared the PR at its old base with a newer `main`. A run that controls for the base is here: https://github.com/xcl-dev/xcl/pull/1691#issuecomment-7156141009 (merged onto current `main`: 1 of 6 runs lost the device, `main` 0 of 6)._ An Ampere data point for the device loss PracticalStudios reported with parallel `hle::d3d12x` tests. RTX 3070 (driver 616.56), Windows 11, debug, same command (`cargo test -p xcl --lib hle::d3d12x:: -- --test-threads=2`). I alternated this PR at `81f6397` with `main` at `6ea813a`, 3 runs each, every run holding the GPU alone: | run | this PR | `main` | |---|---|---| | 1 | 156 passed, **1 failed**: `mid_list_write64_wait64_split_avoids_cycle_and_reuses_spares` (`E_OUTOFMEMORY` at list_x.rs:6069) | 177 passed, 0 failed | | 2 | 155 passed, **2 failed**: `rotating_queue_self_deadlock_and_non_monotonic_rescue_do_not_hang` (list_x.rs:5895) and `timestamps_outside_unified_memory_land_after_the_queue` (list_x.rs:5301), both `0x887A0005` (device instance suspended) | 177 passed, 0 failed | | 3 | 157 passed, 0 failed | 177 passed, 0 failed | So the failure isn't specific to the 3090: with two test threads, this PR loses the device or runs out of memory in 2 of 3 runs here, and `main` doesn't. The test counts differ because the PR's base is older than `main`. I haven't narrowed down which change causes it. AI-assisted (Claude Code). Synthetic tests only.
upipibi commented 2026-11-25 08:08:17 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-25T07:41:21Z.


Follow-up to my run above. That one compared this PR at its old base with a newer main, so it didn't control for the base. This run is on the same RTX 3070 (driver 616.56, Windows 11, debug) with the same command (cargo test -p xcl --lib hle::d3d12x:: -- --test-threads=2). It alternates four trees, every run holding the GPU alone:

tree runs failing failures
689f2db (this PR's base) 3 0 –
81f6397 (this PR) 3 2 rotating_queue_self_deadlock_and_non_monotonic_rescue_do_not_hang + timestamps_outside_unified_memory_land_after_the_queue (device removed); mid_list_write64_wait64_split_avoids_cycle_and_reuses_spares (E_OUTOFMEMORY)
main 568e7db 6 0 –
this PR merged onto 568e7db 6 1 mid_list_write64_wait64_split_avoids_cycle_and_reuses_spares: 0x887A0005 (device instance suspended) at list_x.rs:6169

So the failure isn't only an artefact of the old base: with this PR merged onto current main, the same test lost the device in 1 of 6 runs, against 0 of 6 on main alone. It's less frequent than on the PR's own base (2 of 3). Six runs per tree is too few to rule out a rarer failure on main. A bisect inside the PR, or more runs of only the three named tests, would narrow it down. I haven't done either.

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

Caveat (added later): the same test hangs without this PR. With tiagonleal's filter on #2057 (cargo test --release -p xcl --lib -- d3d12x::list_x d3d12x::fence_x d3d12x::sparse hle::acphal gpu::fence, default threads), mid_list_write64_wait64_split_avoids_cycle_and_reuses_spares was among the tests still running after 60 s in 2 of 3 runs on both f7e08e6 and 41303e4. #2057 doesn't contain #1691. main 568e7db was clean in 3 of 3 runs with that filter (details). So this test is sensitive to other changes and to load too, and the 1-of-6 merged failure above doesn't by itself pin the problem on this PR.

<!-- greyfinch-sync:ivall/xcl:comment:7156141009 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1691#issuecomment-7156141009). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-25T07:41:21Z. --- Follow-up to my run above. That one compared this PR at its old base with a newer `main`, so it didn't control for the base. This run is on the same RTX 3070 (driver 616.56, Windows 11, debug) with the same command (`cargo test -p xcl --lib hle::d3d12x:: -- --test-threads=2`). It alternates four trees, every run holding the GPU alone: | tree | runs | failing | failures | |---|---|---|---| | `689f2db` (this PR's base) | 3 | 0 | – | | `81f6397` (this PR) | 3 | 2 | `rotating_queue_self_deadlock_and_non_monotonic_rescue_do_not_hang` + `timestamps_outside_unified_memory_land_after_the_queue` (device removed); `mid_list_write64_wait64_split_avoids_cycle_and_reuses_spares` (`E_OUTOFMEMORY`) | | `main` `568e7db` | 6 | 0 | – | | this PR merged onto `568e7db` | 6 | 1 | `mid_list_write64_wait64_split_avoids_cycle_and_reuses_spares`: `0x887A0005` (device instance suspended) at list_x.rs:6169 | So the failure isn't only an artefact of the old base: with this PR merged onto current `main`, the same test lost the device in 1 of 6 runs, against 0 of 6 on `main` alone. It's less frequent than on the PR's own base (2 of 3). Six runs per tree is too few to rule out a rarer failure on `main`. A bisect inside the PR, or more runs of only the three named tests, would narrow it down. I haven't done either. AI-assisted (Claude Code). Synthetic tests only. **Caveat (added later):** the same test hangs without this PR. With tiagonleal's filter on #2057 (`cargo test --release -p xcl --lib -- d3d12x::list_x d3d12x::fence_x d3d12x::sparse hle::acphal gpu::fence`, default threads), `mid_list_write64_wait64_split_avoids_cycle_and_reuses_spares` was among the tests still running after 60 s in 2 of 3 runs on both `f7e08e6` and `41303e4`. #2057 doesn't contain #1691. `main` `568e7db` was clean in 3 of 3 runs with that filter ([details](https://github.com/xcl-dev/xcl/pull/2057#issuecomment-7156765026)). So this test is sensitive to other changes and to load too, and the 1-of-6 merged failure above doesn't by itself pin the problem on this PR.
b3IKK commented 2026-11-25 11:09:19 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by b3IKK on 2026-11-25T10:44:42Z.


@upipibi thank you for the controlled rerun — that is what made the device loss visible as this PR's and not the base's.

You are right that the queue has to outlive what was submitted to it, and that is a real hole in what I had: the reference went the moment the title's last release arrived, so a queue with work in flight could be freed under the GPU. Pushed 1759519 (rebased onto 568e7db):

  • q_release no longer drops the tracking reference itself. It hands it to late_release::hold_queue, which signals a value on that queue's own fence and lets the reference go once every earlier submission has passed it — the same mechanism that already holds a resource's last release. list_x::on_queue_release now runs when that last reference actually goes, not before.
  • New test a_released_queue_is_held_until_its_submitted_work_is_done: the queue is made to wait on a fence nobody has signalled, the title releases it, and the test checks that the reference is held (the queue is still alive and usable) until the fence is signalled. With the deferral taken out it fails at that check.
  • Locally, on an RTX 5080: the three tests you named with --test-threads=2, 5 runs, 3 passed / 0 failed each; the whole hle::d3d12x:: subset with two threads, 2 runs, 180 passed / 0 failed. So I have not reproduced your 0x887A0005 here; what I can show is that the queue is now held while its work is in flight.

Suite on this head: 1157 passed, 0 failed, 46 ignored. Smoke blocks for 568e7db and 1759519 are in the description.

If you still have the 3070, a rerun of the same six-run alternation against this head would be the check that matters — I am not claiming it fixes your 1-in-6 without it.

AI use: OpenCode, Claude Fable 5.2 made the change, ran the tests and wrote this comment.

<!-- greyfinch-sync:ivall/xcl:comment:7160113773 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1691#issuecomment-7160113773). Originally posted by [b3IKK](https://github.com/b3IKK) on 2026-11-25T10:44:42Z. --- @upipibi thank you for the controlled rerun — that is what made the device loss visible as this PR's and not the base's. You are right that the queue has to outlive what was submitted to it, and that is a real hole in what I had: the reference went the moment the title's last release arrived, so a queue with work in flight could be freed under the GPU. Pushed `1759519` (rebased onto `568e7db`): - `q_release` no longer drops the tracking reference itself. It hands it to `late_release::hold_queue`, which signals a value on that queue's own fence and lets the reference go once every earlier submission has passed it — the same mechanism that already holds a resource's last release. `list_x::on_queue_release` now runs when that last reference actually goes, not before. - New test `a_released_queue_is_held_until_its_submitted_work_is_done`: the queue is made to wait on a fence nobody has signalled, the title releases it, and the test checks that the reference is held (the queue is still alive and usable) until the fence is signalled. With the deferral taken out it fails at that check. - Locally, on an RTX 5080: the three tests you named with `--test-threads=2`, 5 runs, 3 passed / 0 failed each; the whole `hle::d3d12x::` subset with two threads, 2 runs, 180 passed / 0 failed. So I have not reproduced your `0x887A0005` here; what I can show is that the queue is now held while its work is in flight. Suite on this head: 1157 passed, 0 failed, 46 ignored. Smoke blocks for `568e7db` and `1759519` are in the description. If you still have the 3070, a rerun of the same six-run alternation against this head would be the check that matters — I am not claiming it fixes your 1-in-6 without it. AI use: OpenCode, Claude Fable 5.2 made the change, ran the tests and wrote this comment.
b3IKK commented 2026-11-25 12:06:21 +00:00 (Migrated from github.com)

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


Rebased onto 426a5a7 (which has #2245, so main's two failing tests are gone) and tidied one thing I had left: the late-release thread had a static Once in both hold and hold_queue, so a title that both released a queue and held a resource could start two of them. One ensure_thread now serves both.

Head f71cf21: 1246 passed, 0 failed, 46 ignored. Smoke blocks for 426a5a7 and this head are in the description (1642 / 1645 frames, both 60 60 60, 0 crashes, 0 device removals). AI use: OpenCode, Claude Fable 5.2.

<!-- greyfinch-sync:ivall/xcl:comment:7161043574 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1691#issuecomment-7161043574). Originally posted by [b3IKK](https://github.com/b3IKK) on 2026-11-25T11:26:10Z. --- Rebased onto `426a5a7` (which has #2245, so `main`'s two failing tests are gone) and tidied one thing I had left: the late-release thread had a `static Once` in both `hold` and `hold_queue`, so a title that both released a queue and held a resource could start two of them. One `ensure_thread` now serves both. Head `f71cf21`: **1246 passed, 0 failed, 46 ignored**. Smoke blocks for `426a5a7` and this head are in the description (1642 / 1645 frames, both 60 60 60, 0 crashes, 0 device removals). AI use: OpenCode, Claude Fable 5.2.
IgorAntunes66 commented 2026-11-25 19:09:00 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by IgorAntunes66 on 2026-11-25T18:17:57Z.


Test report on an RTX 5070 (Blackwell, wave32), plus one flaky test in the PR.

RTX 5070 12 GB, driver 621.24, Windows 11 26H2, rustc 1.100.0, DXC 1.9.2602.17, debug. Head f71cf21 merged onto main 68a284a (clean merge).

#1668 reproduction: a local loop test (not in the PR) that does what the issue describes through the hooked path: CreateCommandQueue, Signal + wait, adopt(.., Kind::CommandQueue), note_execute, then the hooked Release, 128 times:

queues created and released first error still in known_queues()
main 68a284a 64 E_OUTOFMEMORY at the 65th 64
+ this PR 128 none 0

Same result in 2 runs each.

Whole lib (cargo test -p xcl --lib): 1218 passed, 5 failed, 26 ignored with --test-threads=1 and with =4, no TDR or device removal in the System log. The 5 failures are the same on main 68a284a without this PR (gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3: CreateComputePipelineState 0x8007000E at seed 70; a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier), so not from this PR.

Flaky test: a_released_queue_is_held_until_its_submitted_work_is_done passes alone (3/3), but when the three new tests run together (cargo test -p xcl --lib -- a_queue_the_title_releases_is_not_kept_alive_by_the_submit_tracking a_tracked_queue_a_reader_holds_outlives_the_titles_release a_released_queue_is_held_until_its_submitted_work_is_done) it fails 6 of 8 runs at real.rs:8007, "the GPU may still run what was submitted to the queue: its reference is held". Paired runs: with a_tracked_queue_a_reader_holds_outlives_the_titles_release it fails 4/5; with a_queue_the_title_releases_is_not_kept_alive_by_the_submit_tracking 0/5.

Reading the code, that fits: the reader test's known_queues_held() takes a reference to every tracked queue, this test's included, so the title's release leaves 2 and q_release does not reach hold_queue until the reader drops its reference. Waiting up to 5 s for the queue to show up in held_queues(), as untracked_soon does in the other test, fixes it here: 0 of 10 runs failed with

let end = std::time::Instant::now() + std::time::Duration::from_secs(5);
while !crate::hle::d3d12x::late_release::held_queues().contains(&(raw as usize)) {
    assert!(std::time::Instant::now() < end, "the GPU may still run what was submitted to the queue: its reference is held");
    std::thread::sleep(std::time::Duration::from_millis(5));
}

in place of the immediate assert!(.. held_queues().contains(..)).

Not tested: AMD/Intel, release build, a retail title.

AI use: Claude Code (claude-opus-5-5) ran the tests, wrote the local repro and the polling change, and drafted this comment; I reviewed it.

<!-- greyfinch-sync:ivall/xcl:comment:7170717106 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1691#issuecomment-7170717106). Originally posted by [IgorAntunes66](https://github.com/IgorAntunes66) on 2026-11-25T18:17:57Z. --- Test report on an RTX 5070 (Blackwell, wave32), plus one flaky test in the PR. RTX 5070 12 GB, driver 621.24, Windows 11 26H2, rustc 1.100.0, DXC 1.9.2602.17, debug. Head f71cf21 merged onto main 68a284a (clean merge). **#1668 reproduction:** a local loop test (not in the PR) that does what the issue describes through the hooked path: `CreateCommandQueue`, `Signal` + wait, `adopt(.., Kind::CommandQueue)`, `note_execute`, then the hooked `Release`, 128 times: | | queues created and released | first error | still in `known_queues()` | |---|---|---|---| | main 68a284a | 64 | `E_OUTOFMEMORY` at the 65th | 64 | | + this PR | 128 | none | 0 | Same result in 2 runs each. **Whole lib** (`cargo test -p xcl --lib`): 1218 passed, 5 failed, 26 ignored with `--test-threads=1` and with `=4`, no TDR or device removal in the System log. The 5 failures are the same on main 68a284a without this PR (`gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3`: `CreateComputePipelineState` 0x8007000E at seed 70; `a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier`), so not from this PR. **Flaky test:** `a_released_queue_is_held_until_its_submitted_work_is_done` passes alone (3/3), but when the three new tests run together (`cargo test -p xcl --lib -- a_queue_the_title_releases_is_not_kept_alive_by_the_submit_tracking a_tracked_queue_a_reader_holds_outlives_the_titles_release a_released_queue_is_held_until_its_submitted_work_is_done`) it fails 6 of 8 runs at real.rs:8007, "the GPU may still run what was submitted to the queue: its reference is held". Paired runs: with `a_tracked_queue_a_reader_holds_outlives_the_titles_release` it fails 4/5; with `a_queue_the_title_releases_is_not_kept_alive_by_the_submit_tracking` 0/5. Reading the code, that fits: the reader test's `known_queues_held()` takes a reference to every tracked queue, this test's included, so the title's release leaves 2 and `q_release` does not reach `hold_queue` until the reader drops its reference. Waiting up to 5 s for the queue to show up in `held_queues()`, as `untracked_soon` does in the other test, fixes it here: 0 of 10 runs failed with ```rust let end = std::time::Instant::now() + std::time::Duration::from_secs(5); while !crate::hle::d3d12x::late_release::held_queues().contains(&(raw as usize)) { assert!(std::time::Instant::now() < end, "the GPU may still run what was submitted to the queue: its reference is held"); std::thread::sleep(std::time::Duration::from_millis(5)); } ``` in place of the immediate `assert!(.. held_queues().contains(..))`. Not tested: AMD/Intel, release build, a retail title. AI use: Claude Code (claude-opus-5-5) ran the tests, wrote the local repro and the polling change, and drafted this comment; I reviewed it.
Lum7nt commented 2026-11-25 19:09:12 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Lum7nt on 2026-11-25T18:43:27Z.


Tested on \ 71cf2147ecd3b4aa67b71c53ebcd8cfec326c2b\ (\ 71cf21, clean PR head):

  • Hardware / OS / Toolchain: NVIDIA GeForce RTX 3060 12 GB (driver \32.0.15.8142\ / 581.42, wave32), Intel Core i5-10400, Windows 11 (NT \10.0.22631.0),
    ustc 1.100.0\ (\x86_64-pc-windows-msvc), DXC \1.8.2502.11\ (Windows SDK \10.0.26100.0), debug profile, \XCL_ADAPTER=nvidia.
  • Focused #1668 tests (-- --nocapture):
    • \_queue_the_title_releases_is_not_kept_alive_by_the_submit_tracking: 1 passed, 0 failed
    • \_tracked_queue_a_reader_holds_outlives_the_titles_release: 1 passed, 0 failed
    • \_released_queue_is_held_until_its_submitted_work_is_done: 1 passed, 0 failed
  • Workspace suite (\cargo build --workspace\ then \cargo test --workspace --no-fail-fast -- --test-threads=4): 1244 passed, 2 failed, 46 ignored (1176 lib + 68 integration).
    • Both failures are pre-existing \ID3D12PipelineState::GetCachedBlob()\ failures on this driver/setup (also seen identically on \origin/main\ \
<!-- greyfinch-sync:ivall/xcl:comment:7171306195 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1691#issuecomment-7171306195). Originally posted by [Lum7nt](https://github.com/Lum7nt) on 2026-11-25T18:43:27Z. --- **Tested** on \ 71cf2147ecd3b4aa67b71c53ebcd8cfec326c2b\ (\ 71cf21\, clean PR head): - **Hardware / OS / Toolchain:** NVIDIA GeForce RTX 3060 12 GB (driver \32.0.15.8142\ / 581.42, wave32), Intel Core i5-10400, Windows 11 (NT \10.0.22631.0\), \ ustc 1.100.0\ (\x86_64-pc-windows-msvc\), DXC \1.8.2502.11\ (Windows SDK \10.0.26100.0\), debug profile, \XCL_ADAPTER=nvidia\. - **Focused #1668 tests (\-- --nocapture\):** - \_queue_the_title_releases_is_not_kept_alive_by_the_submit_tracking\: **1 passed, 0 failed** - \_tracked_queue_a_reader_holds_outlives_the_titles_release\: **1 passed, 0 failed** - \_released_queue_is_held_until_its_submitted_work_is_done\: **1 passed, 0 failed** - **Workspace suite (\cargo build --workspace\ then \cargo test --workspace --no-fail-fast -- --test-threads=4\):** **1244 passed, 2 failed, 46 ignored** (1176 lib + 68 integration). - Both failures are pre-existing \ID3D12PipelineState::GetCachedBlob()\ failures on this driver/setup (also seen identically on \origin/main\ \
Chrysana commented 2026-11-25 22:06:36 +00:00 (Migrated from github.com)

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


AMD run of f71cf21, for "AMD/Intel" in the reports so far. On AMD the leak from #1668 is there too, but it doesn't run into E_OUTOFMEMORY: without this PR, 256 create/submit/release cycles all succeed and leave 256 queues tracked. With it, the same 256 succeed and leave 0. The three new tests pass alone, the suite matches its base, and IgorAntunes66's flaky test fails here every time the three run together (10 of 10). His polling change fixes it (10 of 10 pass).

Setup: AMD Radeon RX 9070 XT 16 GB (RDNA4), driver 32.0.32015.2008; Ryzen 7 9800X3D with its RDNA2 Radeon iGPU; Windows 11 26200.9974; rustc 1.100.0 MSVC; debug. f71cf21 as pushed and its base 426a5a7, each in its own checkout and target folder.

#1668's loop on AMD. This is a local test, not for this PR, like IgorAntunes66's. On a device from the chosen adapter it runs, up to 256 times: CreateCommandQueue, adopt(.., Kind::CommandQueue), present::note_execute, Signal + wait, then the title's release. A control run does create + release only.

adapter create + release create + submit + sync + release known_queues() after
426a5a7 RX 9070 XT 256 of 256 256 of 256 256
426a5a7 Radeon iGPU 256 of 256 256 of 256 256
f71cf21 RX 9070 XT 256 of 256 256 of 256 0
f71cf21 Radeon iGPU 256 of 256 256 of 256 0

So the AMD driver lets far more queues stay alive than NVIDIA's ~64 (IgorAntunes66's table above), and the issue doesn't show up as an error here. The tracking still keeps every queue the title submitted to on main, and this PR still lets them go.

The new tests (RX 9070 XT, which is the default adapter here; the tests take D3D12CreateDevice(None)):

  • Each alone (--exact), 3 rounds: all pass, 9 of 9.
  • The three together (cargo test -p xcl --lib -- a_queue_the_title_releases_is_not_kept_alive_by_the_submit_tracking a_tracked_queue_a_reader_holds_outlives_the_titles_release a_released_queue_is_held_until_its_submitted_work_is_done), 10 runs: a_released_queue_is_held_until_its_submitted_work_is_done fails in all 10, at real.rs:7792, the immediate held_queues().contains(..) assert. That's the flake IgorAntunes66 described, but here it happens every time.
  • With his polling change in place of that assert (wait up to 5 s for the queue to show up in held_queues()), done locally: 10 of 10 pass.
  • In the full suite (--test-threads=4) all three passed in my one run, as he saw.

Suite (RX 9070 XT, cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4, my local loop test skipped):

passed failed ignored SKIPPED
f71cf21 1243 3 46 10
426a5a7 1240 3 46 10 (same lines)

The same 3 failures on both: fuzz_validate_and_gpu_1 and fuzz_validate_and_gpu_3 (seeds 722 and 1599, the AMD seeds of #2115) and gpu::recomp::tests::gpu_image_get_resinfo_past_last_level.

Not tested

  • The three new tests on the iGPU (they use the default adapter).
  • This PR merged onto current main, a release build, a retail title.
  • How many leaked queues it takes for the AMD driver to fail; I stopped at 256.

AI use

  • Claude Code (Claude Opus 5.5) built both trees, wrote the local loop test, ran the tests and drafted this comment. I checked it before posting.
<!-- greyfinch-sync:ivall/xcl:comment:7174671934 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1691#issuecomment-7174671934). Originally posted by [Chrysana](https://github.com/Chrysana) on 2026-11-25T21:08:45Z. --- AMD run of `f71cf21`, for "AMD/Intel" in the reports so far. **On AMD the leak from #1668 is there too, but it doesn't run into `E_OUTOFMEMORY`: without this PR, 256 create/submit/release cycles all succeed and leave 256 queues tracked. With it, the same 256 succeed and leave 0. The three new tests pass alone, the suite matches its base, and IgorAntunes66's flaky test fails here every time the three run together (10 of 10). His polling change fixes it (10 of 10 pass).** **Setup:** AMD Radeon RX 9070 XT 16 GB (RDNA4), driver 32.0.32015.2008; Ryzen 7 9800X3D with its RDNA2 Radeon iGPU; Windows 11 26200.9974; rustc 1.100.0 MSVC; debug. `f71cf21` as pushed and its base `426a5a7`, each in its own checkout and target folder. **#1668's loop on AMD.** This is a local test, not for this PR, like IgorAntunes66's. On a device from the chosen adapter it runs, up to 256 times: `CreateCommandQueue`, `adopt(.., Kind::CommandQueue)`, `present::note_execute`, `Signal` + wait, then the title's release. A control run does create + release only. | | adapter | create + release | create + submit + sync + release | `known_queues()` after | |---|---|---|---|---| | `426a5a7` | RX 9070 XT | 256 of 256 | 256 of 256 | **256** | | `426a5a7` | Radeon iGPU | 256 of 256 | 256 of 256 | **256** | | `f71cf21` | RX 9070 XT | 256 of 256 | 256 of 256 | 0 | | `f71cf21` | Radeon iGPU | 256 of 256 | 256 of 256 | 0 | So the AMD driver lets far more queues stay alive than NVIDIA's ~64 (IgorAntunes66's table above), and the issue doesn't show up as an error here. The tracking still keeps every queue the title submitted to on `main`, and this PR still lets them go. **The new tests** (RX 9070 XT, which is the default adapter here; the tests take `D3D12CreateDevice(None)`): - Each alone (`--exact`), 3 rounds: all pass, 9 of 9. - **The three together** (`cargo test -p xcl --lib -- a_queue_the_title_releases_is_not_kept_alive_by_the_submit_tracking a_tracked_queue_a_reader_holds_outlives_the_titles_release a_released_queue_is_held_until_its_submitted_work_is_done`), 10 runs: **`a_released_queue_is_held_until_its_submitted_work_is_done` fails in all 10**, at `real.rs:7792`, the immediate `held_queues().contains(..)` assert. That's the flake IgorAntunes66 described, but here it happens every time. - With his polling change in place of that assert (wait up to 5 s for the queue to show up in `held_queues()`), done locally: **10 of 10 pass.** - In the full suite (`--test-threads=4`) all three passed in my one run, as he saw. **Suite** (RX 9070 XT, `cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4`, my local loop test skipped): | | passed | failed | ignored | SKIPPED | |---|---|---|---|---| | `f71cf21` | 1243 | 3 | 46 | 10 | | `426a5a7` | 1240 | 3 | 46 | 10 (same lines) | The same 3 failures on both: `fuzz_validate_and_gpu_1` and `fuzz_validate_and_gpu_3` (seeds 722 and 1599, the AMD seeds of #2115) and `gpu::recomp::tests::gpu_image_get_resinfo_past_last_level`. **Not tested** - The three new tests on the iGPU (they use the default adapter). - This PR merged onto current `main`, a release build, a retail title. - How many leaked queues it takes for the AMD driver to fail; I stopped at 256. **AI use** - Claude Code (Claude Opus 5.5) built both trees, wrote the local loop test, ran the tests and drafted this comment. I checked it before posting.
DavidM1911 commented 2026-11-26 07:03:29 +00:00 (Migrated from github.com)

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


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:7184120517 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1691#issuecomment-7184120517). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-26T06:07:49Z. --- 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
upipibi commented 2026-11-26 17:20:31 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-26T17:20:31Z.


Re-run of my base-controlled check (https://github.com/xcl-dev/xcl/pull/1691#issuecomment-7156141009) on the new head: RTX 3070 8 GB (driver 616.56, Windows 11, debug), f71cf21 merged cleanly onto main 8b957be, main alone as control.

  • The device loss I reported on 81f6397 no longer shows. cargo test -p xcl --lib hle::d3d12x:: -- --test-threads=2, 6 alternating runs each: PR merge 6/6 clean (263 passed), main 6/6 clean (260 passed). No nvlddmkm resets. On 81f6397 the merge lost the device in 1 of 6.
  • The new hold test is flaky on NVIDIA as well: with the three new tests run together, 10 runs, a_released_queue_is_held_until_its_submitted_work_is_done failed 2 of 10 (real.rs:8238, "its reference is held"). Run alone, it passed 3 of 3. This matches IgorAntunes66's and Chrysana's reports. I did not test the polling change.
  • cargo test -p xcl --lib -- --skip hle::xaudio2 --test-threads=4: 1312 passed, 0 failed, 27 ignored.

AI-assisted (Claude Code, Claude Sonnet 5.5 ran the tests; Claude Opus 5.5 checked and posted). Synthetic tests only.

<!-- greyfinch-sync:ivall/xcl:comment:7198853723 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1691#issuecomment-7198853723). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-26T17:20:31Z. --- Re-run of my base-controlled check (https://github.com/xcl-dev/xcl/pull/1691#issuecomment-7156141009) on the new head: RTX 3070 8 GB (driver 616.56, Windows 11, debug), `f71cf21` merged cleanly onto `main` `8b957be`, `main` alone as control. - **The device loss I reported on `81f6397` no longer shows.** `cargo test -p xcl --lib hle::d3d12x:: -- --test-threads=2`, 6 alternating runs each: PR merge 6/6 clean (263 passed), `main` 6/6 clean (260 passed). No nvlddmkm resets. On `81f6397` the merge lost the device in 1 of 6. - **The new hold test is flaky on NVIDIA as well:** with the three new tests run together, 10 runs, `a_released_queue_is_held_until_its_submitted_work_is_done` failed 2 of 10 (`real.rs:8238`, "its reference is held"). Run alone, it passed 3 of 3. This matches IgorAntunes66's and Chrysana's reports. I did not test the polling change. - `cargo test -p xcl --lib -- --skip hle::xaudio2 --test-threads=4`: 1312 passed, 0 failed, 27 ignored. AI-assisted (Claude Code, Claude Sonnet 5.5 ran the tests; Claude Opus 5.5 checked and posted). Synthetic tests only.
thiagocalile commented 2026-11-26 20:10:06 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thiagocalile on 2026-11-26T20:10:06Z.


Independent test and smoke report for head f71cf2147ecd3b4aa67b71c53ebcd8cfec326c2b on an AMD Radeon RX 6600 (8 GB VRAM, RDNA2, native wave64).

Tested

  • Hardware: AMD Radeon RX 6600 (8146 MiB VRAM, RDNA2, native wave64 + mesh shaders, driver 32.0.21045.29003, XCL_ADAPTER=radeon), AMD Ryzen 7 5700X3D, 47.9 GB RAM, Windows 11 (10.0.26200.0), Rust 1.100.0 (stable-x86_64-pc-windows-msvc), DXC 1.8.2502.11.
  • XCL_ADAPTER=radeon cargo test --no-fail-fast -p xcl --lib -- queue --test-threads=4: 41 passed, 0 failed, 0 ignored (0 skipped).

Not tested: full workspace suite, 60 s smoke run on this head, NVIDIA/Intel GPUs, or Linux/Wine.

AI use: Antigravity (Gemini 4 Neon) ran the builds, tests, and smoke runs and drafted this report; the account owner reviewed and approved posting.

<!-- greyfinch-sync:ivall/xcl:comment:7202373728 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1691#issuecomment-7202373728). Originally posted by [thiagocalile](https://github.com/thiagocalile) on 2026-11-26T20:10:06Z. --- Independent test and smoke report for head `f71cf2147ecd3b4aa67b71c53ebcd8cfec326c2b` on an **AMD Radeon RX 6600** (8 GB VRAM, RDNA2, native wave64). **Tested** - Hardware: AMD Radeon RX 6600 (8146 MiB VRAM, RDNA2, native wave64 + mesh shaders, driver `32.0.21045.29003`, `XCL_ADAPTER=radeon`), AMD Ryzen 7 5700X3D, 47.9 GB RAM, Windows 11 (`10.0.26200.0`), Rust `1.100.0` (`stable-x86_64-pc-windows-msvc`), DXC `1.8.2502.11`. - `XCL_ADAPTER=radeon cargo test --no-fail-fast -p xcl --lib -- queue --test-threads=4`: **41 passed, 0 failed, 0 ignored** (`0` skipped). **Not tested:** full workspace suite, 60 s smoke run on this head, NVIDIA/Intel GPUs, or Linux/Wine. **AI use:** Antigravity (Gemini 4 Neon) ran the builds, tests, and smoke runs and drafted this report; the account owner reviewed and approved posting.
Decodere commented 2026-11-27 10:22:28 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-11-27T10:22:28Z.


Independent desktop NVIDIA verification of PR #1691 at head f71cf2147ecd3b4aa67b71c53ebcd8cfec326c2b (1 commit; exact parent & merge-base: 426a5a745db4d5e4b037449ede0b70cb342f5192, pre-#2555 ancestor of main).

Environment

  • GPU: NVIDIA GeForce RTX 4060 (8 GB / 7956 MiB reported by D3D12, Wave32-only Ada), driver 32.0.16.2114 (NVIDIA 621.14, WDDM 3.2)
  • CPU / RAM / OS: Intel Core i5-11400F (6C / 12T), 32 GB RAM (31.9 GiB usable), Windows 11 Home 26200 (Developer Mode off)
  • Toolchain: rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC, DXC 1.9.2609.5, --release

Targeted tests & build (f71cf214)

Command Result
cargo test --release -p xcl --lib -- --nocapture a_queue_the_title_releases_is_not_kept_alive_by_the_submit_tracking a_tracked_queue_a_reader_holds_outlives_the_titles_release a_released_queue_is_held_until_its_submitted_work_is_done (3 consecutive default-parallel runs) 1/3 passed, 2/3 failed (a_released_queue_is_held_until_its_submitted_work_is_done): run 1 3 passed; 0 failed (0.33s, 0 skipped); runs 2–3 2 passed; 1 failed (0.21s, 0.22s) — panicked at crates/xcl/src/hle/d3d12x/real.rs:7792:13 (the GPU may still run what was submitted to the queue: its reference is held); see parallel-test race note below
cargo test --release -p xcl --lib hle::d3d12x::late_release:: -- --nocapture (3 consecutive runs) 2 passed; 0 failed; 0 ignored; 1201 filtered out × 3 (0.32s, 0.32s, 0.32s, 0 skipped)
cargo test --release -p xcl --lib hle::d3d12x::real:: -- --nocapture (3 consecutive runs) 59 passed; 0 failed; 0 ignored; 1144 filtered out × 3 (0.43s, 0.41s, 0.41s, 0 skipped; includes all 3 new queue-release tests running on the live RTX 4060 D3D12 device)
cargo build --release -p xcl Clean build (1m 21s, exit 0, 0 new warnings in late_release.rs / present.rs / real.rs)

Parallel-test race note (real.rs:7792): When all 3 new queue-tracking tests run concurrently in the same process, a_tracked_queue_a_reader_holds_outlives_the_titles_release calls present::known_queues_held(), which transiently adds a COM reference to every queue in global present::QUEUES — including the queue created by a_released_queue_is_held_until_its_submitted_work_is_done. When the latter calls release(raw) while that sibling test holds held, q_release sees refcount n >= 2 (rather than n == 1) and correctly defers moving the queue into late_release::hold_queue() until the reader drops its reference. Unlike the other two tests (which poll via untracked_soon() with a comment noting a sibling test's reader may momentarily hold a queue), a_released_queue_is_held_until_its_submitted_work_is_done immediately asserts late_release::held_queues().contains(&(raw as usize)) without polling or serializing, causing the intermittent panic at real.rs:7792:13. All 3 tests passed 3/3 when staggered inside the full hle::d3d12x::real:: suite (59/59).

Paired quiet 60 s retail smoke (title: 29640639)

Exact parent & merge-base (426a5a745db4d5e4b037449ede0b70cb342f5192, cached baseline on the same machine):

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

PR #1691 (f71cf2147ecd3b4aa67b71c53ebcd8cfec326c2b):

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

Limits of coverage

  • All 3 new live-GPU command-queue lifecycle tests passed 3/3 within hle::d3d12x::real:: (59/59, 0 skipped) and 1/3 when launched directly alongside each other under default parallel test execution due to the present::known_queues_held() cross-test assertion race noted above; a separate --test-threads=1 rerun was not executed.
  • The 60 s retail smoke ran cleanly (1594 vs. 1591 frames, 60 60 60, 0 device removals, 0 crashes, 14477 vs. 14477 MB peak commit); it exercises live D3D12 command-queue adoption and execution (ExecuteCommandListsX), though it does not repeatedly create/release queues in a stress loop (#1668).

AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).

<!-- greyfinch-sync:ivall/xcl:comment:7215808001 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1691#issuecomment-7215808001). Originally posted by [Decodere](https://github.com/Decodere) on 2026-11-27T10:22:28Z. --- Independent desktop NVIDIA verification of **PR #1691** at head `f71cf2147ecd3b4aa67b71c53ebcd8cfec326c2b` (`1` commit; exact parent & merge-base: `426a5a745db4d5e4b037449ede0b70cb342f5192`, pre-`#2555` ancestor of `main`). ### Environment - **GPU:** NVIDIA GeForce RTX 4060 (8 GB / `7956 MiB` reported by D3D12, Wave32-only Ada), driver `32.0.16.2114` (NVIDIA `621.14`, WDDM 3.2) - **CPU / RAM / OS:** Intel Core i5-11400F (6C / 12T), 32 GB RAM (`31.9 GiB` usable), Windows 11 Home `26200` (Developer Mode off) - **Toolchain:** `rustc 1.100.0 (0ef1bc386 2026-11-09)` MSVC, DXC `1.9.2609.5`, `--release` ### Targeted tests & build (`f71cf214`) | Command | Result | | --- | --- | | `cargo test --release -p xcl --lib -- --nocapture a_queue_the_title_releases_is_not_kept_alive_by_the_submit_tracking a_tracked_queue_a_reader_holds_outlives_the_titles_release a_released_queue_is_held_until_its_submitted_work_is_done` (3 consecutive default-parallel runs) | **1/3 passed, 2/3 failed (`a_released_queue_is_held_until_its_submitted_work_is_done`)**: run 1 `3 passed; 0 failed` (`0.33s`, `0` skipped); runs 2–3 `2 passed; 1 failed` (`0.21s`, `0.22s`) — panicked at `crates/xcl/src/hle/d3d12x/real.rs:7792:13` (`the GPU may still run what was submitted to the queue: its reference is held`); see parallel-test race note below | | `cargo test --release -p xcl --lib hle::d3d12x::late_release:: -- --nocapture` (3 consecutive runs) | `2 passed; 0 failed; 0 ignored; 1201 filtered out` × 3 (`0.32s`, `0.32s`, `0.32s`, `0` skipped) | | `cargo test --release -p xcl --lib hle::d3d12x::real:: -- --nocapture` (3 consecutive runs) | `59 passed; 0 failed; 0 ignored; 1144 filtered out` × 3 (`0.43s`, `0.41s`, `0.41s`, `0` skipped; includes all 3 new queue-release tests running on the live RTX 4060 D3D12 device) | | `cargo build --release -p xcl` | Clean build (`1m 21s`, exit `0`, `0` new warnings in `late_release.rs` / `present.rs` / `real.rs`) | **Parallel-test race note (`real.rs:7792`):** When all 3 new queue-tracking tests run concurrently in the same process, `a_tracked_queue_a_reader_holds_outlives_the_titles_release` calls `present::known_queues_held()`, which transiently adds a COM reference to every queue in global `present::QUEUES` — including the queue created by `a_released_queue_is_held_until_its_submitted_work_is_done`. When the latter calls `release(raw)` while that sibling test holds `held`, `q_release` sees refcount `n >= 2` (rather than `n == 1`) and correctly defers moving the queue into `late_release::hold_queue()` until the reader drops its reference. Unlike the other two tests (which poll via `untracked_soon()` with a comment noting a sibling test's reader may momentarily hold a queue), `a_released_queue_is_held_until_its_submitted_work_is_done` immediately asserts `late_release::held_queues().contains(&(raw as usize))` without polling or serializing, causing the intermittent panic at `real.rs:7792:13`. All 3 tests passed `3/3` when staggered inside the full `hle::d3d12x::real::` suite (`59/59`). ### Paired quiet 60 s retail smoke (`title: 29640639`) Exact parent & merge-base (`426a5a745db4d5e4b037449ede0b70cb342f5192`, cached baseline on the same machine): ``` xcl-smoke v1 commit: 426a5a745db4d5e4b037449ede0b70cb342f5192 gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1591 (PresentX 1591) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14477 MB ``` PR #1691 (`f71cf2147ecd3b4aa67b71c53ebcd8cfec326c2b`): ``` xcl-smoke v1 commit: f71cf2147ecd3b4aa67b71c53ebcd8cfec326c2b gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1594 (PresentX 1594) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14477 MB ``` ### Limits of coverage - All 3 new live-GPU command-queue lifecycle tests passed `3/3` within `hle::d3d12x::real::` (`59/59`, `0` skipped) and `1/3` when launched directly alongside each other under default parallel test execution due to the `present::known_queues_held()` cross-test assertion race noted above; a separate `--test-threads=1` rerun was not executed. - The 60 s retail smoke ran cleanly (`1594` vs. `1591` frames, `60 60 60`, `0` device removals, `0` crashes, `14477` vs. `14477 MB` peak commit); it exercises live D3D12 command-queue adoption and execution (`ExecuteCommandListsX`), though it does not repeatedly create/release queues in a stress loop (`#1668`). *AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).*
thehollowedone commented 2026-11-27 19:56:59 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-27T19:56:59Z.


merge-check
base: 6089122a1c96dff16e93b6fdf04c8ed20cfb6102
head: f71cf2147ecd3b4aa67b71c53ebcd8cfec326c2b
merge: Clean local merge, no commit.
build: cargo build --workspace -> ok.
tests: XCL_ADAPTER=nvidia cargo test --workspace --no-fail-fast -- --test-threads=4 -> 1,467 passed, 1 failed, 47 ignored; 25 GPU skip notices. The three new queue-lifetime tests passed. The sole failure is gpu::recomp::pso::shader_cache_tests::console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk (DXIL not compiled), also seen on untouched base in the current-base #671 check.
review: A released queue's pending work no longer protects resources released afterward. q_release removes it from the active queue list; hold_queue retains its final fence in Held.queues. But Held::drain seals later resource batches using only currently active queues. I held a native D3D12 queue behind an unsignaled gate, put its pending final mark in the retirement set, then released a resource batch. The new focused test below failed 0/1 on the unmodified merged tree: the batch was released before the gate. Adding the retirement marks to sealing passed that regression and the two existing late_release::tests (3/0/0, no skips) on the RTX 3080 Ti. This candidate is a partial fix: it does not close the interval between removing the queue from the active list and registering its retirement mark.

For a complete handoff, register the final queue mark before removing its active-list coverage, and make each release batch see either the active queue or its retirement mark. Remove the queue from list_x::LIVE_QUEUES before the final signal: pick_queue currently returns a bare pointer from that registry, while on_queue_release runs only after the reaper's final native Release. A KickoffX during retirement can submit work after the alleged last mark. Give an already selected queue an owned lease through submission. Test a held pending queue plus a concurrent KickoffX choosing another live queue.

Two related ownership edges need the same treatment: fallback present_now carries the candidate's raw queue pointer past its mutex without AddRef until new_presenter; take an owned queue reference during candidate lookup. Also note_execute releases the replaced resource while holding CANDIDATE; that Release can run late_release::hold, whose queue snapshot may drop the final reader reference and re-enter present::forget_queue, waiting on the same mutex. Take the old resource under the lock and release it afterward. These are source-level paths; I did not run their interleavings. Add deterministic gate/interleaving regressions rather than relying on a stress pass.
performance: No matched title or memory measurement here. Retirement adds fence work only when the title drops a tracked queue; resource-batch sealing should retain the minimum required marks, without polling under the presentation lock.
verdict: not yet: cover retired queues in resource lifetime, make the active-to-retired transition atomic to readers and submitters, and remove COM Release from the candidate lock. The partial candidate was not run through the full workspace suite.
hardware / tool and model: Windows 11 build 26300; Ryzen 7 9800X3D; RTX 3080 Ti 12 GiB / NVIDIA 621.35; rustc 1.99.1 MSVC; DXC 1.8.2502.11. AI use: Codex (GPT-6.2 Sol) built, tested, checked the merged code and ran the red/green regression; Codex (GPT-6.2 Astra) independently reviewed queue lifetimes.

Focused red/green regression and partial candidate diff
diff --git a/crates/xcl/src/hle/d3d12x/late_release.rs b/crates/xcl/src/hle/d3d12x/late_release.rs
index 6adb980b..c809e7c1 100644
--- a/crates/xcl/src/hle/d3d12x/late_release.rs
+++ b/crates/xcl/src/hle/d3d12x/late_release.rs
@@ -72,7 +72,8 @@ impl Held {
     /// and take out the batches every queue is past: the resources to release now.
     unsafe fn drain(&mut self, queues: &[ID3D12CommandQueue], seal_now: bool) -> Vec<usize> {
         if !self.open.is_empty() && (seal_now || self.last_seal.is_none_or(|t| t.elapsed() >= SEAL_EVERY)) {
-            let mut marks = Vec::with_capacity(queues.len());
+            let mut marks = Vec::with_capacity(queues.len() + self.queues.len());
+            marks.extend(self.queues.iter().map(|q| (q.fence.clone(), q.value)));
             let mut ok = true;
             for q in queues {
                 let key = q.as_raw() as usize;
@@ -285,4 +286,33 @@ mod tests {
         assert_eq!(unsafe { held.drain(&[], false) }, vec![0x1000]);
         assert!(held.is_empty());
     }
+
+    #[test]
+    fn a_resource_waits_for_a_released_queues_pending_work() {
+        unsafe {
+            let Ok(dev) = crate::gpu::agility::create_device(None, windows::Win32::Graphics::Direct3D::D3D_FEATURE_LEVEL_11_0) else {
+                return crate::gpu::recomp::runner::skip_test("no GPU");
+            };
+            let queue: ID3D12CommandQueue = dev.CreateCommandQueue(&D3D12_COMMAND_QUEUE_DESC { Type: D3D12_COMMAND_LIST_TYPE_DIRECT, ..Default::default() }).unwrap();
+            let gate: ID3D12Fence = dev.CreateFence(0, D3D12_FENCE_FLAG_NONE).unwrap();
+            let retired: ID3D12Fence = dev.CreateFence(0, D3D12_FENCE_FLAG_NONE).unwrap();
+            queue.Wait(&gate, 1).unwrap();
+            queue.Signal(&retired, 1).unwrap();
+
+            let mut held = Held::default();
+            held.queues.push(ReleasedQueue { queue: queue.as_raw() as usize, fence: retired, value: 1 });
+            held.open.push(0x1000);
+            let early = held.drain(&[], true);
+            gate.Signal(1).unwrap();
+            assert!(early.is_empty(), "a resource must wait for work on a released queue");
+
+            let start = Instant::now();
+            let mut gone = Vec::new();
+            while gone.is_empty() && start.elapsed() < Duration::from_secs(10) {
+                std::thread::sleep(Duration::from_millis(5));
+                gone = held.drain(&[], false);
+            }
+            assert_eq!(gone, vec![0x1000]);
+        }
+    }
 }
<!-- greyfinch-sync:ivall/xcl:comment:7227027246 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1691#issuecomment-7227027246). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-11-27T19:56:59Z. --- merge-check base: [`6089122a1c96dff16e93b6fdf04c8ed20cfb6102`](https://github.com/xcl-dev/xcl/commit/6089122a1c96dff16e93b6fdf04c8ed20cfb6102) head: [`f71cf2147ecd3b4aa67b71c53ebcd8cfec326c2b`](https://github.com/xcl-dev/xcl/commit/f71cf2147ecd3b4aa67b71c53ebcd8cfec326c2b) merge: Clean local merge, no commit. build: `cargo build --workspace` -> ok. tests: `XCL_ADAPTER=nvidia cargo test --workspace --no-fail-fast -- --test-threads=4` -> 1,467 passed, 1 failed, 47 ignored; 25 GPU skip notices. The three new queue-lifetime tests passed. The sole failure is `gpu::recomp::pso::shader_cache_tests::console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk` (DXIL not compiled), also seen on untouched base in the [current-base #671 check](https://github.com/xcl-dev/xcl/pull/671#issuecomment-7223888221). review: **A released queue's pending work no longer protects resources released afterward.** [`q_release`](https://github.com/xcl-dev/xcl/blob/f71cf2147ecd3b4aa67b71c53ebcd8cfec326c2b/crates/xcl/src/hle/d3d12x/real.rs#L6771-L6795) removes it from the active queue list; [`hold_queue`](https://github.com/xcl-dev/xcl/blob/f71cf2147ecd3b4aa67b71c53ebcd8cfec326c2b/crates/xcl/src/hle/d3d12x/late_release.rs#L127-L151) retains its final fence in `Held.queues`. But [`Held::drain`](https://github.com/xcl-dev/xcl/blob/f71cf2147ecd3b4aa67b71c53ebcd8cfec326c2b/crates/xcl/src/hle/d3d12x/late_release.rs#L71-L108) seals later resource batches using only currently active queues. I held a native D3D12 queue behind an unsignaled gate, put its pending final mark in the retirement set, then released a resource batch. The new focused test below **failed 0/1** on the unmodified merged tree: the batch was released before the gate. Adding the retirement marks to sealing passed that regression and the two existing `late_release::tests` (**3/0/0**, no skips) on the RTX 3080 Ti. This candidate is a partial fix: it does not close the interval between removing the queue from the active list and registering its retirement mark. For a complete handoff, register the final queue mark before removing its active-list coverage, and make each release batch see either the active queue or its retirement mark. Remove the queue from [`list_x::LIVE_QUEUES`](https://github.com/xcl-dev/xcl/blob/6089122a1c96dff16e93b6fdf04c8ed20cfb6102/crates/xcl/src/hle/d3d12x/list_x.rs#L747-L771) before the final signal: `pick_queue` currently returns a bare pointer from that registry, while `on_queue_release` runs only after the reaper's final native Release. A `KickoffX` during retirement can submit work after the alleged last mark. Give an already selected queue an owned lease through submission. Test a held pending queue plus a concurrent `KickoffX` choosing another live queue. Two related ownership edges need the same treatment: fallback [`present_now`](https://github.com/xcl-dev/xcl/blob/f71cf2147ecd3b4aa67b71c53ebcd8cfec326c2b/crates/xcl/src/hle/d3d12x/present.rs#L1074-L1110) carries the candidate's raw queue pointer past its mutex without AddRef until `new_presenter`; take an owned queue reference during candidate lookup. Also [`note_execute`](https://github.com/xcl-dev/xcl/blob/f71cf2147ecd3b4aa67b71c53ebcd8cfec326c2b/crates/xcl/src/hle/d3d12x/present.rs#L371-L379) releases the replaced resource while holding `CANDIDATE`; that Release can run `late_release::hold`, whose queue snapshot may drop the final reader reference and re-enter `present::forget_queue`, waiting on the same mutex. Take the old resource under the lock and release it afterward. These are source-level paths; I did not run their interleavings. Add deterministic gate/interleaving regressions rather than relying on a stress pass. performance: No matched title or memory measurement here. Retirement adds fence work only when the title drops a tracked queue; resource-batch sealing should retain the minimum required marks, without polling under the presentation lock. verdict: **not yet**: cover retired queues in resource lifetime, make the active-to-retired transition atomic to readers and submitters, and remove COM Release from the candidate lock. The partial candidate was not run through the full workspace suite. hardware / tool and model: Windows 11 build 26300; Ryzen 7 9800X3D; RTX 3080 Ti 12 GiB / NVIDIA 621.35; rustc 1.99.1 MSVC; DXC 1.8.2502.11. AI use: Codex (GPT-6.2 Sol) built, tested, checked the merged code and ran the red/green regression; Codex (GPT-6.2 Astra) independently reviewed queue lifetimes. <details><summary>Focused red/green regression and partial candidate diff</summary> ```diff diff --git a/crates/xcl/src/hle/d3d12x/late_release.rs b/crates/xcl/src/hle/d3d12x/late_release.rs index 6adb980b..c809e7c1 100644 --- a/crates/xcl/src/hle/d3d12x/late_release.rs +++ b/crates/xcl/src/hle/d3d12x/late_release.rs @@ -72,7 +72,8 @@ impl Held { /// and take out the batches every queue is past: the resources to release now. unsafe fn drain(&mut self, queues: &[ID3D12CommandQueue], seal_now: bool) -> Vec<usize> { if !self.open.is_empty() && (seal_now || self.last_seal.is_none_or(|t| t.elapsed() >= SEAL_EVERY)) { - let mut marks = Vec::with_capacity(queues.len()); + let mut marks = Vec::with_capacity(queues.len() + self.queues.len()); + marks.extend(self.queues.iter().map(|q| (q.fence.clone(), q.value))); let mut ok = true; for q in queues { let key = q.as_raw() as usize; @@ -285,4 +286,33 @@ mod tests { assert_eq!(unsafe { held.drain(&[], false) }, vec![0x1000]); assert!(held.is_empty()); } + + #[test] + fn a_resource_waits_for_a_released_queues_pending_work() { + unsafe { + let Ok(dev) = crate::gpu::agility::create_device(None, windows::Win32::Graphics::Direct3D::D3D_FEATURE_LEVEL_11_0) else { + return crate::gpu::recomp::runner::skip_test("no GPU"); + }; + let queue: ID3D12CommandQueue = dev.CreateCommandQueue(&D3D12_COMMAND_QUEUE_DESC { Type: D3D12_COMMAND_LIST_TYPE_DIRECT, ..Default::default() }).unwrap(); + let gate: ID3D12Fence = dev.CreateFence(0, D3D12_FENCE_FLAG_NONE).unwrap(); + let retired: ID3D12Fence = dev.CreateFence(0, D3D12_FENCE_FLAG_NONE).unwrap(); + queue.Wait(&gate, 1).unwrap(); + queue.Signal(&retired, 1).unwrap(); + + let mut held = Held::default(); + held.queues.push(ReleasedQueue { queue: queue.as_raw() as usize, fence: retired, value: 1 }); + held.open.push(0x1000); + let early = held.drain(&[], true); + gate.Signal(1).unwrap(); + assert!(early.is_empty(), "a resource must wait for work on a released queue"); + + let start = Instant::now(); + let mut gone = Vec::new(); + while gone.is_empty() && start.elapsed() < Duration::from_secs(10) { + std::thread::sleep(Duration::from_millis(5)); + gone = held.drain(&[], false); + } + assert_eq!(gone, vec![0x1000]); + } + } } ``` </details>
throny commented 2026-11-27 20:01:26 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-27T20:01:26Z.


merge-check claim
head: f71cf2147e

<!-- greyfinch-sync:ivall/xcl:comment:7227098704 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1691#issuecomment-7227098704). Originally posted by [throny](https://github.com/throny) on 2026-11-27T20:01:26Z. --- merge-check claim head: f71cf2147ecd3b4aa67b71c53ebcd8cfec326c2b
throny commented 2026-11-27 20:17:19 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-27T20:17:19Z.


merge-check
base: 6089122a
head: f71cf2147e
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 1468 passed, 0 failed, 47 ignored (26 SKIPPED lines); base alone: 1465 passed, 0 failed, 47 ignored
review: blocking: use after free. The PR lets a released queue leave the known-queue list and be freed (at once, or by the late-release thread). Two callers it does not touch still walk the raw list and borrow each pointer: sync_known_queues in sparse.rs and collect_device_queues in vram.rs (both call present::known_queues() on main, and the diff changes only late_release.rs, present.rs and real.rs). A snapshot taken just before the release is then used on freed memory; the PR's own comment on known_queues_held names this, but only the drain paths were switched. Also open from the thread: a resource released after the queue's release is not fenced against that queue's work still on the GPU (the batch is sealed with the remaining queues only), and the test a_released_queue_is_held_until_its_submitted_work_is_done is reported flaky by two accounts (it passed in this one run).
performance: drain readers took and dropped a reference before; same cost, memory goes down (reasoned).
verdict: not yet: move the sparse and vram callers to known_queues_held, fence new batches against released queues' pending work, fix the flaky 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:7227357185 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1691#issuecomment-7227357185). Originally posted by [throny](https://github.com/throny) on 2026-11-27T20:17:19Z. --- merge-check base: 6089122a head: f71cf2147ecd3b4aa67b71c53ebcd8cfec326c2b merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 1468 passed, 0 failed, 47 ignored (26 SKIPPED lines); base alone: 1465 passed, 0 failed, 47 ignored review: blocking: use after free. The PR lets a released queue leave the known-queue list and be freed (at once, or by the late-release thread). Two callers it does not touch still walk the raw list and borrow each pointer: sync_known_queues in sparse.rs and collect_device_queues in vram.rs (both call present::known_queues() on main, and the diff changes only late_release.rs, present.rs and real.rs). A snapshot taken just before the release is then used on freed memory; the PR's own comment on known_queues_held names this, but only the drain paths were switched. Also open from the thread: a resource released after the queue's release is not fenced against that queue's work still on the GPU (the batch is sealed with the remaining queues only), and the test a_released_queue_is_held_until_its_submitted_work_is_done is reported flaky by two accounts (it passed in this one run). performance: drain readers took and dropped a reference before; same cost, memory goes down (reasoned). verdict: not yet: move the sparse and vram callers to known_queues_held, fence new batches against released queues' pending work, fix the flaky 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).
Foniass commented 2026-12-01 06:30:08 +00:00 (Migrated from github.com)

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


Triage (#1607) – head f71cf21

Main already has this change: 9dabfe8 ("D3D12.X: retire released command queues after their final marker"). q_release calls present::retire_released_queue when only the registry reference is left, which signals a final fence on the queue and drops the reference once that fence has passed. Main's present::known_queues_held takes references under the registry lock, as here.
The late_release::hold_queue / present::forget_queue path in this PR therefore conflicts with and duplicates main's retirement. #2638 (same issue #1668) only changes the sparse quarantine's queue references and does not overlap.
Recommendation: close (superseded by main commit 9dabfe8).

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:7302946621 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1691#issuecomment-7302946621). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T06:30:08Z. --- **Triage (#1607)** – head f71cf21 Main already has this change: 9dabfe8 ("D3D12.X: retire released command queues after their final marker"). `q_release` calls `present::retire_released_queue` when only the registry reference is left, which signals a final fence on the queue and drops the reference once that fence has passed. Main's `present::known_queues_held` takes references under the registry lock, as here. The `late_release::hold_queue` / `present::forget_queue` path in this PR therefore conflicts with and duplicates main's retirement. #2638 (same issue #1668) only changes the sparse quarantine's queue references and does not overlap. Recommendation: close (superseded by main commit 9dabfe8). AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
throny commented 2026-12-01 12:47:11 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-12-01T12:47:11Z.


Closing as superseded: this change is already on main (9dabfe85). main present.rs owns queues in a registry and retires a released queue after a final fence marker (9dabfe85, q_release -> retire_released_queue); known_queues_held exists; same goal (queue not kept alive forever, no use after free) as the PR

Two independent checks found this: Foniass's close list on #1607 and ours against current main. If something here is still missing on main, say so and reopen it, or ask and I will.

AI use: Claude Code (Claude Opus 5.5); the per-PR comparison was done by Claude Sonnet 5.5 sub-agents.

<!-- greyfinch-sync:ivall/xcl:comment:7311644493 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1691#issuecomment-7311644493). Originally posted by [throny](https://github.com/throny) on 2026-12-01T12:47:11Z. --- Closing as superseded: this change is already on `main` (9dabfe85). main present.rs owns queues in a registry and retires a released queue after a final fence marker (9dabfe85, q_release -> retire_released_queue); known_queues_held exists; same goal (queue not kept alive forever, no use after free) as the PR Two independent checks found this: Foniass's close list on #1607 and ours against current `main`. If something here is still missing on `main`, say so and reopen it, or ask and I will. AI use: Claude Code (Claude Opus 5.5); the per-PR comparison was done by Claude Sonnet 5.5 sub-agents.

Pull request closed

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!1681
No description provided.