XGameRuntime: fix IUnknown/sibling QI and forwarding alias isolation #1600

Open
b3IKK wants to merge 1 commit from upstream-pr/1610 into main
b3IKK commented 2026-11-24 18:14:26 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by b3IKK on 2026-11-24T18:14:26Z.


Addresses XCL-BT-040 from #1488. Two bugs in crates/xcl/src/hle/xgameruntime/api.rs:

  • query_interface() refused IID_IUnknown on fallback objects (xcl_xasync_object, xcl_xaccessibility_object) and on non-main interface objects (XPACKAGE_V1_IID, …), and refused cross-interface QueryInterface to a sibling interface of the same COM class (e.g. XUSER → XUSER_GAMERTAG_IID).
  • QueryApiImpl shared o.pc on forwarding classes (XGAMEUI) when iid == clsid even though clsid is not in o.iface.iids, letting a shorter host vtable poison o.pc for the higher forwarded slots.

This returns the canonical identity object for IID_IUnknown (the class's main object, or this for standalone fallback objects), answers cross-interface QueryInterface for known sibling interfaces, and isolates a forwarding class's alias unless the IID asked is its single table IID.

Since the first version (#1607, group D68): the mount_with_ui_async change is gone. It mounted before the async work and so leaked on a terminated queue; #1242 mounts inside the work closure and covers that with a test, so this PR no longer competes with it.

On group D47 (#1593, #1615, and this PR): all three make QueryInterface(IUnknown) succeed. #1593 came first and is that change alone; what is left here is the sibling-interface lookup and the forwarding alias rule, neither of which the other two have. If #1593 merges first this one needs a small rebase in the same function.

What is in it

  • crates/xcl/src/hle/xgameruntime/api.rs: query_interface answers IID_IUnknown with the class's main object and looks up sibling interfaces; QueryApiImpl isolates a forwarding class's alias unless the IID is its single table IID. Tests query_interface_accepts_iunknown_and_sibling_interfaces and query_api_impl_isolates_forwarding_alias.

Tested

  • hardware (GPU + driver, CPU), Windows build, Rust version, debug / release: NVIDIA GeForce RTX 5080 (driver 32.0.16.1088), AMD Ryzen 9 9950X3D, Windows 11 10.0.26300, Rust 1.100.0 (stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5, debug (scripts/test.ps1) and release (scripts/smoke.ps1)
  • .\scripts\test.ps1 (cargo build --workspace + cargo test --workspace -- --test-threads=4): 995 passed, 0 failed, 45 ignored (SKIPPED: the wave64 / direct-DXIL per-lane tests that need 64-lane hardware or a semantics mode this adapter refuses, no heap windows, and cannot disable the driver cache (Windows Developer Mode is required))
  • cargo test -p xcl --lib -- hle::xgameruntime::api: 19 passed, 0 failed. Both new tests put on top of main's api.rs: 0 passed, 2 failed — IUnknown QI must succeed on xcl_xasync_object (E_NOINTERFACE) and XGAMEUI with iid == clsid must use an isolated forward alias (same pointer twice).

Regression run

main (80f4819, clean tree, no local changes):

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

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

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

Not tested

  • a title that asks for IID_IUnknown or a sibling interface on these objects (the tests build the calls)
  • the forwarding alias with a host vtable shorter than XCL's (the test only shows the alias is not shared)
  • AMD GPUs and native wave64 hardware
  • other titles (Minecraft Preview, Unicorn Overlord, Fortnite, XDefiant) and Linux / Wine

AI use

  • OpenCode, Claude Fable 5.2: audited xgameruntime/api.rs, wrote the fixes and both tests (and confirmed they fail on main's code), took the mount change out in favour of #1242, rebased onto 80f4819, ran the test suite and the scripts/smoke.ps1 runs, and drafted this PR description.
<!-- greyfinch-sync:ivall/xcl:issue:5477794617 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1610). Originally posted by [b3IKK](https://github.com/b3IKK) on 2026-11-24T18:14:26Z. --- Addresses `XCL-BT-040` from #1488. Two bugs in `crates/xcl/src/hle/xgameruntime/api.rs`: - `query_interface()` refused `IID_IUnknown` on fallback objects (`xcl_xasync_object`, `xcl_xaccessibility_object`) and on non-main interface objects (`XPACKAGE_V1_IID`, …), and refused cross-interface `QueryInterface` to a sibling interface of the same COM class (e.g. `XUSER` → `XUSER_GAMERTAG_IID`). - `QueryApiImpl` shared `o.pc` on forwarding classes (`XGAMEUI`) when `iid == clsid` even though `clsid` is not in `o.iface.iids`, letting a shorter host vtable poison `o.pc` for the higher forwarded slots. This returns the canonical identity object for `IID_IUnknown` (the class's `main` object, or `this` for standalone fallback objects), answers cross-interface `QueryInterface` for known sibling interfaces, and isolates a forwarding class's alias unless the IID asked is its single table IID. **Since the first version** (#1607, group D68): the `mount_with_ui_async` change is gone. It mounted before the async work and so leaked on a terminated queue; #1242 mounts inside the work closure and covers that with a test, so this PR no longer competes with it. On group D47 (#1593, #1615, and this PR): all three make `QueryInterface(IUnknown)` succeed. #1593 came first and is that change alone; what is left here is the sibling-interface lookup and the forwarding alias rule, neither of which the other two have. If #1593 merges first this one needs a small rebase in the same function. **What is in it** - `crates/xcl/src/hle/xgameruntime/api.rs`: `query_interface` answers `IID_IUnknown` with the class's main object and looks up sibling interfaces; `QueryApiImpl` isolates a forwarding class's alias unless the IID is its single table IID. Tests `query_interface_accepts_iunknown_and_sibling_interfaces` and `query_api_impl_isolates_forwarding_alias`. **Tested** - hardware (GPU + driver, CPU), Windows build, Rust version, debug / release: NVIDIA GeForce RTX 5080 (driver 32.0.16.1088), AMD Ryzen 9 9950X3D, Windows 11 10.0.26300, Rust 1.100.0 (`stable-x86_64-pc-windows-msvc`), DXC 1.9.2609.5, debug (`scripts/test.ps1`) and release (`scripts/smoke.ps1`) - `.\scripts\test.ps1` (`cargo build --workspace` + `cargo test --workspace -- --test-threads=4`): 995 passed, 0 failed, 45 ignored (SKIPPED: the wave64 / direct-DXIL per-lane tests that need 64-lane hardware or a semantics mode this adapter refuses, `no heap windows`, and `cannot disable the driver cache (Windows Developer Mode is required)`) - `cargo test -p xcl --lib -- hle::xgameruntime::api`: 19 passed, 0 failed. Both new tests put on top of `main`'s `api.rs`: 0 passed, 2 failed — `IUnknown QI must succeed on xcl_xasync_object` (`E_NOINTERFACE`) and `XGAMEUI with iid == clsid must use an isolated forward alias` (same pointer twice). **Regression run** main (`80f4819`, clean tree, no local changes): ``` xcl-smoke v1 commit: 80f4819098e921f2e1ab371144d4832f68ffedd6 gpu: NVIDIA GeForce RTX 5080 title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1638 (PresentX 1638) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 17779 MB ``` PR (`d3e2053`, clean tree, no local changes): ``` xcl-smoke v1 commit: d3e205313d8211881218b265d5b0489c3b5d3986 gpu: NVIDIA GeForce RTX 5080 title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1642 (PresentX 1642) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 17985 MB ``` **Not tested** - a title that asks for `IID_IUnknown` or a sibling interface on these objects (the tests build the calls) - the forwarding alias with a host vtable shorter than XCL's (the test only shows the alias is not shared) - AMD GPUs and native wave64 hardware - other titles (Minecraft Preview, Unicorn Overlord, Fortnite, XDefiant) and Linux / Wine **AI use** - OpenCode, Claude Fable 5.2: audited `xgameruntime/api.rs`, wrote the fixes and both tests (and confirmed they fail on `main`'s code), took the mount change out in favour of #1242, rebased onto `80f4819`, ran the test suite and the `scripts/smoke.ps1` runs, and drafted this PR description.
gut0to commented 2026-11-24 18:19:27 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gut0to on 2026-11-24T18:19:27Z.

Review: COMMENTED


AI-assisted review; I checked the COM identity rule against Microsoft documentation.

<!-- greyfinch-sync:ivall/xcl:review:6044925516 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1610#pullrequestreview-6044925516). Originally posted by [gut0to](https://github.com/gut0to) on 2026-11-24T18:19:27Z. **Review:** COMMENTED --- AI-assisted review; I checked the COM identity rule against Microsoft documentation.
b3IKK commented 2026-11-24 19:07:30 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by b3IKK on 2026-11-24T18:33:49Z.


Good catch @gut0to — updated in \4ddfd00\ so \QueryInterface(IID_IUnknown)\ always returns the canonical \main\ object for \ .clsid\ (falling back to \ his\ for standalone fallback objects like \xcl_xasync_object), and updated \query_interface_accepts_iunknown_and_sibling_interfaces\ to assert COM identity across both \XPackage/\XPackage v1\ and \XUser/\XUser gamertag. Re-ran \scripts/test.ps1\ and the 60 s \scripts/smoke.ps1\ run.

<!-- greyfinch-sync:ivall/xcl:comment:7140819289 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1610#issuecomment-7140819289). Originally posted by [b3IKK](https://github.com/b3IKK) on 2026-11-24T18:33:49Z. --- Good catch @gut0to — updated in \4ddfd00\ so \QueryInterface(IID_IUnknown)\ always returns the canonical \main\ object for \ .clsid\ (falling back to \ his\ for standalone fallback objects like \xcl_xasync_object\), and updated \query_interface_accepts_iunknown_and_sibling_interfaces\ to assert COM identity across both \XPackage\/\XPackage v1\ and \XUser\/\XUser gamertag\. Re-ran \scripts/test.ps1\ and the 60 s \scripts/smoke.ps1\ run.
futurepro62 commented 2026-11-24 19:07:50 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T18:56:33Z.


Full-suite run, since this PR has no test report yet. Tested exact head 4ddfd00 (on its base 9e3831e).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form: 777 passed, 0 failed, 41 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • The new tests ran and passed: query_interface_accepts_iunknown_and_sibling_interfaces, query_api_impl_isolates_forwarding_alias_and_mount_validates_block.
  • The previous head f045aa7 (the PR was updated before the NVIDIA run above) on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4: 778 passed, 0 failed, 41 ignored. SKIPPED: heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • heap_window_out_of_memory_falls_back_to_the_switch_form was skipped with --skip. It fails on main 9e3831e too, not because of this PR: under XCL_REQUIRE_GPU=mesh, runner::skip_test turns every skip except "no wave64" into a failure, including this test's opt-in "no heap windows" skip (XCL_HEAP_WINDOWS unset). Reported as #1651.

Not tested

  • a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
<!-- greyfinch-sync:ivall/xcl:comment:7141368085 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1610#issuecomment-7141368085). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-24T18:56:33Z. --- Full-suite run, since this PR has no test report yet. Tested exact head `4ddfd00` (on its base `9e3831e`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form`: **777 passed, 0 failed, 41 ignored**. SKIPPED (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. - The new tests ran and passed: `query_interface_accepts_iunknown_and_sibling_interfaces`, `query_api_impl_isolates_forwarding_alias_and_mount_validates_block`. - The previous head `f045aa7` (the PR was updated before the NVIDIA run above) on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace -- --test-threads=4`: **778 passed, 0 failed, 41 ignored**. SKIPPED: `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). - `heap_window_out_of_memory_falls_back_to_the_switch_form` was skipped with `--skip`. It fails on main `9e3831e` too, not because of this PR: under `XCL_REQUIRE_GPU=mesh`, `runner::skip_test` turns every skip except "no wave64" into a failure, including this test's opt-in "no heap windows" skip (`XCL_HEAP_WINDOWS` unset). Reported as #1651. **Not tested** - a release build, a game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
gut0to commented 2026-11-24 19:08:00 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gut0to on 2026-11-24T18:19:27Z.

Code review location: crates/xcl/src/hle/xgameruntime/api.rs; line 377

@@ -363,15 +366,23 @@ unsafe impl Send for Obj {}
 
 const SLOTS: usize = 96;
 
+const IID_IUNKNOWN: Guid = g(0x0000_0000_0000_0000_c000_0000_0000_0046);
+
 unsafe extern "system" fn query_interface(this: *const Obj, iid: *const Guid, out: *mut *mut c_void) -> HRESULT {
     if out.is_null() || iid.is_null() {
         return E_INVALIDARG;
     }
     let f = &(*this).iface;
-    if *iid == f.clsid || f.iids.contains(&*iid) || (f.main && own(&f.clsid, &*iid).is_some_and(|o| std::ptr::eq(o, this))) {
+    if *iid == IID_IUNKNOWN || *iid == f.clsid || f.iids.contains(&*iid) {
         *out = this as *mut c_void;

For IID_IUnknown, this returns the current per-interface Obj. Since own() creates separate objects for XPACKAGE and XPACKAGE_V1_IID, querying IUnknown through those interfaces can return different pointers for the same COM object; the new test currently asserts that behavior. COM requires every interface on one object to return the same physical IUnknown pointer. Please return a canonical identity object for the class (including fallback objects) from every interface. AI-assisted review; I verified the object layout and the COM rule.

<!-- greyfinch-sync:ivall/xcl:review-comment:4684569590 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1610#discussion_r4684569590). Originally posted by [gut0to](https://github.com/gut0to) on 2026-11-24T18:19:27Z. **Code review location:** `crates/xcl/src/hle/xgameruntime/api.rs`; line 377 ~~~~diff @@ -363,15 +366,23 @@ unsafe impl Send for Obj {} const SLOTS: usize = 96; +const IID_IUNKNOWN: Guid = g(0x0000_0000_0000_0000_c000_0000_0000_0046); + unsafe extern "system" fn query_interface(this: *const Obj, iid: *const Guid, out: *mut *mut c_void) -> HRESULT { if out.is_null() || iid.is_null() { return E_INVALIDARG; } let f = &(*this).iface; - if *iid == f.clsid || f.iids.contains(&*iid) || (f.main && own(&f.clsid, &*iid).is_some_and(|o| std::ptr::eq(o, this))) { + if *iid == IID_IUNKNOWN || *iid == f.clsid || f.iids.contains(&*iid) { *out = this as *mut c_void; ~~~~ --- For `IID_IUnknown`, this returns the current per-interface `Obj`. Since `own()` creates separate objects for `XPACKAGE` and `XPACKAGE_V1_IID`, querying IUnknown through those interfaces can return different pointers for the same COM object; the new test currently asserts that behavior. COM requires every interface on one object to return the same physical IUnknown pointer. Please return a canonical identity object for the class (including fallback objects) from every interface. AI-assisted review; I verified the object layout and the COM rule.
DavidM1911 commented 2026-11-24 21:09:31 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T20:30:18Z.


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

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

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7143647460 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1610#issuecomment-7143647460). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T20:30:18Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~22 ignored. Thanks!
upstream-sync changed title from [PR #1610] XGameRuntime: fix IUnknown/sibling QI, forwarding alias isolation, and mount_with_ui_async leak to [PR #1610] XGameRuntime: fix IUnknown/sibling QI and forwarding alias isolation 2026-11-25 01:09:12 +00:00
b3IKK commented 2026-11-25 01:10:37 +00:00 (Migrated from github.com)

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


Rebased onto 80f4819 and reduced: the mount_with_ui_async change is out of this PR, since #1242 mounts inside the async work and covers the terminated-queue leak with a test (#1607, group D68). What is left is the QueryInterface(IUnknown) identity, the sibling-interface lookup and the forwarding alias rule; both tests fail on main's api.rs and pass here. Suite 995 passed, 0 failed, 45 ignored. The old smoke blocks were from before the split, so the two in the description are new: 80f4819 (main) and d3e2053. AI use: OpenCode, Claude Fable 5.2.

<!-- greyfinch-sync:ivall/xcl:comment:7148308282 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1610#issuecomment-7148308282). Originally posted by [b3IKK](https://github.com/b3IKK) on 2026-11-25T00:14:55Z. --- Rebased onto `80f4819` and reduced: the `mount_with_ui_async` change is out of this PR, since #1242 mounts inside the async work and covers the terminated-queue leak with a test (#1607, group D68). What is left is the `QueryInterface(IUnknown)` identity, the sibling-interface lookup and the forwarding alias rule; both tests fail on `main`'s `api.rs` and pass here. Suite 995 passed, 0 failed, 45 ignored. The old smoke blocks were from before the split, so the two in the description are new: `80f4819` (main) and `d3e2053`. AI use: OpenCode, Claude Fable 5.2.
JJAutoCompare commented 2026-11-25 06:05:41 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T05:08:57Z.


PR #1610 focused Windows verification

Verified d3e205313d8211881218b265d5b0489c3b5d3986 on a clean detached checkout. The diff is confined to crates/xcl/src/hle/xgameruntime/api.rs.

Tested

  • STOR-WINLAB, Windows 11 Enterprise Evaluation x64 build 26200, AMD Ryzen 7 3800X, Intel Arc A770 driver 32.0.101.9175 (WDDM 3.2). DXC 1.9.2609.5, rustc 1.100.0 (0ef1bc386, x86_64-pc-windows-msvc). Unoptimized dev/test profiles with debuginfo and incremental compilation disabled.
  • cargo build --workspace and cargo test --workspace --no-run both exited 0. The latter compiled the workspace test executables.
  • cargo test -p xcl --lib xgameruntime -- --nocapture with XCL_ADAPTER=NONE_CPU_ONLY exited 0. pr1610-focused.log reports 76 passed, 0 failed, 0 ignored, 895 filtered out, and 0 lines beginning with SKIPPED . Two existing tests returned early for missing System32\xgameruntime.dll and a missing default audio endpoint. The harness includes those in the passed count.
  • query_interface_accepts_iunknown_and_sibling_interfaces verified that XAsync fallback returns its own IUnknown pointer, XPackage v1 and main share the main IUnknown pointer, and XUser can query its gamertag sibling with shared IUnknown identity.
  • query_api_impl_isolates_forwarding_alias verified that XGameUI queries by class ID and exact interface IID both succeed and return distinct XCL objects.

Not tested

Only the focused XGameRuntime unit tests ran, alongside full workspace compilation. The full GPU workspace suite and retail-title smoke runs were omitted. Host XGameUI forwarding through Gaming Services was untested.

AI use

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

<!-- greyfinch-sync:ivall/xcl:comment:7153494582 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1610#issuecomment-7153494582). Originally posted by [JJAutoCompare](https://github.com/JJAutoCompare) on 2026-11-25T05:08:57Z. --- # PR #1610 focused Windows verification Verified `d3e205313d8211881218b265d5b0489c3b5d3986` on a clean detached checkout. The diff is confined to `crates/xcl/src/hle/xgameruntime/api.rs`. **Tested** - STOR-WINLAB, Windows 11 Enterprise Evaluation x64 build 26200, AMD Ryzen 7 3800X, Intel Arc A770 driver 32.0.101.9175 (WDDM 3.2). DXC 1.9.2609.5, rustc 1.100.0 (`0ef1bc386`, `x86_64-pc-windows-msvc`). Unoptimized dev/test profiles with debuginfo and incremental compilation disabled. - `cargo build --workspace` and `cargo test --workspace --no-run` both exited 0. The latter compiled the workspace test executables. - `cargo test -p xcl --lib xgameruntime -- --nocapture` with `XCL_ADAPTER=NONE_CPU_ONLY` exited 0. `pr1610-focused.log` reports 76 passed, 0 failed, 0 ignored, 895 filtered out, and 0 lines beginning with `SKIPPED `. Two existing tests returned early for missing `System32\xgameruntime.dll` and a missing default audio endpoint. The harness includes those in the passed count. - `query_interface_accepts_iunknown_and_sibling_interfaces` verified that XAsync fallback returns its own `IUnknown` pointer, XPackage v1 and main share the main `IUnknown` pointer, and XUser can query its gamertag sibling with shared `IUnknown` identity. - `query_api_impl_isolates_forwarding_alias` verified that XGameUI queries by class ID and exact interface IID both succeed and return distinct XCL objects. **Not tested** Only the focused XGameRuntime unit tests ran, alongside full workspace compilation. The full GPU workspace suite and retail-title smoke runs were omitted. Host XGameUI forwarding through Gaming Services was untested. **AI use** T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against `pr1610-focused.log` and published.
luckyteagirl commented 2026-11-25 22:40:17 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-25T22:40:17Z.

Review: COMMENTED


I see a sibling-QueryInterface alias escape in this head. QueryApiImpl routes non-table forwarding IIDs through forward_alias_obj, but the sibling-QI branch below returns own(&f.clsid, iid) directly. For a multi-IID forwarding class, that can return the merged base Obj even though the per-IID alias owns the PC pointer. forward() then sees pc == 0 on the base and falls back to unknown_slot.

Could sibling forwarding QI use the per-IID alias lookup too? A deterministic regression could QI from one XGameUi forwarding alias to a second known IID, then verify the returned object is the second IID's alias (and, if feasible without a PC runtime, verify its pc initialization path). I confirmed this from PR head d3e205313d8211881218b265d5b0489c3b5d3986; I did not execute a test locally. Codex (GPT-6) assisted with this code review.

<!-- greyfinch-sync:ivall/xcl:review:6065972312 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1610#pullrequestreview-6065972312). Originally posted by [luckyteagirl](https://github.com/luckyteagirl) on 2026-11-25T22:40:17Z. **Review:** COMMENTED --- I see a sibling-`QueryInterface` alias escape in this head. `QueryApiImpl` routes non-table forwarding IIDs through `forward_alias_obj`, but the sibling-QI branch below returns `own(&f.clsid, iid)` directly. For a multi-IID forwarding class, that can return the merged base `Obj` even though the per-IID alias owns the PC pointer. `forward()` then sees `pc == 0` on the base and falls back to `unknown_slot`. Could sibling forwarding QI use the per-IID alias lookup too? A deterministic regression could QI from one `XGameUi` forwarding alias to a second known IID, then verify the returned object is the second IID's alias (and, if feasible without a PC runtime, verify its `pc` initialization path). I confirmed this from PR head `d3e205313d8211881218b265d5b0489c3b5d3986`; I did not execute a test locally. Codex (GPT-6) assisted with this code review.
upstream-sync closed this pull request 2026-11-25 23:07:28 +00:00
CalvyPZ commented 2026-11-25 23:09:13 +00:00 (Migrated from github.com)

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


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

<!-- greyfinch-sync:ivall/xcl:comment:7176675993 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1610#issuecomment-7176675993). Originally posted by [CalvyPZ](https://github.com/CalvyPZ) on 2026-11-25T22:41:37Z. --- This PR has been marked as a duplicate and closed after multiple agreeing checks in #1607. If you believe this is incorrect please re-open with why.
upstream-sync reopened this pull request 2026-11-26 00:04:27 +00:00
DavidM1911 commented 2026-11-26 06:06:47 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T05:48:30Z.


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:7183823525 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1610#issuecomment-7183823525). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-26T05:48:30Z. --- 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 16:08:28 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-26T16:08:28Z.


NVIDIA test report for d3e2053: RTX 3070 8 GB (Ampere, driver 616.56), Windows 11 26100, Rust 1.100.0, debug. Head tested as-is on its base 80f4819.

  • cargo test -p xcl --lib -- --skip hle::xaudio2 --test-threads=4: 937 passed, 0 failed, 25 ignored; 23 SKIPPED: 19 no wave64, 3 lower_dxil per-lane f16 forms refused by design (#1426), 1 driver-cache test (Developer Mode off); none in api.rs.
  • hle::xgameruntime::api::tests::query_interface_accepts_iunknown_and_sibling_interfaces and query_api_impl_isolates_forwarding_alias, each with --exact --test-threads=1 --nocapture, 3 runs: 3/3 passed each, 0 SKIPPED. This does not cover the multi-IID forwarding sibling QI raised in review.
    Lib tests only; no title run.
    AI-assisted (Claude Code, Claude Opus 5.5).
<!-- greyfinch-sync:ivall/xcl:comment:7197235796 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1610#issuecomment-7197235796). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-26T16:08:28Z. --- NVIDIA test report for `d3e2053`: RTX 3070 8 GB (Ampere, driver 616.56), Windows 11 26100, Rust 1.100.0, debug. Head tested as-is on its base `80f4819`. - `cargo test -p xcl --lib -- --skip hle::xaudio2 --test-threads=4`: 937 passed, 0 failed, 25 ignored; 23 SKIPPED: 19 `no wave64`, 3 lower_dxil per-lane f16 forms refused by design (#1426), 1 driver-cache test (Developer Mode off); none in api.rs. - `hle::xgameruntime::api::tests::query_interface_accepts_iunknown_and_sibling_interfaces` and `query_api_impl_isolates_forwarding_alias`, each with `--exact --test-threads=1 --nocapture`, 3 runs: 3/3 passed each, 0 SKIPPED. This does not cover the multi-IID forwarding sibling QI raised in review. Lib tests only; no title run. AI-assisted (Claude Code, Claude Opus 5.5).
throny commented 2026-11-28 21:07:40 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-28T21:07:40Z.


merge-check claim
head: d3e205313d

<!-- greyfinch-sync:ivall/xcl:comment:7245791190 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1610#issuecomment-7245791190). Originally posted by [throny](https://github.com/throny) on 2026-11-28T21:07:40Z. --- merge-check claim head: d3e205313d8211881218b265d5b0489c3b5d3986
throny commented 2026-11-28 21:36:55 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-28T21:36:55Z.


merge-check
base: beeb81be
head: d3e205313d
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2596 passed, 0 failed, 49 ignored (27 SKIPPED lines). Base alone at beeb81be (main after the merge of nvidia-dev): 2594 passed, 0 failed, 49 ignored.
review: the identity rule itself is right (a query for IUnknown gives the same pointer from every sibling; the objects are static, so reference counts play no part). One point from the thread is unanswered and I can follow it in the code: for a forwarding class, the query path now gives every interface id except the one in the table its own alias and never fills the main object's forwarding target; a sibling query or a query for IUnknown then returns that main object, and calls forwarded through it return "not implemented" (no crash: the forward checks for the empty target). It also touches the same function as #1593 and #1615.
performance: none.
verdict: not yet: answer the forwarding-class case (fill the main object's target or return an alias there), and say how this relates to #1593 / #1615.
hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).

<!-- greyfinch-sync:ivall/xcl:comment:7246146491 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1610#issuecomment-7246146491). Originally posted by [throny](https://github.com/throny) on 2026-11-28T21:36:55Z. --- merge-check base: beeb81be head: d3e205313d8211881218b265d5b0489c3b5d3986 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2596 passed, 0 failed, 49 ignored (27 SKIPPED lines). Base alone at beeb81be (main after the merge of nvidia-dev): 2594 passed, 0 failed, 49 ignored. review: the identity rule itself is right (a query for IUnknown gives the same pointer from every sibling; the objects are static, so reference counts play no part). One point from the thread is unanswered and I can follow it in the code: for a forwarding class, the query path now gives every interface id except the one in the table its own alias and never fills the main object's forwarding target; a sibling query or a query for IUnknown then returns that main object, and calls forwarded through it return "not implemented" (no crash: the forward checks for the empty target). It also touches the same function as #1593 and #1615. performance: none. verdict: not yet: answer the forwarding-class case (fill the main object's target or return an alias there), and say how this relates to #1593 / #1615. hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).
jsalzy commented 2026-11-30 02:34:07 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by jsalzy on 2026-11-30T02:34:07Z.


merge-check claim
head: d3e205313d

<!-- greyfinch-sync:ivall/xcl:comment:7267119584 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1610#issuecomment-7267119584). Originally posted by [jsalzy](https://github.com/jsalzy) on 2026-11-30T02:34:07Z. --- merge-check claim head: d3e205313d8211881218b265d5b0489c3b5d3986
jsalzy commented 2026-11-30 02:47:45 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by jsalzy on 2026-11-30T02:47:45Z.


merge-check
base: 9335bc0d86
head: d3e205313d
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2803 passed, 1 failed, 50 ignored; SKIPPED: 28 (22 no wave64 on this GPU; 3 per-lane form refused (#1426 semantics); 2 no heap windows (opt-in XCL_HEAP_WINDOWS=1); 1 driver cache cannot be disabled without Windows Developer Mode); failing: hle::d3d12x::standin::tests::concurrent_shell_miss_reuses_winner_and_releases_loser_pipeline (standin.rs:459, left (0, 1, 1), right (0, 0, 1)), fails on base too: main alone at 9335bc0 gives 2801 passed, 1 failed (same test, same assertion), 50 ignored. The PR's two new tests (query_interface_accepts_iunknown_and_sibling_interfaces, query_api_impl_isolates_forwarding_alias) pass.
review: the identity part is right: IUnknown answers with the class's main object from every sibling (the objects are static, so no reference counts are involved), and a sibling IID now finds its own object. The point from the first check is still open on current main, by reading the code (no test covers it): XGameUi has one table IID (eaf669df…), so QueryApiImpl(XGameUi, XGameUi) now hands out an alias, and a QueryInterface from that alias for IUnknown or for the table IID returns the shared main object, whose forward target is filled only if someone queried the exact table IID first; otherwise the dialog calls forwarded through it return E_NOTIMPL instead of reaching the PC runtime (no crash). Before this PR the IUnknown query was refused outright, so this is an improvement, but the path is incomplete. Overlaps: #1593 (older, open) makes the same IUnknown change without the rest (D57 in #1607, with #1615); #2623 (open, newer) rewrites the same forwarding branch so that every IID gets its own clone and the shared object never holds a target; the two conflict, and together the canonical IUnknown object of a forwarding class would never forward. Not duplicates.
performance: none (QueryInterface / QueryApiImpl only).
verdict: not yet: when QueryInterface returns the main object of a forwarding class, fill its forward target (as QueryApiImpl does for the table IID) or answer with the matching alias; and settle the order with #2623.
hardware / tool and model: RTX 4070 SUPER 12 GB (621.24 / 32.0.16.2124), Ryzen 7 7800X3D, 32 GB, Windows 11 Pro 25H2 26200.9974, Rust 1.100.0, debug / Claude app (Claude Opus 5.5): merge, build and suite run on this PC with git and cargo only; diff review by Claude Opus 5.5.

<!-- greyfinch-sync:ivall/xcl:comment:7267324134 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1610#issuecomment-7267324134). Originally posted by [jsalzy](https://github.com/jsalzy) on 2026-11-30T02:47:45Z. --- merge-check base: 9335bc0d86dbdc17c0e322bca617f35375b3e289 head: d3e205313d8211881218b265d5b0489c3b5d3986 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2803 passed, 1 failed, 50 ignored; SKIPPED: 28 (22 no wave64 on this GPU; 3 per-lane form refused (#1426 semantics); 2 no heap windows (opt-in XCL_HEAP_WINDOWS=1); 1 driver cache cannot be disabled without Windows Developer Mode); failing: hle::d3d12x::standin::tests::concurrent_shell_miss_reuses_winner_and_releases_loser_pipeline (standin.rs:459, left (0, 1, 1), right (0, 0, 1)), fails on base too: main alone at 9335bc0 gives 2801 passed, 1 failed (same test, same assertion), 50 ignored. The PR's two new tests (query_interface_accepts_iunknown_and_sibling_interfaces, query_api_impl_isolates_forwarding_alias) pass. review: the identity part is right: IUnknown answers with the class's main object from every sibling (the objects are static, so no reference counts are involved), and a sibling IID now finds its own object. The point from the first check is still open on current main, by reading the code (no test covers it): XGameUi has one table IID (eaf669df…), so QueryApiImpl(XGameUi, XGameUi) now hands out an alias, and a QueryInterface from that alias for IUnknown or for the table IID returns the shared main object, whose forward target is filled only if someone queried the exact table IID first; otherwise the dialog calls forwarded through it return E_NOTIMPL instead of reaching the PC runtime (no crash). Before this PR the IUnknown query was refused outright, so this is an improvement, but the path is incomplete. Overlaps: #1593 (older, open) makes the same IUnknown change without the rest (D57 in #1607, with #1615); #2623 (open, newer) rewrites the same forwarding branch so that every IID gets its own clone and the shared object never holds a target; the two conflict, and together the canonical IUnknown object of a forwarding class would never forward. Not duplicates. performance: none (QueryInterface / QueryApiImpl only). verdict: not yet: when QueryInterface returns the main object of a forwarding class, fill its forward target (as QueryApiImpl does for the table IID) or answer with the matching alias; and settle the order with #2623. hardware / tool and model: RTX 4070 SUPER 12 GB (621.24 / 32.0.16.2124), Ryzen 7 7800X3D, 32 GB, Windows 11 Pro 25H2 26200.9974, Rust 1.100.0, debug / Claude app (Claude Opus 5.5): merge, build and suite run on this PC with git and cargo only; diff review by Claude Opus 5.5.
Foniass commented 2026-12-01 06:15:59 +00:00 (Migrated from github.com)

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


Triage (#1607) – head d3e2053

#1593 and #1615 also answer IID_IUnknown in query_interface (xgameruntime/api.rs). #1615 returns this, which breaks COM identity across an object's vtables. #1593 returns the class's main object, as this PR does. This PR also answers sibling interface IIDs and changes the forwarding-alias rule in QueryApiImpl. That rule change is a separate fix and would be easier to review as its own PR. None of the three is on main. #1242 is unrelated (mount handle in mount_with_ui_async).
No problems found in the diff.
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:7302677590 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1610#issuecomment-7302677590). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T06:15:59Z. --- **Triage (#1607)** – head d3e2053 #1593 and #1615 also answer IID_IUnknown in `query_interface` (`xgameruntime/api.rs`). #1615 returns `this`, which breaks COM identity across an object's vtables. #1593 returns the class's main object, as this PR does. This PR also answers sibling interface IIDs and changes the forwarding-alias rule in `QueryApiImpl`. That rule change is a separate fix and would be easier to review as its own PR. None of the three is on main. #1242 is unrelated (mount handle in `mount_with_ui_async`). No problems found in the diff. 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/1610:upstream-pr/1610'
git switch 'upstream-pr/1610'

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