D3D12.X: drain present queue after Present before ResizeBuffers #706

Open
RandomGithub12309 wants to merge 1 commit from upstream-pr/711 into main
RandomGithub12309 commented 2026-11-24 03:59:21 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by RandomGithub12309 on 2026-11-24T03:59:21Z.


Fix a pre-existing swap-chain synchronization bug on main (surfaced during review of #674; isolated here from #674's triple-buffering change) where q.Signal(&p.fence, p.value) ran before sc.Present(0, DXGI_PRESENT(0)) and ensure_swapchain called sc.ResizeBuffers without draining the present queue first.

Because DXGI's Present submits internal GPU queue work on the swap-chain back buffer after p.fence was signaled, waiting on p.value did not wait for Present to retire. When ResizeBuffers ran (or when present_now moved to another queue), old back-buffer allocations could be freed while still referenced by DXGI's in-flight Present work (D3D12 error 921 / OBJECT_DELETED_WHILE_STILL_IN_USE).

What is in it

  • crates/xcl/src/hle/d3d12x/present.rs:
    • Extract present_frame_on from present_now and move p.value += 1; q.Signal(&p.fence, p.value) after sc.Present(0, DXGI_PRESENT(0)) so p.fence orders behind DXGI's Present queue work (while still signaling when Present returns an error so the submitted copy command list remains fenced).
    • Add drain_queue(p, timeout_ms) to signal a new p.fence value on p.queue, wait via fence::wait, and clear p.copy_source and p.dumps; extract drain_and_reset_for_queue(slot, queue, timeout_ms) for cross-queue switch draining, retaining the old presenter when a drain fails with a non-Removed error (e.g. timeout) so in-flight swap-chain, copy_source, and dump resources stay alive until the GPU finishes.
    • Call drain_queue(p, 2000) before sc.ResizeBuffers(2, ...) in ensure_swapchain (preserving p.disabled |= ... on device removal) and drain_and_reset_for_queue before dropping old on queue switches in present_now.
    • Add FRAME_DUMP_TEST_LOCK and unit/GPU regression tests covering multi-resize + frame dumps (present_and_resize_with_frame_dumps_drains_queue_cleanly), cross-queue switch draining (queue_switch_drains_old_presenter_before_recreating_swapchain), and drain/queue-move timeout retention and ResizeBuffers error recovery (drain_queue_and_resize_error_paths_preserve_in_flight_state).

Tested

  • Hardware: NVIDIA GeForce RTX 5050 Laptop GPU, Intel Core Ultra 7 255HX, Windows 11 Build 26300, rustc 1.100.0 (0ef1bc386 2026-11-09) stable-x86_64-pc-windows-msvc (debug for unit tests, release for smoke.ps1).
  • cargo test -p xcl --lib hle::d3d12x::present -- --test-threads=1 --nocapture at f98dc20: 9 passed, 0 failed, 0 ignored (0 skipped).
  • cargo test --workspace -- --test-threads=4 --skip fuzz_validate_and_gpu at f98dc20: xcl lib 940 passed, 0 failed, 25 ignored (SKIPPED on this adapter: wave64-only GPU tests and pso_measurement_compiles_an_exact_synthetic_record because Windows Developer Mode is off; gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_{0..3} excluded due to pre-existing 0x8007000E CreateComputePipelineState OOM on this adapter).
  • Game checked: 60 s scripts/smoke.ps1 release build at f98dc20 vs main (8e87fc7).

Regression run

xcl-smoke v1
commit: 8e87fc7b62a87ea589ccb9ea6182f514016cf7db
gpu: NVIDIA GeForce RTX 5050 Laptop GPU
title: e61570a3
seconds: 60
exit: 0x0
frames shown: 1603 (PresentX 1603)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14543 MB
xcl-smoke v1
commit: f98dc204d358723e497259e6fd3c8203f4aa146c
gpu: NVIDIA GeForce RTX 5050 Laptop GPU
title: e61570a3
seconds: 60
exit: 0x0
frames shown: 1596 (PresentX 1596)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14538 MB

Not tested

  • D3D12 debug layer on this host (d3d12SDKLayers.dll / Graphics Tools not installed; 0x887A002D), AMD/Intel/wave64 GPUs, Wine/Linux, and gameplay beyond the 60 s smoke window.

AI use

  • Antigravity (Gemini 4 Neon) wrote the initial fix, addressed the queue-move drain timeout review comments, rebased onto main, ran the tests and scripts/smoke.ps1 on the hardware above, and updated this description.
<!-- greyfinch-sync:ivall/xcl:issue:5465812565 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/711). Originally posted by [RandomGithub12309](https://github.com/RandomGithub12309) on 2026-11-24T03:59:21Z. --- Fix a pre-existing swap-chain synchronization bug on `main` (surfaced during review of #674; isolated here from #674's triple-buffering change) where `q.Signal(&p.fence, p.value)` ran **before** `sc.Present(0, DXGI_PRESENT(0))` and `ensure_swapchain` called `sc.ResizeBuffers` without draining the present queue first. Because DXGI's `Present` submits internal GPU queue work on the swap-chain back buffer after `p.fence` was signaled, waiting on `p.value` did not wait for `Present` to retire. When `ResizeBuffers` ran (or when `present_now` moved to another queue), old back-buffer allocations could be freed while still referenced by DXGI's in-flight `Present` work (D3D12 error `921` / `OBJECT_DELETED_WHILE_STILL_IN_USE`). **What is in it** - `crates/xcl/src/hle/d3d12x/present.rs`: - Extract `present_frame_on` from `present_now` and move `p.value += 1; q.Signal(&p.fence, p.value)` **after** `sc.Present(0, DXGI_PRESENT(0))` so `p.fence` orders behind DXGI's `Present` queue work (while still signaling when `Present` returns an error so the submitted copy command list remains fenced). - Add `drain_queue(p, timeout_ms)` to signal a new `p.fence` value on `p.queue`, wait via `fence::wait`, and clear `p.copy_source` and `p.dumps`; extract `drain_and_reset_for_queue(slot, queue, timeout_ms)` for cross-queue switch draining, retaining the old presenter when a drain fails with a non-`Removed` error (e.g. timeout) so in-flight swap-chain, `copy_source`, and dump resources stay alive until the GPU finishes. - Call `drain_queue(p, 2000)` before `sc.ResizeBuffers(2, ...)` in `ensure_swapchain` (preserving `p.disabled |= ...` on device removal) and `drain_and_reset_for_queue` before dropping `old` on queue switches in `present_now`. - Add `FRAME_DUMP_TEST_LOCK` and unit/GPU regression tests covering multi-resize + frame dumps (`present_and_resize_with_frame_dumps_drains_queue_cleanly`), cross-queue switch draining (`queue_switch_drains_old_presenter_before_recreating_swapchain`), and drain/queue-move timeout retention and `ResizeBuffers` error recovery (`drain_queue_and_resize_error_paths_preserve_in_flight_state`). **Tested** - Hardware: NVIDIA GeForce RTX 5050 Laptop GPU, Intel Core Ultra 7 255HX, Windows 11 Build 26300, `rustc 1.100.0 (0ef1bc386 2026-11-09)` `stable-x86_64-pc-windows-msvc` (debug for unit tests, release for `smoke.ps1`). - `cargo test -p xcl --lib hle::d3d12x::present -- --test-threads=1 --nocapture` at `f98dc20`: **9 passed, 0 failed, 0 ignored** (0 skipped). - `cargo test --workspace -- --test-threads=4 --skip fuzz_validate_and_gpu` at `f98dc20`: `xcl` lib **940 passed, 0 failed, 25 ignored** (`SKIPPED` on this adapter: wave64-only GPU tests and `pso_measurement_compiles_an_exact_synthetic_record` because Windows Developer Mode is off; `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_{0..3}` excluded due to pre-existing `0x8007000E` `CreateComputePipelineState` OOM on this adapter). - Game checked: 60 s `scripts/smoke.ps1` release build at `f98dc20` vs `main` (`8e87fc7`). **Regression run** ``` xcl-smoke v1 commit: 8e87fc7b62a87ea589ccb9ea6182f514016cf7db gpu: NVIDIA GeForce RTX 5050 Laptop GPU title: e61570a3 seconds: 60 exit: 0x0 frames shown: 1603 (PresentX 1603) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14543 MB ``` ``` xcl-smoke v1 commit: f98dc204d358723e497259e6fd3c8203f4aa146c gpu: NVIDIA GeForce RTX 5050 Laptop GPU title: e61570a3 seconds: 60 exit: 0x0 frames shown: 1596 (PresentX 1596) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14538 MB ``` **Not tested** - D3D12 debug layer on this host (`d3d12SDKLayers.dll` / Graphics Tools not installed; `0x887A002D`), AMD/Intel/wave64 GPUs, Wine/Linux, and gameplay beyond the 60 s smoke window. **AI use** - Antigravity (Gemini 4 Neon) wrote the initial fix, addressed the queue-move drain timeout review comments, rebased onto `main`, ran the tests and `scripts/smoke.ps1` on the hardware above, and updated this description.
thehollowedone commented 2026-11-24 07:06:07 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-24T04:07:21Z.


Tested

I reran the synthetic frame-capture fixture from #674 on the standalone fix 091a941, with the D3D12 debug layer active.

  • One DIRECT queue: 28 presents through three ResizeBuffers calls, with zero D3D12 validation errors.
  • Two DIRECT queues on the same device: two resizes, then a switch to the second queue at the final size change. XCL logged that the swap chain moved to the second queue and created the replacement. All 28 presents completed with zero D3D12 validation errors.

In each run, all 14 BMP captures matched their expected dimensions and all 250,944 sampled pixels matched. Both scratch tests passed 1/1 with no skips. Runtime code was stock.

Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti / 621.35, Rust 1.99.1 MSVC, debug. cargo test --offline --locked -p xcl --lib hle::d3d12x::present::scratch_resize::check -- --exact --nocapture --test-threads=1 with XCL_FRAME_DUMP=2.

Not tested

Queue-drain timeout, device removal, and retail performance.

AI use

Codex with GPT-6.2 Sol adapted the scratch fixture, ran the tests, and drafted this report.

<!-- greyfinch-sync:ivall/xcl:comment:7121726507 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/711#issuecomment-7121726507). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-11-24T04:07:21Z. --- **Tested** I reran the synthetic frame-capture fixture from [#674](https://github.com/ivall/xcl/pull/674#issuecomment-7121097043) on the standalone fix [`091a941`](https://github.com/ivall/xcl/commit/091a9415af324dd6258c3cb7a93a3e864af983e6), with the D3D12 debug layer active. - One DIRECT queue: 28 presents through three `ResizeBuffers` calls, with zero D3D12 validation errors. - Two DIRECT queues on the same device: two resizes, then a switch to the second queue at the final size change. XCL logged that the swap chain moved to the second queue and created the replacement. All 28 presents completed with zero D3D12 validation errors. In each run, all 14 BMP captures matched their expected dimensions and all 250,944 sampled pixels matched. Both scratch tests passed 1/1 with no skips. Runtime code was stock. Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti / 621.35, Rust 1.99.1 MSVC, debug. `cargo test --offline --locked -p xcl --lib hle::d3d12x::present::scratch_resize::check -- --exact --nocapture --test-threads=1` with `XCL_FRAME_DUMP=2`. **Not tested** Queue-drain timeout, device removal, and retail performance. **AI use** Codex with GPT-6.2 Sol adapted the scratch fixture, ran the tests, and drafted this report.
iggyvilla commented 2026-11-24 08:03:52 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by iggyvilla on 2026-11-24T07:53:49Z.


Read of e21f158 (nothing built or run by me).

Overlap with #674. This is the drain / signal-after-Present part of #674 (present_frame_on, drain_queue, the drain before ResizeBuffers), on the two-buffer presenter. A tree merge of the two heads conflicts in present.rs, so they cannot both land as they stand. If #674 goes first, what #711 has that #674 does not is the |= on p.disabled after a failed drain (present.rs:605, :619; #674 assigns with = at :631, which can clear the disabled that a failed Signal just set) and the test helpers. If #711 goes first, #674 has to drop its copies of the drain hunks.

Queue move. drain_and_reset_for_queue ignores the result of drain_queue(old, 1000) and then sets *slot = None (:657-667). On a timeout that releases the swap chain with a Present still queued, which is the error 921 case this PR exists to remove. Returning false without dropping old when the drain fails with anything but Removed (the p.queue != queue guard then skips that frame) would close it; the same point is on #674.

Tests. assert_no_debug_errors does nothing without the D3D12 debug layer (the PR says 0x887A002D on the author's machine), so a green run shows the fence/drain order but not the 921 itself; a run on a machine with Graphics Tools installed, named in the report, would show it.

AI use: Claude Code, Claude Sonnet 5.5, read the code at the head above; the points are mine.

<!-- greyfinch-sync:ivall/xcl:comment:7125492470 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/711#issuecomment-7125492470). Originally posted by [iggyvilla](https://github.com/iggyvilla) on 2026-11-24T07:53:49Z. --- Read of `e21f158` (nothing built or run by me). **Overlap with #674.** This is the drain / signal-after-`Present` part of #674 (`present_frame_on`, `drain_queue`, the drain before `ResizeBuffers`), on the two-buffer presenter. A tree merge of the two heads conflicts in `present.rs`, so they cannot both land as they stand. If #674 goes first, what #711 has that #674 does not is the `|=` on `p.disabled` after a failed drain (`present.rs:605`, `:619`; #674 assigns with `=` at `:631`, which can clear the `disabled` that a failed `Signal` just set) and the test helpers. If #711 goes first, #674 has to drop its copies of the drain hunks. **Queue move.** `drain_and_reset_for_queue` ignores the result of `drain_queue(old, 1000)` and then sets `*slot = None` (`:657-667`). On a timeout that releases the swap chain with a `Present` still queued, which is the error 921 case this PR exists to remove. Returning `false` without dropping `old` when the drain fails with anything but `Removed` (the `p.queue != queue` guard then skips that frame) would close it; the same point is on #674. **Tests.** `assert_no_debug_errors` does nothing without the D3D12 debug layer (the PR says `0x887A002D` on the author's machine), so a green run shows the fence/drain order but not the 921 itself; a run on a machine with Graphics Tools installed, named in the report, would show it. **AI use:** Claude Code, Claude Sonnet 5.5, read the code at the head above; the points are mine.
iggyvilla commented 2026-11-24 10:04:43 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by iggyvilla on 2026-11-24T09:31:54Z.


Read of e21f158 (nothing built or run by me).

Overlap with #674. This is the drain / signal-after-Present part of #674 (present_frame_on, drain_queue, the drain before ResizeBuffers), on the two-buffer presenter. A tree merge of the two heads conflicts in present.rs, so they cannot both land as they stand. If #674 goes first, what #711 has that #674 does not is the |= on p.disabled after a failed drain (present.rs:605, :619; #674 assigns with = at :631, which can clear the disabled that a failed Signal just set) and the test helpers. If #711 goes first, #674 has to drop its copies of the drain hunks.

Queue move. drain_and_reset_for_queue ignores the result of drain_queue(old, 1000) and then sets *slot = None (:657-667). On a timeout that releases the swap chain with a Present still queued, which is the error 921 case this PR exists to remove. Returning false without dropping old when the drain fails with anything but Removed (the p.queue != queue guard then skips that frame) would close it; the same point is on #674.

Tests. assert_no_debug_errors does nothing without the D3D12 debug layer (the PR says 0x887A002D on the author's machine), so a green run shows the fence/drain order but not the 921 itself; a run on a machine with Graphics Tools installed, named in the report, would show it.

AI use: Claude Code, Claude Sonnet 5.5, read the code at the head above; the points are mine.

<!-- greyfinch-sync:ivall/xcl:comment:7127541954 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/711#issuecomment-7127541954). Originally posted by [iggyvilla](https://github.com/iggyvilla) on 2026-11-24T09:31:54Z. --- Read of `e21f158` (nothing built or run by me). **Overlap with #674.** This is the drain / signal-after-`Present` part of #674 (`present_frame_on`, `drain_queue`, the drain before `ResizeBuffers`), on the two-buffer presenter. A tree merge of the two heads conflicts in `present.rs`, so they cannot both land as they stand. If #674 goes first, what #711 has that #674 does not is the `|=` on `p.disabled` after a failed drain (`present.rs:605`, `:619`; #674 assigns with `=` at `:631`, which can clear the `disabled` that a failed `Signal` just set) and the test helpers. If #711 goes first, #674 has to drop its copies of the drain hunks. **Queue move.** `drain_and_reset_for_queue` ignores the result of `drain_queue(old, 1000)` and then sets `*slot = None` (`:657-667`). On a timeout that releases the swap chain with a `Present` still queued, which is the error 921 case this PR exists to remove. Returning `false` without dropping `old` when the drain fails with anything but `Removed` (the `p.queue != queue` guard then skips that frame) would close it; the same point is on #674. **Tests.** `assert_no_debug_errors` does nothing without the D3D12 debug layer (the PR says `0x887A002D` on the author's machine), so a green run shows the fence/drain order but not the 921 itself; a run on a machine with Graphics Tools installed, named in the report, would show it. **AI use:** Claude Code, Claude Sonnet 5.5, read the code at the head above; the points are mine.
gut0to commented 2026-11-24 17:13:41 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gut0to on 2026-11-24T17:13:41Z.

Review: COMMENTED


AI-assisted review (GPT-6): I verified this finding against the queue wait and presenter-owned resource lifetimes in the current diff.

<!-- greyfinch-sync:ivall/xcl:review:6043958922 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/711#pullrequestreview-6043958922). Originally posted by [gut0to](https://github.com/gut0to) on 2026-11-24T17:13:41Z. **Review:** COMMENTED --- AI-assisted review (GPT-6): I verified this finding against the queue wait and presenter-owned resource lifetimes in the current diff.
gut0to commented 2026-11-24 18:09:24 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gut0to on 2026-11-24T17:13:41Z.

Code review location: crates/xcl/src/hle/d3d12x/present.rs; line 662

@@ -624,6 +654,18 @@ unsafe fn ensure_swapchain(p: &mut Presenter, hwnd: HWND, w: u32, h: u32, fmt: D
     }
 }
 
+unsafe fn drain_and_reset_for_queue(slot: &mut Option<Presenter>, queue: usize) -> bool {
+    if !slot.as_ref().is_some_and(|p| p.queue != queue) {
+        return false;
+    }
+    if let Some(old) = slot.as_mut() {
+        let _ = drain_queue(old, 1000);

Could we keep the old presenter until this drain succeeds? If the wait times out, the queue may still be executing the copy or present, but this code drops the presenter immediately, including copy_source and pending dump resources. Those D3D12 resources must stay alive until the GPU finishes using them. Please retain the presenter after a timeout and reset the slot only after a successful drain. AI-assisted review: I checked this path against drain_queue and the presenter-owned resource lifetimes.

<!-- greyfinch-sync:ivall/xcl:review-comment:4683754483 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/711#discussion_r4683754483). Originally posted by [gut0to](https://github.com/gut0to) on 2026-11-24T17:13:41Z. **Code review location:** `crates/xcl/src/hle/d3d12x/present.rs`; line 662 ~~~~diff @@ -624,6 +654,18 @@ unsafe fn ensure_swapchain(p: &mut Presenter, hwnd: HWND, w: u32, h: u32, fmt: D } } +unsafe fn drain_and_reset_for_queue(slot: &mut Option<Presenter>, queue: usize) -> bool { + if !slot.as_ref().is_some_and(|p| p.queue != queue) { + return false; + } + if let Some(old) = slot.as_mut() { + let _ = drain_queue(old, 1000); ~~~~ --- Could we keep the old presenter until this drain succeeds? If the wait times out, the queue may still be executing the copy or present, but this code drops the presenter immediately, including `copy_source` and pending dump resources. Those D3D12 resources must stay alive until the GPU finishes using them. Please retain the presenter after a timeout and reset the slot only after a successful drain. AI-assisted review: I checked this path against `drain_queue` and the presenter-owned resource lifetimes.
RandomGithub12309 commented 2026-11-25 01:11:03 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by RandomGithub12309 on 2026-11-25T00:57:43Z.


Updated at f98dc20 (rebased onto main 8e87fc7):

  • Addressed @iggyvilla and @gut0to's review on drain_and_reset_for_queue: on a non-Removed drain failure (e.g. timeout), the old presenter and its swap-chain / copy_source / dump resources are now retained and false is returned instead of dropping *slot.
  • Added queue-move drain timeout retention coverage to drain_queue_and_resize_error_paths_preserve_in_flight_state.
  • Stacked #674 cleanly on top of #711 so the two PRs no longer conflict in present.rs.
<!-- greyfinch-sync:ivall/xcl:comment:7149066092 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/711#issuecomment-7149066092). Originally posted by [RandomGithub12309](https://github.com/RandomGithub12309) on 2026-11-25T00:57:43Z. --- Updated at `f98dc20` (rebased onto `main` `8e87fc7`): - Addressed @iggyvilla and @gut0to's review on `drain_and_reset_for_queue`: on a non-`Removed` drain failure (e.g. timeout), the old presenter and its swap-chain / `copy_source` / dump resources are now retained and `false` is returned instead of dropping `*slot`. - Added queue-move drain timeout retention coverage to `drain_queue_and_resize_error_paths_preserve_in_flight_state`. - Stacked #674 cleanly on top of #711 so the two PRs no longer conflict in `present.rs`.
JJAutoCompare commented 2026-11-25 07:05:29 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T06:18:27Z.


Empirical test report (f98dc204)

Hardware / environment

  • PR #711 head f98dc204d358723e497259e6fd3c8203f4aa146c, detached and clean. Windows 11 Enterprise Evaluation x64, build 26200, non-interactive Session 0, AMD Ryzen 7 3800X.
  • Intel Arc A770, driver 32.0.101.9175. The WARP case explicitly uses the software adapter. The HWND cases use an automatic adapter selection with fallback, despite XCL_ADAPTER=A770.
  • Rust 1.100.0 (0ef1bc386), x86_64-pc-windows-msvc, unoptimized test profile with debuginfo and incremental compilation disabled. DXC 1.9.2609.5 (01b62ad47).

Commands and results

  • cargo test --workspace --no-run exited 0 outside the Arc lock. This compiled the test binaries without running tests.
  • Ran xcl-77aca8ccb20e299f.exe --exact <test> --test-threads=1 --format terse once per test. Each name below starts with hle::d3d12x::present::frame_dump_tests::.
    • Outside the lock, XCL_ADAPTER=NONE_CPU_ONLY: reports_without_frame_dumps_remain_readable exited 0. 1 passed, 0 failed, 0 ignored, 0 skipped.
    • Inside Invoke-ArcTest.ps1 -Test, XCL_ADAPTER=A770 and RUST_TEST_NOCAPTURE=1: mapped_frame_dump_distinguishes_dark_bright_and_undecoded_content exited 0. 1 passed, 0 failed, 0 ignored, 0 skipped.
    • In that same wrapper, present_and_resize_with_frame_dumps_drains_queue_cleanly, queue_switch_drains_old_presenter_before_recreating_swapchain, and drain_queue_and_resize_error_paths_preserve_in_flight_state each exited 0. The wrapper exited 0.
  • Log totals: libtest reported 5 passed, 0 failed, 0 ignored. Three of those passes emitted a case-sensitive SKIPPED line, leaving 2 tests that ran without skipping.

Observed behavior

All three HWND tests skipped at CreateSwapChainForHwnd with 0x887A0022. The resize, queue-switch, and error-path assertions were not reached.

Not tested

Full GPU workspace suite, interactive desktop presentation, and game smoke runs.

AI use: Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr711-focused.log and published.

<!-- greyfinch-sync:ivall/xcl:comment:7154655566 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/711#issuecomment-7154655566). Originally posted by [JJAutoCompare](https://github.com/JJAutoCompare) on 2026-11-25T06:18:27Z. --- ### Empirical test report (f98dc204) **Hardware / environment** - PR #711 head `f98dc204d358723e497259e6fd3c8203f4aa146c`, detached and clean. Windows 11 Enterprise Evaluation x64, build 26200, non-interactive Session 0, AMD Ryzen 7 3800X. - Intel Arc A770, driver 32.0.101.9175. The WARP case explicitly uses the software adapter. The HWND cases use an automatic adapter selection with fallback, despite `XCL_ADAPTER=A770`. - Rust 1.100.0 (0ef1bc386), x86_64-pc-windows-msvc, unoptimized test profile with debuginfo and incremental compilation disabled. DXC 1.9.2609.5 (01b62ad47). **Commands and results** - `cargo test --workspace --no-run` exited 0 outside the Arc lock. This compiled the test binaries without running tests. - Ran `xcl-77aca8ccb20e299f.exe --exact <test> --test-threads=1 --format terse` once per test. Each name below starts with `hle::d3d12x::present::frame_dump_tests::`. - Outside the lock, `XCL_ADAPTER=NONE_CPU_ONLY`: `reports_without_frame_dumps_remain_readable` exited 0. 1 passed, 0 failed, 0 ignored, 0 skipped. - Inside `Invoke-ArcTest.ps1 -Test`, `XCL_ADAPTER=A770` and `RUST_TEST_NOCAPTURE=1`: `mapped_frame_dump_distinguishes_dark_bright_and_undecoded_content` exited 0. 1 passed, 0 failed, 0 ignored, 0 skipped. - In that same wrapper, `present_and_resize_with_frame_dumps_drains_queue_cleanly`, `queue_switch_drains_old_presenter_before_recreating_swapchain`, and `drain_queue_and_resize_error_paths_preserve_in_flight_state` each exited 0. The wrapper exited 0. - Log totals: libtest reported 5 passed, 0 failed, 0 ignored. Three of those passes emitted a case-sensitive `SKIPPED ` line, leaving 2 tests that ran without skipping. **Observed behavior** All three HWND tests skipped at `CreateSwapChainForHwnd` with `0x887A0022`. The resize, queue-switch, and error-path assertions were not reached. **Not tested** Full GPU workspace suite, interactive desktop presentation, and game smoke runs. **AI use**: Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr711-focused.log and published.
DavidM1911 commented 2026-11-25 12:06:30 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T11:54:21Z.


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

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

Thanks!

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

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-29T07:42:00Z.


Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

<!-- greyfinch-sync:ivall/xcl:comment:7252635127 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/711#issuecomment-7252635127). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-29T07:42:00Z. --- Nothing has happened on this PR for 3 days, so it is marked `stale` and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto `main` if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.
Foniass commented 2026-12-01 03:59:52 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T03:59:52Z.


Triage (#1607) – head f98dc20

Part of this is on main now: 587d77be (merged with #1988) waits for the presenter's last fence value before ResizeBuffers in ensure_swapchain. That fence is still signalled before sc.Present, though, so the ordering fix here (signal after Present, or a new signal in drain_queue) is not on main. No other open PR does it.
Main's presenter has changed a lot since this branch was cut (a present ring with slots, a compositor, native_queue_signal), so the PR conflicts and needs reworking onto it.
No problems found in the diff itself.
Recommendation: keep open.

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

<!-- greyfinch-sync:ivall/xcl:comment:7300272165 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/711#issuecomment-7300272165). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T03:59:52Z. --- **Triage (#1607)** – head f98dc20 Part of this is on main now: 587d77be (merged with #1988) waits for the presenter's last fence value before `ResizeBuffers` in `ensure_swapchain`. That fence is still signalled before `sc.Present`, though, so the ordering fix here (signal after Present, or a new signal in `drain_queue`) is not on main. No other open PR does it. Main's presenter has changed a lot since this branch was cut (a present ring with slots, a compositor, `native_queue_signal`), so the PR conflicts and needs reworking onto it. No problems found in the diff itself. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

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

Merge

Merge the changes and update on Forgejo.

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

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

No due date set.

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