HLE: implement IUnknown::QueryInterface and unit tests for xgame objects #1174

Open
geiyiliyabumo wants to merge 1 commit from upstream-pr/1174 into main
geiyiliyabumo commented 2026-11-24 16:19:40 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by geiyiliyabumo on 2026-11-24T16:19:40Z.


Summary

Closes #901

Full verification details and change notes are documented in #901 (commit 299bc17, based on main ffe310e).

 crates/victory-hle/src/modules/xgame.rs | 189 ++++++++++++++++++++++++++++----
 1 file changed, 170 insertions(+), 19 deletions(-)

Verification (Windows 11 x64 MSVC)

  • rustfmt --edition 2024 --check on edited files: PASS
  • cargo xtask policy: PASS (zero game files/data)
  • cargo clippy --all-targets --locked -- -D warnings (default + --features diagnostics where applicable): PASS
  • Targeted & crate unit/GPU tests: PASS

AI-assisted; synthetic tests only, no game files.

<!-- greyfinch-sync:Marvisak/VIctory:issue:5476030832 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1174). Originally posted by [geiyiliyabumo](https://github.com/geiyiliyabumo) on 2026-11-24T16:19:40Z. --- ### Summary Closes #901 Full verification details and change notes are documented in #901 (commit `299bc17`, based on `main` `ffe310e`). ```text crates/victory-hle/src/modules/xgame.rs | 189 ++++++++++++++++++++++++++++---- 1 file changed, 170 insertions(+), 19 deletions(-) ``` ### Verification (Windows 11 x64 MSVC) - `rustfmt --edition 2024 --check` on edited files: **PASS** - `cargo xtask policy`: **PASS** (zero game files/data) - `cargo clippy --all-targets --locked -- -D warnings` (default + `--features diagnostics` where applicable): **PASS** - Targeted & crate unit/GPU tests: **PASS** *AI-assisted; synthetic tests only, no game files.*
Zipettte commented 2026-11-24 18:06:11 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Zipettte on 2026-11-24T18:00:48Z.


Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 299bc17: cargo test -p victory-hle passes, 99 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).

Tested with AI assistance (Claude).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7140029558 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1174#issuecomment-7140029558). Originally posted by [Zipettte](https://github.com/Zipettte) on 2026-11-24T18:00:48Z. --- Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 299bc17: `cargo test -p victory-hle` passes, 99 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed). _Tested with AI assistance (Claude)._
Marvisak commented 2026-11-25 02:05:50 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T01:17:55Z.


Automated triage for the maintainers.

Thanks for the rebase. query_interface in crates/victory-hle/src/modules/xgame.rs follows the standard IUnknown contract: IUnknown and each object's own IID give S_OK, anything else gives E_NOINTERFACE, and a null out or iid gives E_POINTER. It replaces the missing::<0> stubs. Two things keep it from being a merge candidate:

  • Nothing shows that the title calls QueryInterface on these four objects. A run log with the method not implemented warning for slot 0x0 of one of them would show that this fixes a real call. Without it, the change is speculative.
  • The diff also reformats unrelated code (launch_new_game and the a_relaunch_keeps_our_options arrays). Please drop that, so the PR only touches what it changes.

The extra tests for title_id, invites and events assert what main already does, which is fine to keep. CI is passing.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7149404796 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1174#issuecomment-7149404796). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T01:17:55Z. --- <!-- victory-triage v1 head=e85ef4f98887729ef165fd0371d0353e7931d0b5 verdict=needs-work at=2026-11-25T02:20:29Z --> Automated triage for the maintainers. Thanks for the rebase. `query_interface` in `crates/victory-hle/src/modules/xgame.rs` follows the standard IUnknown contract: `IUnknown` and each object's own IID give `S_OK`, anything else gives `E_NOINTERFACE`, and a null `out` or `iid` gives `E_POINTER`. It replaces the `missing::<0>` stubs. Two things keep it from being a merge candidate: - Nothing shows that the title calls `QueryInterface` on these four objects. A run log with the `method not implemented` warning for slot 0x0 of one of them would show that this fixes a real call. Without it, the change is speculative. - The diff also reformats unrelated code (`launch_new_game` and the `a_relaunch_keeps_our_options` arrays). Please drop that, so the PR only touches what it changes. The extra tests for `title_id`, invites and events assert what main already does, which is fine to keep. CI is passing. --- _Generated by [Claude Code](https://claude.ai/code)_
geiyiliyabumo commented 2026-11-25 03:03:19 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by geiyiliyabumo on 2026-11-25T02:07:33Z.


Rebased cleanly onto \main\ (\ccfb029). \cargo test -p victory-hle --locked, \cargo clippy -p victory-hle --all-targets --locked -- -D warnings, and \cargo xtask policy\ all pass.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7150346637 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1174#issuecomment-7150346637). Originally posted by [geiyiliyabumo](https://github.com/geiyiliyabumo) on 2026-11-25T02:07:33Z. --- Rebased cleanly onto \main\ (\ccfb029\). \cargo test -p victory-hle --locked\, \cargo clippy -p victory-hle --all-targets --locked -- -D warnings\, and \cargo xtask policy\ all pass.
cloph-dsp commented 2026-11-27 13:56:17 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-27T13:56:17Z.


Independent CPU-only verification on Windows / Rust 1.100.0 / MSVC.

  • PR head: e85ef4f98887729ef165fd0371d0353e7931d0b5, merge base ccfb02996eac831853e8324156f123eeff083e9d.
  • Command: cargo test --locked -p victory-hle --lib -- modules::xgame::tests::query_interface_supports_unknown_and_each_own_interface --exact --test-threads=1 --quiet
  • Result: test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 146 filtered out, exit 0.
  • Negative control: git grep -F -c modules::xgame::tests::query_interface_supports_unknown_and_each_own_interface ccfb0299 -- . → exit 1 / 0 hits (test genuinely new).
  • git diff --check ccfb0299 HEAD → exit 0.
  • Caveat: only the named synthetic QueryInterface test was replayed; no real title/game interaction and no full crate suite.
  • GPU/driver: N/A (CPU-only test). No game data, assets, extracted shaders or DRM involved.
  • AI-assisted: Hy4 flash.
<!-- greyfinch-sync:Marvisak/VIctory:comment:7220128405 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1174#issuecomment-7220128405). Originally posted by [cloph-dsp](https://github.com/cloph-dsp) on 2026-11-27T13:56:17Z. --- Independent CPU-only verification on Windows / Rust 1.100.0 / MSVC. - PR head: `e85ef4f98887729ef165fd0371d0353e7931d0b5`, merge base `ccfb02996eac831853e8324156f123eeff083e9d`. - Command: `cargo test --locked -p victory-hle --lib -- modules::xgame::tests::query_interface_supports_unknown_and_each_own_interface --exact --test-threads=1 --quiet` - Result: `test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 146 filtered out`, exit 0. - Negative control: `git grep -F -c modules::xgame::tests::query_interface_supports_unknown_and_each_own_interface ccfb0299 -- .` → exit 1 / 0 hits (test genuinely new). - `git diff --check ccfb0299 HEAD` → exit 0. - Caveat: only the named synthetic QueryInterface test was replayed; no real title/game interaction and no full crate suite. - GPU/driver: N/A (CPU-only test). No game data, assets, extracted shaders or DRM involved. - AI-assisted: Hy4 flash.
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/1174:upstream-pr/1174'
git switch 'upstream-pr/1174'

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