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

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

Imported from ivall/xcl. Originally posted by eizispark on 2026-11-25T00:55:41Z.


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.
<!-- greyfinch-sync:ivall/xcl:issue:5483013534 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2021). Originally posted by [eizispark](https://github.com/eizispark) on 2026-11-25T00:55:41Z. --- `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.
raylitebull commented 2026-11-25 02:08:40 +00:00 (Migrated from github.com)

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


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.

<!-- greyfinch-sync:ivall/xcl:comment:7149320790 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2021#issuecomment-7149320790). Originally posted by [raylitebull](https://github.com/raylitebull) on 2026-11-25T01:12:53Z. --- 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`.
fromthemoonx commented 2026-11-25 02:08:48 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by fromthemoonx on 2026-11-25T01:29:01Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7149597001 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2021#issuecomment-7149597001). Originally posted by [fromthemoonx](https://github.com/fromthemoonx) on 2026-11-25T01:29:01Z. --- **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.
raylitebull commented 2026-11-25 02:08:50 +00:00 (Migrated from github.com)

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


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.

<!-- greyfinch-sync:ivall/xcl:comment:7149685137 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2021#issuecomment-7149685137). Originally posted by [raylitebull](https://github.com/raylitebull) on 2026-11-25T01:33:31Z. --- 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.
JJAutoCompare commented 2026-11-25 02:08:54 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T01:40:45Z.


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.
<!-- greyfinch-sync:ivall/xcl:comment:7149828963 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2021#issuecomment-7149828963). Originally posted by [JJAutoCompare](https://github.com/JJAutoCompare) on 2026-11-25T01:40:45Z. --- # PR #2021 empirical test report Tested the clean live head `1e94be56109a6e6effcbc008ad9a8bada7e65856` of [xcl-dev/xcl#2021](https://github.com/xcl-dev/xcl/pull/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.
DavidM1911 commented 2026-11-25 04:10:45 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T04:01:34Z.


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:7152459254 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2021#issuecomment-7152459254). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T04:01:34Z. --- 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!
eizispark commented 2026-11-25 12:06:26 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by eizispark on 2026-11-25T11:45:19Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7161456242 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2021#issuecomment-7161456242). Originally posted by [eizispark](https://github.com/eizispark) on 2026-11-25T11:45:19Z. --- 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`.
DavidM1911 commented 2026-11-26 08:04:34 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T07:05:06Z.


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:7185079113 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2021#issuecomment-7185079113). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-26T07:05:06Z. --- 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 21:30:23 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-26T21:30:23Z.


Tested head aa4ee6c2eca0c78deda1c4dcab7f1bdcbf9d23a9 (merge-base with main 426a5a7) on Windows 11 Pro 26100, rustc 1.100.0 MSVC, debug, CPU only (no GPU opened).

cargo test -p xcl --lib hle::xgameruntime::taskqueue:: -- --test-threads=1: head 11 passed, 0 failed, 0 ignored; merge-base 10 passed, 0 failed. New on head: monitors_fire_across_composite_ports_and_outlive_registering_handle. Applied to the merge-base 426a5a745db4d5e4b037449ede0b70cb342f5192 code (test hunk only, no fix), hle::xgameruntime::taskqueue::tests::monitors_fire_across_composite_ports_and_outlive_registering_handle fails: monitor on main_q did not wake/dispatch composite completion (left: 0, right: 1), 0 passed, 1 failed.

Not tested: full suite, GPU, retail title. AI-assisted (Claude Code, Claude Sonnet 5.5 ran the tests; Claude Opus 5.5 checked and posted).

<!-- greyfinch-sync:ivall/xcl:comment:7203791037 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2021#issuecomment-7203791037). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-26T21:30:23Z. --- Tested head `aa4ee6c2eca0c78deda1c4dcab7f1bdcbf9d23a9` (merge-base with main `426a5a7`) on Windows 11 Pro 26100, rustc 1.100.0 MSVC, debug, CPU only (no GPU opened). `cargo test -p xcl --lib hle::xgameruntime::taskqueue:: -- --test-threads=1`: head 11 passed, 0 failed, 0 ignored; merge-base 10 passed, 0 failed. New on head: `monitors_fire_across_composite_ports_and_outlive_registering_handle`. Applied to the merge-base `426a5a745db4d5e4b037449ede0b70cb342f5192` code (test hunk only, no fix), `hle::xgameruntime::taskqueue::tests::monitors_fire_across_composite_ports_and_outlive_registering_handle` fails: `monitor on main_q did not wake/dispatch composite completion` (left: 0, right: 1), 0 passed, 1 failed. Not tested: full suite, GPU, retail title. AI-assisted (Claude Code, Claude Sonnet 5.5 ran the tests; Claude Opus 5.5 checked and posted).
Decodere commented 2026-11-27 05:01:23 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-11-27T05:01:23Z.


Independent desktop NVIDIA verification of PR #2021 at head aa4ee6c2eca0c78deda1c4dcab7f1bdcbf9d23a9 (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), 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 release tests & build (aa4ee6c2)

Command Result
cargo test --release -p xcl --lib monitors_fire_across_composite_ports_and_outlive_registering_handle -- --nocapture (3 consecutive runs) 1 passed; 0 failed; 0 ignored; 1200 filtered out × 3 (0.00s × 3, 0 skipped)
cargo test --release -p xcl --lib hle::xgameruntime::taskqueue:: -- --test-threads=1 (3 consecutive runs) 11 passed; 0 failed; 0 ignored; 1190 filtered out × 3 (0.26s × 3, 0 skipped)
cargo build --release -p xcl Clean build (1m 07s, exit 0, 0 new warnings)

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 #2021 (aa4ee6c2eca0c78deda1c4dcab7f1bdcbf9d23a9):

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

Runtime log observations (xcl.log)

  • 9204 log lines, 0 [ERROR] / device-removal / panic lines (dxil_cache: 460 hits, 0 misses, 0 compilation failures; 228 background pipelines, 0 failures).
  • Final draw/memory telemetry in log: 19522 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped); last memory sample 14454 MB committed by the process; video memory 6115 MB local, 4684 MB non-local.

