XGameRuntime: notify shared-port monitors with temporary queue handles #2021

Open
github-bot wants to merge 1 commit from github-bot/gh-2021 into main AGit
Owner

@⁠eizispark on GitHub · 2026-11-25 00:55 UTC · original
eizispark:fix/taskqueue-shared-port-monitors → main · +205 −20 · 1 files · 1 commits · open

XTaskQueueRegisterMonitor previously captured the raw XTaskQueueHandle value passed at registration on the single Queue and invoked monitor callbacks only on the Queue through which an item was submitted. That broke the GDK / libHttpClient (XTaskQueue.h) monitor contract in two ways:

  1. When a title extracts a manual pump queue's port via XTaskQueueGetPort and combines it into a composite queue with XTaskQueueCreateComposite (for example, background work port + main-thread manual completion port), work or XAsyncComplete completions submitted through the composite queue never notified monitors registered on the pump queue, leaving manual-port event loops un-signaled.
  2. When the handle passed to XTaskQueueRegisterMonitor was closed after XTaskQueueDuplicateHandle — or when NULL was passed to monitor the process task queue — callbacks received a closed or null XTaskQueueHandle (causing XTaskQueueDispatch and XTaskQueueDuplicateHandle inside the callback to fail) instead of a temporary handle valid for the duration of the callback. In addition, XTaskQueueTerminate did not stop monitor notifications on terminated queues sharing a composite port.

What is in it

  • crates/xcl/src/hle/xgameruntime/taskqueue.rs: track live queues attached to each Port via Weak<Queue>, fan Port::notify_monitors out to every non-terminated queue attached to the port using that queue's own port slot (PORT_WORK / PORT_COMPLETION), pass a temporary QueueHandle closed on callback return, and clear Queue::monitors in XTaskQueueTerminate.
  • crates/xcl/src/hle/xgameruntime/taskqueue.rs (tests): add monitors_fire_across_composite_ports_and_outlive_registering_handle. It covers same-slot and cross-slot composite port submissions, inline XTaskQueueDispatch and XTaskQueueDuplicateHandle on the temporary callback handles, closing the registering handle while a duplicate stays open, NULL process-queue monitors, and no monitor callbacks after XTaskQueueTerminate. Each temporary handle is checked right after its own callback returns, before a later XTaskQueueDuplicateHandle can be given the freed handle's address.

Tested

  • Windows 11 x64, AMD Ryzen 7 9800X3D, AMD Radeon RX 9070 XT (driver 32.0.32015.16001), rustc 1.100.0 (0ef1bc386 2026-11-09), debug and release.
  • cargo test --workspace --no-fail-fast -- --test-threads=4 on the head, rebased onto main 426a5a7: 1241 passed, 3 failed – gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1, fuzz_validate_and_gpu_3 and gpu::recomp::tests::gpu_image_get_resinfo_past_last_level, which fail the same way on a clean main 426a5a7 on this adapter; 46 ignored.
  • monitors_fire_across_composite_ports_and_outlive_registering_handle alone, 40 runs: 0 failures. The whole hle::xgameruntime::taskqueue module, 20 runs: 0 failures. hle::xgameruntime: 76 passed, 0 failed.
  • The new test failed before the fix (monitor on main_q did not wake/dispatch composite completion, left: 0, right: 1).

Regression run

main:

xcl-smoke v1
commit: 426a5a745db4d5e4b037449ede0b70cb342f5192
gpu: AMD Radeon RX 9070 XT
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1680 (PresentX 1680)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14599 MB

PR head:

xcl-smoke v1
commit: aa4ee6c2eca0c78deda1c4dcab7f1bdcbf9d23a9
gpu: AMD Radeon RX 9070 XT
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1678 (PresentX 1678)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14571 MB

Not tested

  • NVIDIA and Intel GPUs, Windows 10, wave32-only adapters, and XCL_SAMPLE_* sample-data tests.

AI use

  • Antigravity (Google DeepMind, Gemini 4 Carbon) – audited XTaskQueueRegisterMonitor and composite-port notifications in taskqueue.rs, wrote the fix and unit test, and ran the test suite and smoke check. Antigravity (Claude Opus 5.5) – fixed the handle-address reuse in the test that @⁠fromthemoonx found, rebased onto main 426a5a7, and reran the suite, the stress runs and the smoke pair.
