XGameRuntime: QueryInterface(IUnknown) on XCL's GDK objects gives one identity #1593
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1593
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1593"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Gruzzberry on GitHub · 2026-11-24 18:03 UTC · original
Gruzzberry:gz/xgameruntime-qi-iunknown→main· +34 −0 · 1 files · 1 commits · openThe objects
QueryApiImplhands out have QueryInterface / AddRef / Release as their first three vtable slots, so they are COM objects. COM requiresQueryInterface(IID_IUnknown)to succeed and to return the same pointer from every interface of the object, since that is how a caller compares identity.query_interfaceonly accepted the class id, the vtable's own interface ids and, on the main vtable, ids the GDK table does not know, so on a non-main vtable (for example XUser's gamertag interface) it was refused withE_NOINTERFACE. IUnknown now answers with the class's main object from every vtable, so two vtables of one object compare equal.What is in it
crates/xcl/src/hle/xgameruntime/api.rs:IID_IUNKNOWNinquery_interfacereturns the class's main object (own(&clsid, &IID_IUNKNOWN),thisif the object is not in the table); testquery_interface_answers_iunknown_with_one_identity(main and gamertag vtables return the same pointer, an unknown id on the non-main vtable is still refused).Tested
main(9e3831e) with only the test added: FAILED (E_NOINTERFACEfor IUnknown); with the one-line "answer withthis" variant: FAILED (the two vtables return different pointers); with the fix: okcargo test --workspace -- --test-threads=4: 777 passed, 0 failed, 41 ignoredgpu::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 windowscargo clippy -p xcl --all-targets: no new warnings in the changed linesRegression run (retail title 1.0.2.1, 60 s; first block
mainb7aa9f3, second this PR's head, which is on9e3831e)Not tested
AI use
🤖 Generated with Claude Code
github-bot referenced this pull request2026-11-26 04:59:09 +00:00
@futurepro62 on GitHub · 2026-11-24 18:54 UTC · original
Full-suite run, since this PR has no test report yet. Tested exact head
f326446(on its base9e3831e).Tested
cargo build --workspace, thenXCL_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.query_interface_answers_iunknown_with_one_identity.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_formwas skipped with--skip. It fails on main9e3831etoo, not because of this PR: underXCL_REQUIRE_GPU=mesh,runner::skip_testturns every skip except "no wave64" into a failure, including this test's opt-in "no heap windows" skip (XCL_HEAP_WINDOWSunset). Reported as #1651.Not tested
AI use
@DavidM1911 on GitHub · 2026-11-24 20:12 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. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodifiedmain.)Thanks!
@throny on GitHub · 2026-11-25 03:01 UTC · original
Two contributors checked independently and found that #1610 #1615 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.
@JJAutoCompare on GitHub · 2026-11-25 05:09 UTC · original
XCL PR #1593 — focused Windows verification
Tested head
f326446781d6336721899335af750aad4acb40c2. The detached worktree was clean before and after the run. The PR changes onlycrates/xcl/src/hle/xgameruntime/api.rs.Tested
dxc.exe --version. Rust 1.100.0 (0ef1bc386, x86_64-pc-windows-msvc). Unoptimized profiles with debug info and incremental compilation disabled.cargo build --workspacesucceeded.cargo test --workspace --no-runsucceeded and produced 19 test executables.cargo test -p xcl --lib xgameruntime -- --nocapturewithXCL_ADAPTER=NONE_CPU_ONLYreported 74 passed, 0 failed, 0 ignored, and 675 filtered out. The log (pr1593-focused.log) contains 0 lines beginning withSKIPPED. The 74 includes two tests that returned early because the system XGameRuntime DLL and a default Windows audio endpoint were absent.query_interface_answers_iunknown_with_one_identitytest passed. It obtained distinct XUser main and gamertag interface pointers, checked that queryingIID_IUnknownthrough either returnedS_OKand the main object pointer, and checked that an unsupported IID on the gamertag interface returnedE_NOINTERFACEwith a null output.Not tested
Only focused XGameRuntime tests and full workspace compilation were run. The full GPU workspace suite and retail-title smoke runs were omitted. The PC-runtime thunk path and Windows default-audio endpoint assertions were skipped as described above.
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
pr1593-focused.logand published.@Gruzzberry on GitHub · 2026-11-25 09:31 UTC · original
Thanks for the triage hint. On the overlap with #1610 and #1615:
crates/xcl/src/hle/xgameruntime/api.rs.QueryInterface(IID_IUnknown)returns the class's main object from every vtable, so all of an object's interfaces report one identity, as COM requires. #1615 answersIID_IUnknowntoo. #1610 also changes sibling-interface QI and forwarding aliases, which this PR leaves alone.I'm happy to go with whichever the maintainers prefer. If #1610's wider change is wanted, I can close this one, or rebase it to sit under #1610 as the identity part with its test.
AI use: drafted with Claude Code (Claude Opus 5.5) and posted by it at my request, after I reviewed it.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.