Limits of coverage

  • Composite-port monitor fan-out, temporary XTaskQueueHandle lifetimes after closing the registering handle, and monitor cleanup on XTaskQueueTerminate were directly verified via monitors_fire_across_composite_ports_and_outlive_registering_handle (3/3) and the full hle::xgameruntime::taskqueue:: suite (11/11 × 3).
  • The 60 s retail smoke confirms zero runtime regression on title: 29640639 (single-run frame/commit delta vs. cached parent reflects normal startup variance, not this PR); it did not independently exercise a retail libHttpClient composite manual-pump monitor workload.

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

<!-- greyfinch-sync:ivall/xcl:comment:7210283753 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2021#issuecomment-7210283753). Originally posted by [Decodere](https://github.com/Decodere) on 2026-11-27T05:01:23Z. --- Independent desktop NVIDIA verification of **PR #2021** at head `aa4ee6c2eca0c78deda1c4dcab7f1bdcbf9d23a9` (`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), 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 release tests & build (`aa4ee6c2`) | Command | Result | | --- | --- | | `cargo test --release -p xcl --lib monitors_fire_across_composite_ports_and_outlive_registering_handle -- --nocapture` (3 consecutive runs) | `1 passed; 0 failed; 0 ignored; 1200 filtered out` × 3 (`0.00s` × 3, `0` skipped) | | `cargo test --release -p xcl --lib hle::xgameruntime::taskqueue:: -- --test-threads=1` (3 consecutive runs) | `11 passed; 0 failed; 0 ignored; 1190 filtered out` × 3 (`0.26s` × 3, `0` skipped) | | `cargo build --release -p xcl` | Clean build (`1m 07s`, exit `0`, `0` new warnings) | ### 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 #2021 (`aa4ee6c2eca0c78deda1c4dcab7f1bdcbf9d23a9`): ``` xcl-smoke v1 commit: aa4ee6c2eca0c78deda1c4dcab7f1bdcbf9d23a9 gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1602 (PresentX 1602) presents per 2 s (last 3): 60 61 60 device removals: 0 crashes: 0 peak commit: 14455 MB ``` ### Runtime log observations (`xcl.log`) - `9204` log lines, `0` `[ERROR]` / device-removal / panic lines (`dxil_cache`: `460` hits, `0` misses, `0` compilation failures; `228` background pipelines, `0` failures). - Final draw/memory telemetry in log: `19522 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped)`; last memory sample `14454 MB committed by the process; video memory 6115 MB local, 4684 MB non-local`. ### Limits of coverage - Composite-port monitor fan-out, temporary `XTaskQueueHandle` lifetimes after closing the registering handle, and monitor cleanup on `XTaskQueueTerminate` were directly verified via `monitors_fire_across_composite_ports_and_outlive_registering_handle` (`3/3`) and the full `hle::xgameruntime::taskqueue::` suite (`11/11` × 3). - The 60 s retail smoke confirms zero runtime regression on `title: 29640639` (single-run frame/commit delta vs. cached parent reflects normal startup variance, not this PR); it did not independently exercise a retail `libHttpClient` composite manual-pump monitor workload. *AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).*
Foniass commented 2026-12-01 07:12:43 +00:00 (Migrated from github.com)

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


Triage (#1607) – head aa4ee6c

No open or merged PR notifies monitors through shared ports; #2836 (closed) touched monitor unregistering only.
taskqueue.rs: Port::notify_monitors passes each callback a new handle (new_handle(owner.clone())) and closes it as soon as the callback returns. A title that keeps the queue handle it receives in the monitor callback and dispatches on it later (e.g. hands it to its UI thread) then uses a closed handle; main passed the registering handle. An owner whose two ports are the same Arc<Port> gets two callbacks (port 0 and 1) per submit. Each submit also allocates a handle per monitor.
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:7303777147 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2021#issuecomment-7303777147). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T07:12:43Z. --- **Triage (#1607)** – head aa4ee6c No open or merged PR notifies monitors through shared ports; #2836 (closed) touched monitor unregistering only. `taskqueue.rs`: `Port::notify_monitors` passes each callback a new handle (`new_handle(owner.clone())`) and closes it as soon as the callback returns. A title that keeps the queue handle it receives in the monitor callback and dispatches on it later (e.g. hands it to its UI thread) then uses a closed handle; main passed the registering handle. An owner whose two ports are the same `Arc<Port>` gets two callbacks (port 0 and 1) per submit. Each submit also allocates a handle per monitor. 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/2021:upstream-pr/2021'
git switch 'upstream-pr/2021'

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