**@⁠eizispark** on GitHub · 2026-11-25 00:55 UTC · [original](https://github.com/xcl-dev/xcl/pull/2021) `eizispark:fix/taskqueue-shared-port-monitors` → `main` · +205 −20 · 1 files · 1 commits · open `XTaskQueueRegisterMonitor` previously captured the raw `XTaskQueueHandle` value passed at registration on the single `Queue` and invoked monitor callbacks only on the `Queue` through which an item was submitted. That broke the GDK / `libHttpClient` (`XTaskQueue.h`) monitor contract in two ways: 1. When a title extracts a manual pump queue's port via `XTaskQueueGetPort` and combines it into a composite queue with `XTaskQueueCreateComposite` (for example, background work port + main-thread manual completion port), work or `XAsyncComplete` completions submitted through the composite queue never notified monitors registered on the pump queue, leaving manual-port event loops un-signaled. 2. When the handle passed to `XTaskQueueRegisterMonitor` was closed after `XTaskQueueDuplicateHandle` — or when `NULL` was passed to monitor the process task queue — callbacks received a closed or null `XTaskQueueHandle` (causing `XTaskQueueDispatch` and `XTaskQueueDuplicateHandle` inside the callback to fail) instead of a temporary handle valid for the duration of the callback. In addition, `XTaskQueueTerminate` did not stop monitor notifications on terminated queues sharing a composite port. **What is in it** - `crates/xcl/src/hle/xgameruntime/taskqueue.rs`: track live queues attached to each `Port` via `Weak<Queue>`, fan `Port::notify_monitors` out to every non-terminated queue attached to the port using that queue's own port slot (`PORT_WORK` / `PORT_COMPLETION`), pass a temporary `QueueHandle` closed on callback return, and clear `Queue::monitors` in `XTaskQueueTerminate`. - `crates/xcl/src/hle/xgameruntime/taskqueue.rs` (`tests`): add `monitors_fire_across_composite_ports_and_outlive_registering_handle`. It covers same-slot and cross-slot composite port submissions, inline `XTaskQueueDispatch` and `XTaskQueueDuplicateHandle` on the temporary callback handles, closing the registering handle while a duplicate stays open, `NULL` process-queue monitors, and no monitor callbacks after `XTaskQueueTerminate`. Each temporary handle is checked right after its own callback returns, before a later `XTaskQueueDuplicateHandle` can be given the freed handle's address. **Tested** - Windows 11 x64, AMD Ryzen 7 9800X3D, AMD Radeon RX 9070 XT (driver `32.0.32015.16001`), `rustc 1.100.0 (0ef1bc386 2026-11-09)`, debug and release. - `cargo test --workspace --no-fail-fast -- --test-threads=4` on the head, rebased onto `main` `426a5a7`: 1241 passed, 3 failed – `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1`, `fuzz_validate_and_gpu_3` and `gpu::recomp::tests::gpu_image_get_resinfo_past_last_level`, which fail the same way on a clean `main` `426a5a7` on this adapter; 46 ignored. - `monitors_fire_across_composite_ports_and_outlive_registering_handle` alone, 40 runs: 0 failures. The whole `hle::xgameruntime::taskqueue` module, 20 runs: 0 failures. `hle::xgameruntime`: 76 passed, 0 failed. - The new test failed before the fix (`monitor on main_q did not wake/dispatch composite completion`, `left: 0, right: 1`). **Regression run** `main`: ``` xcl-smoke v1 commit: 426a5a745db4d5e4b037449ede0b70cb342f5192 gpu: AMD Radeon RX 9070 XT title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1680 (PresentX 1680) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14599 MB ``` PR head: ``` xcl-smoke v1 commit: aa4ee6c2eca0c78deda1c4dcab7f1bdcbf9d23a9 gpu: AMD Radeon RX 9070 XT title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1678 (PresentX 1678) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14571 MB ``` **Not tested** - NVIDIA and Intel GPUs, Windows 10, wave32-only adapters, and `XCL_SAMPLE_*` sample-data tests. **AI use** - Antigravity (Google DeepMind, Gemini 4 Carbon) – audited `XTaskQueueRegisterMonitor` and composite-port notifications in `taskqueue.rs`, wrote the fix and unit test, and ran the test suite and smoke check. Antigravity (Claude Opus 5.5) – fixed the handle-address reuse in the test that @⁠fromthemoonx found, rebased onto `main` `426a5a7`, and reran the suite, the stress runs and the smoke pair.
XTaskQueueRegisterMonitor previously recorded the raw handle value used
at registration on the single Queue struct and fired callbacks only on
the queue through which work or completions were submitted. That broke
two parts of the GDK / libHttpClient XTaskQueue.h monitor contract:

1. When a title extracts a manual pump queue's port with XTaskQueueGetPort
   and attaches it to a composite queue with XTaskQueueCreateComposite,
   submissions to the composite queue never notified monitors registered
   on the pump queue, leaving manual-port event loops un-signaled.
2. When the handle passed to XTaskQueueRegisterMonitor was later closed
   after XTaskQueueDuplicateHandle (or was NULL for the process queue),
   callbacks received a closed or null XTaskQueueHandle instead of a
   temporary handle valid for the duration of the callback.

Track live queues attached to each Port via Weak<Queue>, fan monitor
notifications out to every non-terminated queue attached to the port
using that queue's own port slot, pass a temporary QueueHandle closed on
callback return, and clear monitors when XTaskQueueTerminate runs.

Assisted-by: Antigravity (Google DeepMind, Gemini 4 Carbon)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:15:08 +00:00
Author
Owner

@⁠raylitebull on GitHub · 2026-11-25 01:12 UTC · original

Code review on 1e94be5:

  • crates/xcl/src/hle/xgameruntime/taskqueue.rs cleanly handles shared/composite port notifications for duplicated and temporary queue handles and suppresses notifications once the monitored queue is terminated (monitors_fire_across_composite_ports_and_outlive_temporary_handles), verified on AMD RX 9070 XT.
  • Diff audited and CI workflow approved (currently running).

Remaining before merge: Build and test (Windows, no GPU) finishing green plus an NVIDIA verification pass on 1e94be5.

**@⁠raylitebull** on GitHub · 2026-11-25 01:12 UTC · [original](https://github.com/xcl-dev/xcl/pull/2021#issuecomment-7149320790) Code review on `1e94be5`: - `crates/xcl/src/hle/xgameruntime/taskqueue.rs` cleanly handles shared/composite port notifications for duplicated and temporary queue handles and suppresses notifications once the monitored queue is terminated (`monitors_fire_across_composite_ports_and_outlive_temporary_handles`), verified on AMD RX 9070 XT. - Diff audited and `CI` workflow approved (currently running). **Remaining before merge:** `Build and test (Windows, no GPU)` finishing green plus an **NVIDIA** verification pass on `1e94be5`.
Author
Owner

@⁠raylitebull on GitHub · 2026-11-25 01:33 UTC · original

Thanks @⁠fromthemoonx for isolating the Box handle-address reuse (dups[1] == temp0) in monitors_fire_across_composite_ports_and_outlive_registering_handle ( askqueue.rs:1222). @⁠eizispark — asserting that the temporary handle is gone right after the first XTaskQueueSubmitCallback (before the second callback allocates XTaskQueueDuplicateHandle) or allowing open duplicate handles in the assertion should eliminate the 3/40 test flake.

**@⁠raylitebull** on GitHub · 2026-11-25 01:33 UTC · [original](https://github.com/xcl-dev/xcl/pull/2021#issuecomment-7149685137) Thanks @⁠fromthemoonx for isolating the Box handle-address reuse (dups[1] == temp0) in monitors_fire_across_composite_ports_and_outlive_registering_handle ( askqueue.rs:1222). @⁠eizispark — asserting that the temporary handle is gone right after the first XTaskQueueSubmitCallback (before the second callback allocates XTaskQueueDuplicateHandle) or allowing open duplicate handles in the assertion should eliminate the 3/40 test flake.
Author
Owner

@⁠JJAutoCompare on GitHub · 2026-11-25 01:40 UTC · original

PR #2021 empirical test report

Tested the clean live head 1e94be56109a6e6effcbc008ad9a8bada7e65856 of xcl-dev/xcl#2021 (XGameRuntime: notify shared-port monitors with temporary queue handles).

  • Merge check: git merge-tree --write-tree exited 0 against both checked origin/main snapshots (564cebe0f898a5e04e3e046312c1a0c1afd02de9 and 8f5fca5bb9ad6e695093d75294ad2cec023bba60).

Tested

  • Host: STOR-WINLAB, Windows 11 Enterprise Evaluation 25H2 build 26200.9974, AMD Ryzen 7 3800X, Intel Arc A770 16 GiB (driver 32.0.101.9175, wave lanes 8–32, DoublePrecisionFloatShaderOps=0).
  • Toolchain: Rust 1.100.0 (0ef1bc386), DXC 1.9.2609.5, unoptimized dev/test profiles with CARGO_INCREMENTAL=0, CARGO_PROFILE_DEV_DEBUG=0, CARGO_PROFILE_TEST_DEBUG=0, XCL_ADAPTER=A770.
  • cargo test --workspace --no-run and cargo build --workspace succeeded (building the test-title executable and middleware DLL required by e2e).
  • cargo test -p xcl --lib hle::xgameruntime::taskqueue::tests -- --show-output (outside GPU lock): 11 passed, 0 failed, 0 ignored, 0 skipped, including the new shared-port monitor test.
  • cargo test --workspace --no-fail-fast -- --test-threads=4 --show-output (under Invoke-ArcTest.ps1): exited 101 across all workspace targets with 941 passed, 19 failed, 43 ignored in raw Cargo totals, including 25 explicit SKIPPED GPU lines across 15 named tests (excluded from coverage).
    • Failures: 18 GPU library tests (14 CreateComputePipelineState: 0x80070057 and 4 shader result mismatches) and 1 e2e failure (test_title_runs_and_game_folder_is_untouched dynamic depth-bias check; the synthetic title's task queue checks passed).
All 25 GPU SKIPPED lines
SKIPPED gpu::recomp::lower::tests::a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu: no wave64
SKIPPED gpu::recomp::lower::tests::cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu: no wave64
SKIPPED gpu::recomp::lower::tests::coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu: no wave64
SKIPPED gpu::recomp::lower::tests::the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::a_per_lane_2d_or_3d_group_runs_on_the_gpu: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))
SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 arithmetic, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 arithmetic, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))
SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 packed, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 compares, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 conversions, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu: integer arithmetic, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 rounding, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu: integer carries, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 transcendentals, wave64: no wave64
SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 three-source, wave64: no wave64
SKIPPED gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64
SKIPPED gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64
SKIPPED shaders::tests::pso_measurement_compiles_an_exact_synthetic_record: cannot disable the driver cache (Windows Developer Mode is required): The application requested an operation that depends on an SDK component that is missing or mismatched. (0x887A002D)
SKIPPED placed_title_textures_share_vram_and_preserve_pixels: tiled tier < 2
SKIPPED test_title_draws_with_a_root_signature_under_the_debug_layer: no d3d12SDKLayers.dll
SKIPPED heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows
SKIPPED uploads_start_from_each_subresources_state: no D3D12 debug layer (The application requested an operation that depends on an SDK component that is missing or mismatched. (0x887A002D))

