xgameruntime: gifting UI completes its block, speech without used, MountWithUi and TitleId gaps (RT-OFFLINE-GDK-SHIM-GAPS) #2520
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!2520
Loading…
Reference in a new issue
No description provided.
Delete branch "rt-offline-gdk-shim-gaps"
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?
Pull request successfully merged and closed
Package RT-OFFLINE-GDK-SHIM-GAPS: item 3 of @kevincommits' finding on #1608 (https://github.com/ProjectLeonida/mandy/issues/1608#issuecomment-7226429207). Thank you for the find. Claim: https://github.com/ProjectLeonida/mandy/issues/1608#issuecomment-7230865771.
What changes
xgameruntime_store.cpp, slot 82XStoreShowGiftingUIAsync.offline_failure_async<82, 5>, like the other 14 offline*Asyncslots (review M11). Its block is started and completed withE_FAIL, so a caller waiting on it gets an answer.storeContextHandle, storeId, name, extendedJsonData, async. Microsoft's own bindings in microsoft/XBOX-GDK-dotnet (Native.Store.cs) have this signature. xgameruntime-docs lists the slot but not its arguments.xgameruntime_offline.cpp,XSpeechSynthesizerGetStreamData.LEONIDA_LOCAL_SPEECH=1) is forwarded even whenusedis null.bufferUsedis_Out_opt_. Before, the call fell through and returnedE_INVALIDARG.env_is_one.xgameruntime_offline_set_host_speech, sets a fake host.xgameruntime.cpp,XPackageMountWithUiAsync.E_ACCESSDENIED, asXPackageMountrefuses it. Before, it completed withE_GAMEPACKAGE_NO_PACKAGE_IDENTIFIER.s_active_mounts. If the new run does not start, the earlier mount keeps its place.xgameruntime.cpp,XGameGetXboxTitleId. It skips a<TitleId>inside an XML comment, aspackage_localesalready does. The comment stripping is now one shared helper.Tests
New checks, following the repros:
xgameruntime_store_test: slot 82 with the block as the 5th argument starts and completes withE_FAIL, and slot 83 returnsE_FAIL.xgameruntime_offline_test, with a fake host accessibility object: a host stream's data is forwarded with and withoutused. With no host, a foreign stream is still refused.xgameruntime_test:ERROR_NOT_FOUND);E_ACCESSDENIED;<!-- <TitleId>DEADBEEF</TitleId> --><Game><TitleId>12345678</TitleId></Game>gives0x12345678.With main's logic, 5 of the new checks fail. The fake host needs the new hook, so for that check only the
&& usedcondition was put back. With the fix, all pass, andctest -R xgameruntimepasses 8/8.Profile M: RTX 4070 SUPER, Windows 11, Ryzen 7 9800X3D, MSVC RelWithDebInfo. CPU only. The full suite was not run because a boot was running.
git diff --checkandscripts/check_no_game_data.pyare clean. No open PR touches these functions. No game files used.AI-assisted (Claude Code).
🤖 Generated with Claude Code
Reviewed at head
c030bfd2eon Windows 11 (MSVC 202219.44).Verification
xgameruntime_test,xgameruntime_store_test,xgameruntime_offline_test,xgameruntime_user_test,xgameruntime_gamesave_test, andgta6rt.xgameruntime_test189,xgameruntime_store_test29,xgameruntime_offline_test77,xgameruntime_user_test46,xgameruntime_gamesave_test91).Finding (Request changes)
MountWithUiAsyncreuse can strand an unread prior mount handle (xgameruntime.cpp:1525-1550;third_party/xtaskqueue/Source/Task/AsyncLib.cpp:434-440,478-503):If a prior
MountWithUiAsynccompleted onasync(with its handle still unread ing_ui_mounts) and the caller reuses that completedXAsyncBlockwithqueue == nullptrwhen no default process task queue is set,AllocState()passes the active-signature check (AsyncLib.cpp:478), zeroesasync->internal, failsAllocStateNoCompletion()withE_NO_TASK_QUEUE, and writesinternal->status = E_NO_TASK_QUEUE(AsyncLib.cpp:500).pkg_mount_with_ui_asyncthen seesFAILED(hr)and restoresg_ui_mounts[async] = replaced(xgameruntime.cpp:1536). Because the block's prior completion state was already overwritten and the caller received a synchronous failure fromMountWithUiAsync, discardingasyncleavesreplacedstranded ing_ui_mountswithout closing it.Only restoring
replacedwhenhr == E_INVALIDARG(whereAllocState()rejected an in-flight block without touchinginternal), and closingreplacedon otherXAsyncRunfailures, keeps ownership consistent.Gifting slot 82 (
xgameruntime_store.cpp:495), optional nullusedin speech (xgameruntime_offline.cpp:759-766), and comment-skippingTitleIdlookup (xgameruntime.cpp:1645-1650) all look good.AI-assisted review + local MSVC verification.
#2520 | head c030bfd2ed973b36df9373d7a1e1df5b2d4c8fae (merged cleanly with main 09c153948386fd658fe2f999f6176efbaa8c8345) |
ctest --test-dir runtime/build -C RelWithDebInfo -R "^xgameruntime" --output-on-failure| red on main:xgameruntime_testfails (3 of 189 checks failed: reusedXAsyncBlockleaked the earlier mount handle, mounting the game's own package returnedE_GAMEPACKAGE_NO_PACKAGE_IDENTIFIERinstead ofE_ACCESSDENIED, and<TitleId>inside an XML comment was matched);xgameruntime_store_testfails (1 of 29:XStoreShowGiftingUIAsyncfailed synchronously instead of completingXAsyncBlock);xgameruntime_offline_testfails to link (LNK2019: missingxgameruntime_offline_set_host_speech; onmain,speech_stream_datarequired non-nullused) | green on PR+main:8/8CTests pass (xgameruntime189/189,xgameruntime_user,xgameruntime_gamesave91/91,xgameruntime_store29/29,xgameruntime_offline77/77,xgameruntime_offline_hdr77/77,xgameruntime_user_gamertag,xgameruntime_user_gamertag_long);check_no_game_data.py0violations | Windows 11, RTX 3090 (610.88), Vulkan SDK 1.4.363.1 | AI-assisted: yesVerified by OreoFR
c1ecf04ed+ PR headc030bfd2e; green run in a merge package of 2 PRs, no new ctest failure vs mainctest -R "^(xgameruntime|xgameruntime_store|xgameruntime_offline)$"AI-assisted (Claude Code, Claude Opus 5.5).
Run on PR head
c030bfd2e(based44285197, 1 commit; the base is old), checked against main1bc055e6c(and origin/mainc7753ed98):git merge-tree --write-treefinds no conflict with either.Environment: NVIDIA GeForce RTX 3090 (24 GB), driver 621.40, Windows 11 Pro (build 26300), MSVC 14.44 (VS 2022 Build Tools), Ninja, RelWithDebInfo, SDL3 3.4.20 static installed. CPU tests only.
Configure (as scripts/build_runtime.ps1 does, own build folder):
cmake -S runtime -B runtime/build -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLEONIDA_REQUIRE_VULKAN=ON. Only the test targets were built, not the whole runtime:cmake --build runtime/build -j 8 --target xgameruntime_test xgameruntime_store_test xgameruntime_offline_test xgameruntime_user_test xgameruntime_gamesave_test(the last two are not changed by the PR, built so the wholexgameruntimegroup runs).Green (PR head):
ctest -R "^xgameruntime" --output-on-failure-> 8/8 passed (xgameruntime,_user,_gamesave,_store,_offline,_offline_hdr,_user_gamertag,_user_gamertag_long).Red (behavioural: the PR's tests and the test hook
xgameruntime_offline_set_host_speechkept;xgameruntime.cppandxgameruntime_store.cppput back to based44285197; inxgameruntime_offline.cpponly the&& usedcondition ofspeech_stream_dataput back). Rebuiltxgameruntime_test xgameruntime_store_test xgameruntime_offline_test,ctest -R "^xgameruntime(_store|_offline|_offline_hdr)?$"-> 0/4 passed, 5 new checks fail:Red (literal revert of
xgameruntime_offline.cpptoo):xgameruntime_offline_testdoes not link (unresolvedxgameruntime_offline_set_host_speech), so for that one test the plain revert is only "the new hook is missing"; the run above is the behavioural red.Link check: merged into main 1bc055e6c, gta6rt.exe builds and links (RelWithDebInfo, MSVC 19.44); no new imports vs main.
Merged after enlight3d (Thib)'s red/green run (RUN, RTX 3090, driver 621.40, Windows 11: green with this PR, red without it, and
gta6rt.exestill links) and a re-check here: no conflict withmainf64162d0a, same head as run,no-game-datagreen, and the only ctest failures in the Windows/macOS CI jobs are tests this diff does not touch (known onmainor Vulkan: vk_xdxr_postbuild_readback vk_bindless_dimensions d3d12_compile_pool xbox_present ).AI-assisted (Claude Code, Claude Opus 5.5), merged for MoonEyes.