tests: call the saved QueryApiImpl through load_real_query() #2204

Manually merged
github merged 1 commit from gh-pr/2204/head into gh-pr/2204/base 2026-11-27 00:05:28 +00:00
Owner

@⁠MasterDomino on GitHub · 2026-11-25 04:37 UTC · original
MasterDomino:tests/atomic-query-call → main · +2 −2 · 2 files · 1 commits · merged 2026-11-25 04:43 UTC

What

tests/startup_gamesave_read_async.cpp and tests/startup_gamesave_submit.cpp now call the saved QueryApiImpl through load_real_query() instead of calling real_query directly.

Why

#2166 made real_query a std::atomic<QueryApi> in src/startup_stubs/runtime_proxy.cpp. Calling an atomic function pointer directly is ambiguous on MSVC 19.44 (Visual Studio 2022 17.14). Both the volatile and the non-volatile conversion operators of std::atomic are candidates, so the release build of current main stops with:

tests\startup_gamesave_read_async.cpp(231): error C3066: call to an object of this type is ambiguous
tests\startup_gamesave_submit.cpp(106): error C3066: call to an object of this type is ambiguous

load_real_query() is the acquire load that the proxy already uses for every other call. Behaviour is unchanged.

Tests

Windows 11 build 26300, MSVC 19.44.35221, release preset. Base: main at 19e04be9.

cmake --build --preset release --target startup_gamesave_read_async startup_gamesave_submit
ctest --preset release --no-tests=error -R '^startup_gamesave_(read_async|submit)' --output-on-failure
  • Before: the build fails with the two C3066 errors above.
  • After: both targets build, and 4 of 4 tests pass: startup_gamesave_submit_{controlled,system} and startup_gamesave_read_async_{controlled,system}. The system cases ran against the installed gaming runtime (Gaming Services 39.118.30001.0) and were not skipped.

Refs #2166

🤖 Generated with Claude Code

**@⁠MasterDomino** on GitHub · 2026-11-25 04:37 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2204) `MasterDomino:tests/atomic-query-call` → `main` · +2 −2 · 2 files · 1 commits · merged 2026-11-25 04:43 UTC ## What `tests/startup_gamesave_read_async.cpp` and `tests/startup_gamesave_submit.cpp` now call the saved `QueryApiImpl` through `load_real_query()` instead of calling `real_query` directly. ## Why #2166 made `real_query` a `std::atomic<QueryApi>` in `src/startup_stubs/runtime_proxy.cpp`. Calling an atomic function pointer directly is ambiguous on MSVC 19.44 (Visual Studio 2022 17.14). Both the `volatile` and the non-`volatile` conversion operators of `std::atomic` are candidates, so the release build of current `main` stops with: ``` tests\startup_gamesave_read_async.cpp(231): error C3066: call to an object of this type is ambiguous tests\startup_gamesave_submit.cpp(106): error C3066: call to an object of this type is ambiguous ``` `load_real_query()` is the acquire load that the proxy already uses for every other call. Behaviour is unchanged. ## Tests Windows 11 build 26300, MSVC 19.44.35221, `release` preset. Base: `main` at `19e04be9`. ```powershell cmake --build --preset release --target startup_gamesave_read_async startup_gamesave_submit ctest --preset release --no-tests=error -R '^startup_gamesave_(read_async|submit)' --output-on-failure ``` - **Before:** the build fails with the two C3066 errors above. - **After:** both targets build, and 4 of 4 tests pass: `startup_gamesave_submit_{controlled,system}` and `startup_gamesave_read_async_{controlled,system}`. The system cases ran against the installed gaming runtime (Gaming Services 39.118.30001.0) and were not skipped. Refs #2166 🤖 Generated with [Claude Code](https://claude.com/claude-code)
#2166 made real_query a std::atomic<QueryApi>. The two game-save
system cases still called it directly, and MSVC 19.44 (VS 2022 17.14)
rejects that call: the volatile and non-volatile conversion operators
of std::atomic are both candidates, so the release build stops with
C3066 "call to an object of this type is ambiguous" in
startup_gamesave_read_async.cpp and startup_gamesave_submit.cpp.

Call through load_real_query(), the acquire load the runtime proxy
already uses for every other call. Behaviour is unchanged.

Refs #2166

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 00:05:27 +00:00
github manually merged commit 1d82ff22ce into gh-pr/2204/base 2026-11-27 00:05:28 +00:00
Author
Owner

@⁠tedin7 on GitHub · 2026-11-25 04:43 UTC · original · reviewed

Review of head 1d82ff22ce8bfec7343b6459169801316c1514c4: 0 P1, 0 P2.

  • real_query is std::atomic<QueryApi>. Calling it directly is ambiguous on MSVC (C3066). load_real_query() is the acquire load already used by the proxy, so behaviour is unchanged and the two edits match the sibling call sites.
  • No other open PR touches these lines.

Commands executed locally:

  • python3 tests/docs_links_check.py: pass (405 links)
  • python3 tests/bidi_controls_check.py: pass
  • git diff --check origin/main...HEAD: clean
  • Windows Server 2025, dev and release /O2: x2w_pipe.py win2025 2204 --scope direct --targets startup_gamesave_submit,startup_gamesave_read_async --regex '^startup_gamesave_(read_async|submit)_': both builds PASS, controlled tests pass. The _system variants skip (capability skip, not counted as a pass).
  • Mutation: restored the direct real_query(...) call in tests/startup_gamesave_submit.cpp and ran the same target on Windows: build fails with error C3066: call to an object of this type is ambiguous. Reverted.
  • CI Build and test on Windows: pass.

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-25 04:43 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2204#pullrequestreview-6051969857) · **reviewed** Review of head `1d82ff22ce8bfec7343b6459169801316c1514c4`: 0 P1, 0 P2. - `real_query` is `std::atomic<QueryApi>`. Calling it directly is ambiguous on MSVC (C3066). `load_real_query()` is the acquire load already used by the proxy, so behaviour is unchanged and the two edits match the sibling call sites. - No other open PR touches these lines. Commands executed locally: - `python3 tests/docs_links_check.py`: pass (405 links) - `python3 tests/bidi_controls_check.py`: pass - `git diff --check origin/main...HEAD`: clean - Windows Server 2025, dev and release /O2: `x2w_pipe.py win2025 2204 --scope direct --targets startup_gamesave_submit,startup_gamesave_read_async --regex '^startup_gamesave_(read_async|submit)_'`: both builds PASS, controlled tests pass. The `_system` variants skip (capability skip, not counted as a pass). - Mutation: restored the direct `real_query(...)` call in `tests/startup_gamesave_submit.cpp` and ran the same target on Windows: build fails with `error C3066: call to an object of this type is ambiguous`. Reverted. - CI `Build and test on Windows`: pass. AI-assisted; commands listed were executed locally.
This discussion has been locked. Commenting is limited to contributors.
No description provided.