Not tested

  • Same-host origin/main baseline comparison in this run (so the 19 GPU/e2e failures remain unattributed to this PR here).
  • Retail-title scripts/smoke.ps1 regression runs, optional XCL_SAMPLE_* datasets, audio endpoint, and system xgameruntime.dll.
  • AMD / NVIDIA GPUs, wave64 hardware, hardware FP64 ops, and D3D12 debug-layer paths.

AI use

  • T3 Code / Codex (gpt-6.2-sol) fetched and checked the PR head, built and ran the targeted and workspace tests, and summarized the logs. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified the counts against suite-after-build.log and published this report.
**@⁠JJAutoCompare** on GitHub · 2026-11-25 01:40 UTC · [original](https://github.com/xcl-dev/xcl/pull/2021#issuecomment-7149828963) # PR #2021 empirical test report Tested the clean live head `1e94be56109a6e6effcbc008ad9a8bada7e65856` of [xcl-dev/xcl#2021](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2021) (*XGameRuntime: notify shared-port monitors with temporary queue handles*). - **Merge check:** `git merge-tree --write-tree` exited 0 against both checked `origin/main` snapshots (`564cebe0f898a5e04e3e046312c1a0c1afd02de9` and `8f5fca5bb9ad6e695093d75294ad2cec023bba60`). ## Tested - **Host:** STOR-WINLAB, Windows 11 Enterprise Evaluation 25H2 build `26200.9974`, AMD Ryzen 7 3800X, Intel Arc A770 16 GiB (driver `32.0.101.9175`, wave lanes 8–32, `DoublePrecisionFloatShaderOps=0`). - **Toolchain:** Rust `1.100.0 (0ef1bc386)`, DXC `1.9.2609.5`, unoptimized dev/test profiles with `CARGO_INCREMENTAL=0`, `CARGO_PROFILE_DEV_DEBUG=0`, `CARGO_PROFILE_TEST_DEBUG=0`, `XCL_ADAPTER=A770`. - `cargo test --workspace --no-run` and `cargo build --workspace` succeeded (building the test-title executable and middleware DLL required by `e2e`). - `cargo test -p xcl --lib hle::xgameruntime::taskqueue::tests -- --show-output` (outside GPU lock): **11 passed, 0 failed, 0 ignored, 0 skipped**, including the new shared-port monitor test. - `cargo test --workspace --no-fail-fast -- --test-threads=4 --show-output` (under `Invoke-ArcTest.ps1`): exited `101` across all workspace targets with **941 passed, 19 failed, 43 ignored** in raw Cargo totals, including **25 explicit `SKIPPED` GPU lines across 15 named tests** (excluded from coverage). - Failures: 18 GPU library tests (14 `CreateComputePipelineState: 0x80070057` and 4 shader result mismatches) and 1 `e2e` failure (`test_title_runs_and_game_folder_is_untouched` dynamic depth-bias check; the synthetic title's task queue checks passed). <details> <summary>All 25 GPU SKIPPED lines</summary> ```text SKIPPED gpu::recomp::lower::tests::a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu: no wave64 SKIPPED gpu::recomp::lower::tests::cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu: no wave64 SKIPPED gpu::recomp::lower::tests::coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu: no wave64 SKIPPED gpu::recomp::lower::tests::the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu: no wave64 SKIPPED gpu::recomp::lower_dxil::tests::a_per_lane_2d_or_3d_group_runs_on_the_gpu: no wave64 SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's)) SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 arithmetic, wave64: no wave64 SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 arithmetic, wave64: no wave64 SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's)) SKIPPED gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu: f16 packed, wave64: no wave64 SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 compares, wave64: no wave64 SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's)) SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 conversions, wave64: no wave64 SKIPPED gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu: integer arithmetic, wave64: no wave64 SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 rounding, wave64: no wave64 SKIPPED gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu: integer carries, wave64: no wave64 SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 transcendentals, wave64: no wave64 SKIPPED gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu: f32 three-source, wave64: no wave64 SKIPPED gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64 SKIPPED gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64 SKIPPED shaders::tests::pso_measurement_compiles_an_exact_synthetic_record: cannot disable the driver cache (Windows Developer Mode is required): The application requested an operation that depends on an SDK component that is missing or mismatched. (0x887A002D) SKIPPED placed_title_textures_share_vram_and_preserve_pixels: tiled tier < 2 SKIPPED test_title_draws_with_a_root_signature_under_the_debug_layer: no d3d12SDKLayers.dll SKIPPED heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows SKIPPED uploads_start_from_each_subresources_state: no D3D12 debug layer (The application requested an operation that depends on an SDK component that is missing or mismatched. (0x887A002D)) ``` </details> ## Not tested - Same-host `origin/main` baseline comparison in this run (so the 19 GPU/e2e failures remain unattributed to this PR here). - Retail-title `scripts/smoke.ps1` regression runs, optional `XCL_SAMPLE_*` datasets, audio endpoint, and system `xgameruntime.dll`. - AMD / NVIDIA GPUs, wave64 hardware, hardware FP64 ops, and D3D12 debug-layer paths. ## AI use - T3 Code / Codex (`gpt-6.2-sol`) fetched and checked the PR head, built and ran the targeted and workspace tests, and summarized the logs. Coordinator #2 (T3 Code / Antigravity, `gemini-4-neon`) verified the counts against `suite-after-build.log` and published this report.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 04:01 UTC · original

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!

**@⁠DavidM1911** on GitHub · 2026-11-25 04:01 UTC · [original](https://github.com/xcl-dev/xcl/pull/2021#issuecomment-7152459254) 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!
Author
Owner

@⁠eizispark on GitHub · 2026-11-25 11:45 UTC · original

Thanks @⁠fromthemoonx for tracking down the address reuse, and @⁠raylitebull for the suggested fix.

Pushed aa4ee6c (rebased onto main 426a5a7). Each temporary handle is now checked right after its own XTaskQueueSubmitCallback returns. At that point the only other handle made during the callback is its duplicate, and it was allocated while the temporary handle was still live, so the two can't share an address. The old check after both callbacks is gone.

On the RX 9070 XT: the test alone, 40 runs, 0 failures. hle::xgameruntime::taskqueue, 20 runs, 0 failures. hle::xgameruntime, 76 passed. Full workspace: 1241 passed. The 3 failures (fuzz_validate_and_gpu_1/_3, gpu_image_get_resinfo_past_last_level) fail the same way on a clean main 426a5a7 here. New smoke pair in the description: 1680 frames on main, 1678 on the PR, no removals or crashes. The runtime change is the same as in 1e94be5.

**@⁠eizispark** on GitHub · 2026-11-25 11:45 UTC · [original](https://github.com/xcl-dev/xcl/pull/2021#issuecomment-7161456242) Thanks @⁠fromthemoonx for tracking down the address reuse, and @⁠raylitebull for the suggested fix. Pushed `aa4ee6c` (rebased onto `main` `426a5a7`). Each temporary handle is now checked right after its own `XTaskQueueSubmitCallback` returns. At that point the only other handle made during the callback is its duplicate, and it was allocated while the temporary handle was still live, so the two can't share an address. The old check after both callbacks is gone. On the RX 9070 XT: the test alone, 40 runs, 0 failures. `hle::xgameruntime::taskqueue`, 20 runs, 0 failures. `hle::xgameruntime`, 76 passed. Full workspace: 1241 passed. The 3 failures (`fuzz_validate_and_gpu_1`/`_3`, `gpu_image_get_resinfo_past_last_level`) fail the same way on a clean `main` `426a5a7` here. New smoke pair in the description: 1680 frames on main, 1678 on the PR, no removals or crashes. The runtime change is the same as in `1e94be5`.
Author
Owner

@⁠fromthemoonx on GitHub · 2026-11-25 01:29 UTC · original · edited 2026-11-25 12:09 UTC

Rerun on the new head aa4ee6c: the flake is gone here. monitors_fire_across_composite_ports_and_outlive_registering_handle alone (--exact --test-threads=1): 40 of 40 passed (it failed 3 of 40 on 1e94be5). hle::xgameruntime::taskqueue -- --test-threads=4: 20 of 20. cargo test --workspace --no-fail-fast -- --test-threads=4: 1244 passed, 0 failed, 46 ignored (base 426a5a7; merges into main 1a0bbe3 without conflicts). Same RTX 3060 / Ryzen 7 5700X, debug. The report below is for 1e94be5.


The new test is flaky because the test reuses a handle address, not because of the runtime: monitors_fire_across_composite_ports_and_outlive_registering_handle fails 3 of 40 times when run alone on this machine, and 5 of 40 in hle::xgameruntime::taskqueue. The rest of the suite passes, at the head and merged onto main.

The failure: taskqueue.rs:1222, temporary monitor handle leaked past callback.

Cause: handles are Box addresses (new_handle, taskqueue.rs:459). The first callback's temporary handle is freed when that callback returns. The second callback then calls XTaskQueueDuplicateHandle, and the allocator can hand that duplicate the same address. The duplicate stays open until after the assertion, so queue_from(ev[0].0) finds a live QueueHandle there. A scratch eprintln! before the assertion shows it, in 40 single-test runs:

FAILED  temp0=0x2cc55fcaca0 temp1=0x2cc55fcb120 dups=[2cc55fcafc0, 2cc55fcaca0]
FAILED  temp0=0x249c704b260 temp1=0x249c704b220 dups=[249c704aee0, 249c704b260]
FAILED  temp0=0x243b717a980 temp1=0x243b717a920 dups=[243b717a620, 243b717a980]
ok      temp0=0x2b1db86b1f0 temp1=0x2b1db86b590 dups=[2b1db86b310, 2b1db86b2b0]

In every failure, dups[1] == temp0. A check that cannot hit this would assert that the temporary handle is gone right after the first XTaskQueueSubmitCallback, before the second callback allocates anything. Another option is to assert that ev[0].0 is either not live or is one of the open duplicates.

Tested (RTX 3060 12 GB, driver 610.88, Ryzen 7 5700X, Windows 11 Pro 26300, Rust 1.100.0 MSVC, debug):

  • Exact head 1e94be5: cargo test --workspace --no-fail-fast -- --test-threads=4: 960 passed, 0 failed, 43 ignored.
  • Merged onto main 5796cc4 (no conflicts): 1058 passed, 0 failed, 45 ignored.
  • cargo test -p xcl --lib hle::xgameruntime::taskqueue -- --test-threads=4: 5 failed in 40 runs at the head, and 1 failed in 20 on the merged tree, each time this test with the same message.
  • cargo test -p xcl --lib <that test> -- --exact --test-threads=1: 3 failed in 40 runs.

Not tested: the runtime change in a title, Windows 10, a release build.

AI use: Claude Code (Claude Opus 5.5) ran the tests, found the cause with a scratch print (not pushed) and wrote this report.

**@⁠fromthemoonx** on GitHub · 2026-11-25 01:29 UTC · [original](https://github.com/xcl-dev/xcl/pull/2021#issuecomment-7149597001) · edited 2026-11-25 12:09 UTC **Rerun on the new head `aa4ee6c`: the flake is gone here.** `monitors_fire_across_composite_ports_and_outlive_registering_handle` alone (`--exact --test-threads=1`): 40 of 40 passed (it failed 3 of 40 on `1e94be5`). `hle::xgameruntime::taskqueue -- --test-threads=4`: 20 of 20. `cargo test --workspace --no-fail-fast -- --test-threads=4`: 1244 passed, 0 failed, 46 ignored (base `426a5a7`; merges into `main` `1a0bbe3` without conflicts). Same RTX 3060 / Ryzen 7 5700X, debug. The report below is for `1e94be5`. --- The new test is flaky because the test reuses a handle address, not because of the runtime: `monitors_fire_across_composite_ports_and_outlive_registering_handle` fails 3 of 40 times when run alone on this machine, and 5 of 40 in `hle::xgameruntime::taskqueue`. The rest of the suite passes, at the head and merged onto main. **The failure:** `taskqueue.rs:1222`, `temporary monitor handle leaked past callback`. **Cause:** handles are `Box` addresses (`new_handle`, `taskqueue.rs:459`). The first callback's temporary handle is freed when that callback returns. The second callback then calls `XTaskQueueDuplicateHandle`, and the allocator can hand that duplicate the same address. The duplicate stays open until after the assertion, so `queue_from(ev[0].0)` finds a live `QueueHandle` there. A scratch `eprintln!` before the assertion shows it, in 40 single-test runs: ``` FAILED temp0=0x2cc55fcaca0 temp1=0x2cc55fcb120 dups=[2cc55fcafc0, 2cc55fcaca0] FAILED temp0=0x249c704b260 temp1=0x249c704b220 dups=[249c704aee0, 249c704b260] FAILED temp0=0x243b717a980 temp1=0x243b717a920 dups=[243b717a620, 243b717a980] ok temp0=0x2b1db86b1f0 temp1=0x2b1db86b590 dups=[2b1db86b310, 2b1db86b2b0] ``` In every failure, `dups[1] == temp0`. A check that cannot hit this would assert that the temporary handle is gone right after the first `XTaskQueueSubmitCallback`, before the second callback allocates anything. Another option is to assert that `ev[0].0` is either not live or is one of the open duplicates. **Tested** (RTX 3060 12 GB, driver 610.88, Ryzen 7 5700X, Windows 11 Pro 26300, Rust 1.100.0 MSVC, debug): - Exact head `1e94be5`: `cargo test --workspace --no-fail-fast -- --test-threads=4`: 960 passed, 0 failed, 43 ignored. - Merged onto main `5796cc4` (no conflicts): 1058 passed, 0 failed, 45 ignored. - `cargo test -p xcl --lib hle::xgameruntime::taskqueue -- --test-threads=4`: 5 failed in 40 runs at the head, and 1 failed in 20 on the merged tree, each time this test with the same message. - `cargo test -p xcl --lib <that test> -- --exact --test-threads=1`: 3 failed in 40 runs. **Not tested:** the runtime change in a title, Windows 10, a release build. **AI use:** Claude Code (Claude Opus 5.5) ran the tests, found the cause with a scratch print (not pushed) and wrote this report.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-26 07:05 UTC · original

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

**@⁠DavidM1911** on GitHub · 2026-11-26 07:05 UTC · [original](https://github.com/xcl-dev/xcl/pull/2021#issuecomment-7185079113) 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
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2021/head:github-bot/gh-2021'
git switch 'github-bot/gh-2021'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2021'
git switch 'github-bot/gh-2021'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2021'
git switch 'github-bot/gh-2021'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2021'
git switch 'main'
git merge --squash 'github-bot/gh-2021'
git switch 'main'
git merge --ff-only 'github-bot/gh-2021'
git switch 'main'
git merge 'github-bot/gh-2021'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.