XGameRuntime: answer QueryInterface for IID_IUnknown on runtime objects #1615

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

@⁠OtavioTadeu on GitHub · 2026-11-24 18:15 UTC · original
OtavioTadeu:fix/xgameruntime-qi-iunknown-1488 → main · +48 −2 · 1 files · 1 commits · open

What is in it

  • Addresses XCL-BT-040 (Part of #1488): accept IID_IUnknown ({00000000-0000-0000-C000-000000000046}) in hle::xgameruntime::api::query_interface, and clear *out when non-null before returning E_INVALIDARG or E_NOINTERFACE.
  • Add query_interface_accepts_iunknown unit test covering non-main, built-in fallback, and main XGameRuntime COM objects.

Tested

  • hardware (GPU + driver, CPU), Rust version, debug / release: NVIDIA GeForce GTX 1660 SUPER (driver 32.0.16.1088, Turing wave32), AMD Ryzen 5 5600G, Windows 11 26200, rustc 1.100.0, debug
  • cargo test -p xcl --lib hle::xgameruntime::api: 17 passed, 0 failed
  • cargo test --workspace -- --test-threads=4: 777 passed, 0 failed, 41 ignored (SKIPPED GPU tests: gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask [no wave64], gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware [no wave64], heap_window_out_of_memory_falls_back_to_the_switch_form [no heap windows])

Regression run

  • scripts/smoke.ps1 -Game retail_title -Seconds 60 (main baseline vs PR head on NVIDIA GeForce GTX 1660 SUPER):

xcl-smoke v1

commit: 9e3831e1f570d3646e53ab753b19ec07eb8f1485

gpu: NVIDIA GeForce GTX 1660 SUPER

title: retail_title

seconds: 60

exit: 0x0

frames shown: 631 (PresentX 631)

presents per 2 s (last 3): 47 47 49

device removals: 0

crashes: 0

peak commit: 15199 MB


xcl-smoke v1

commit: 027232617e7f3223e9bf97e55d822e7a490f1055

gpu: NVIDIA GeForce GTX 1660 SUPER

title: retail_title

seconds: 60

exit: 0x0

frames shown: 749 (PresentX 750)

presents per 2 s (last 3): 52 50 50

device removals: 0

crashes: 0

peak commit: 15267 MB

Not tested

  • AMD / Intel / native wave64 GPUs, Linux/Wine, and extended gameplay past the 60 s smoke window

AI use

  • Antigravity (Gemini 4 Neon) implemented the IID_IUnknown handling, unit test, and commit message; human reviewed.
**@⁠OtavioTadeu** on GitHub · 2026-11-24 18:15 UTC · [original](https://github.com/xcl-dev/xcl/pull/1615) `OtavioTadeu:fix/xgameruntime-qi-iunknown-1488` → `main` · +48 −2 · 1 files · 1 commits · open **What is in it** - Addresses `XCL-BT-040` (Part of #1488): accept `IID_IUnknown` (`{00000000-0000-0000-C000-000000000046}`) in `hle::xgameruntime::api::query_interface`, and clear `*out` when non-null before returning `E_INVALIDARG` or `E_NOINTERFACE`. - Add `query_interface_accepts_iunknown` unit test covering non-main, built-in fallback, and main XGameRuntime COM objects. **Tested** - hardware (GPU + driver, CPU), Rust version, debug / release: NVIDIA GeForce GTX 1660 SUPER (driver 32.0.16.1088, Turing wave32), AMD Ryzen 5 5600G, Windows 11 26200, rustc 1.100.0, debug - `cargo test -p xcl --lib hle::xgameruntime::api`: 17 passed, 0 failed - `cargo test --workspace -- --test-threads=4`: 777 passed, 0 failed, 41 ignored (SKIPPED GPU tests: `gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask` [no wave64], `gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware` [no wave64], `heap_window_out_of_memory_falls_back_to_the_switch_form` [no heap windows]) **Regression run** - `scripts/smoke.ps1 -Game retail_title -Seconds 60` (`main` baseline vs PR head on NVIDIA GeForce GTX 1660 SUPER): ``` xcl-smoke v1 commit: 9e3831e1f570d3646e53ab753b19ec07eb8f1485 gpu: NVIDIA GeForce GTX 1660 SUPER title: retail_title seconds: 60 exit: 0x0 frames shown: 631 (PresentX 631) presents per 2 s (last 3): 47 47 49 device removals: 0 crashes: 0 peak commit: 15199 MB ``` ``` xcl-smoke v1 commit: 027232617e7f3223e9bf97e55d822e7a490f1055 gpu: NVIDIA GeForce GTX 1660 SUPER title: retail_title seconds: 60 exit: 0x0 frames shown: 749 (PresentX 750) presents per 2 s (last 3): 52 50 50 device removals: 0 crashes: 0 peak commit: 15267 MB ``` **Not tested** - AMD / Intel / native wave64 GPUs, Linux/Wine, and extended gameplay past the 60 s smoke window **AI use** - Antigravity (Gemini 4 Neon) implemented the `IID_IUnknown` handling, unit test, and commit message; human reviewed.
In hle::xgameruntime::api::query_interface, all XGameRuntime COM-style
vtables (slot 0) checked only the class CLSID, known interface IIDs,
or main-interface fallback and refused IID_IUnknown
({00000000-0000-0000-C000-000000000046}) on non-main interface objects
(such as XUser gamertag, legacy XPackage/XSystem interfaces) and built-in
fallback objects (XAsync, XAccessibility) with E_NOINTERFACE
(XCL-BT-040 in #1488).

Accept IID_IUnknown in query_interface and zero *out upfront when
non-null (including on E_INVALIDARG/E_NOINTERFACE paths). Add
query_interface_accepts_iunknown regression coverage across non-main,
fallback, and main XGameRuntime objects.

Verified locally with:
cargo test -p xcl --lib hle::xgameruntime::api
(17 passed, 0 failed)

Assisted-by: Antigravity (Gemini 4 Neon)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:59:31 +00:00
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-24 18:57 UTC · original

Full-suite run, since this PR has no test report yet. Tested exact head 0272326 (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: 776 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.
  • Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4: 777 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.
**@⁠futurepro62** on GitHub · 2026-11-24 18:57 UTC · [original](https://github.com/xcl-dev/xcl/pull/1615#issuecomment-7141399630) Full-suite run, since this PR has no test report yet. Tested exact head `0272326` (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`: **776 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`. - Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace -- --test-threads=4`: **777 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.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 20:30 UTC · original

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

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

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-24 20:30 UTC · [original](https://github.com/xcl-dev/xcl/pull/1615#issuecomment-7143650170) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~22 ignored. Thanks!
Author
Owner

@⁠throny on GitHub · 2026-11-25 03:01 UTC · original

Two contributors checked independently and found that #1610 solves the same problem (for #1488) in a different way: #1607, group D47. You may want to compare them with the other author and agree on one, or say in the PR why both are needed.

This is a hint from the community triage in #1607, not a maintainer decision.

AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.

**@⁠throny** on GitHub · 2026-11-25 03:01 UTC · [original](https://github.com/xcl-dev/xcl/pull/1615#issuecomment-7151516009) <!-- xcl-1607-hint:D47 --> Two contributors checked independently and found that #1610 solves the same problem (for #1488) in a different way: #1607, group D47. You may want to compare them with the other author and agree on one, or say in the PR why both are needed. This is a hint from the community triage in #1607, not a maintainer decision. AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.
Author
Owner

@⁠throny on GitHub · 2026-11-25 03:12 UTC · original

Two contributors checked independently and found that #1593 #1610 solves the same problem (for #1488) in a different way: #1607, group D57. You may want to compare them with the other author and agree on one, or say in the PR why both are needed.

This is a hint from the community triage in #1607, not a maintainer decision.

AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.

**@⁠throny** on GitHub · 2026-11-25 03:12 UTC · [original](https://github.com/xcl-dev/xcl/pull/1615#issuecomment-7151689810) <!-- xcl-1607-hint:D57 --> Two contributors checked independently and found that #1593 #1610 solves the same problem (for #1488) in a different way: #1607, group D57. You may want to compare them with the other author and agree on one, or say in the PR why both are needed. This is a hint from the community triage in #1607, not a maintainer decision. AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.
Author
Owner

@⁠JJAutoCompare on GitHub · 2026-11-25 05:02 UTC · original

XCL PR #1615 focused Windows verification

Tested clean detached head 027232617e7f3223e9bf97e55d822e7a490f1055 on STOR-WINLAB. The PR changes only crates/xcl/src/hle/xgameruntime/api.rs.

AMD Ryzen 7 3800X, Intel Arc A770 with driver 32.0.101.9175, Windows 11 Enterprise Evaluation build 26200 (10.0.26200), DXC 1.9.2609.5, and rustc 1.100.0 (0ef1bc386 2026-11-09, x86_64-pc-windows-msvc). Cargo used the dev and test profiles with debug info and incremental compilation disabled.

Tested

  • cargo build --workspace succeeded.
  • cargo test --workspace --no-run compiled the workspace test executables.
  • cargo test -p xcl --lib xgameruntime -- --nocapture with XCL_ADAPTER=NONE_CPU_ONLY reported 74 passed, 0 failed, 0 ignored, 0 lines beginning SKIPPED , and 675 filtered out in 1.91 s. Counts were parsed from pr1615-focused.log. All three commands ran outside the Arc mutex.
  • query_interface_accepts_iunknown passed. IID_IUnknown returned S_OK and the same object pointer on main XUser, XSystem and XNetworking, three non-main XUser/XPackage/XSystem interfaces, and the XAsync and XAccessibility fallbacks. A null IID returned E_INVALIDARG and cleared the output on all eight objects. An unsupported IID returned E_NOINTERFACE and cleared the output on the five non-main and fallback objects.

Not tested

Execution was limited to the focused XGameRuntime tests. The full GPU workspace suite and retail-title smoke runs were omitted. Two existing tests returned early and were counted as passes by the harness. Host-backed queue coverage requires System32\xgameruntime.dll, and default audio endpoint coverage requires an available endpoint.

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 pr1615-focused.log and published.

**@⁠JJAutoCompare** on GitHub · 2026-11-25 05:02 UTC · [original](https://github.com/xcl-dev/xcl/pull/1615#issuecomment-7153389605) # XCL PR #1615 focused Windows verification Tested clean detached head `027232617e7f3223e9bf97e55d822e7a490f1055` on STOR-WINLAB. The PR changes only `crates/xcl/src/hle/xgameruntime/api.rs`. AMD Ryzen 7 3800X, Intel Arc A770 with driver 32.0.101.9175, Windows 11 Enterprise Evaluation build 26200 (10.0.26200), DXC 1.9.2609.5, and rustc 1.100.0 (0ef1bc386 2026-11-09, x86_64-pc-windows-msvc). Cargo used the dev and test profiles with debug info and incremental compilation disabled. **Tested** - `cargo build --workspace` succeeded. - `cargo test --workspace --no-run` compiled the workspace test executables. - `cargo test -p xcl --lib xgameruntime -- --nocapture` with `XCL_ADAPTER=NONE_CPU_ONLY` reported 74 passed, 0 failed, 0 ignored, 0 lines beginning `SKIPPED `, and 675 filtered out in 1.91 s. Counts were parsed from `pr1615-focused.log`. All three commands ran outside the Arc mutex. - `query_interface_accepts_iunknown` passed. `IID_IUnknown` returned `S_OK` and the same object pointer on main XUser, XSystem and XNetworking, three non-main XUser/XPackage/XSystem interfaces, and the XAsync and XAccessibility fallbacks. A null IID returned `E_INVALIDARG` and cleared the output on all eight objects. An unsupported IID returned `E_NOINTERFACE` and cleared the output on the five non-main and fallback objects. **Not tested** Execution was limited to the focused XGameRuntime tests. The full GPU workspace suite and retail-title smoke runs were omitted. Two existing tests returned early and were counted as passes by the harness. Host-backed queue coverage requires System32\xgameruntime.dll, and default audio endpoint coverage requires an available endpoint. **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 `pr1615-focused.log` and published.
This pull request has changes conflicting with the target branch.
  • crates/xcl/src/hle/xgameruntime/api.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

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