Repository navigation
xgameruntime: serve XGameRuntimeFeature and XSystemAnalytics offline through QueryApiImpl - #3476
Conversation
…iImpl XPersistentLocalStorageImpl (IXPersistentLocalStorageImpl3, slots 3-8), XGameRuntimeFeatureImpl (3), XGameEventImpl (3), XSystemAnalyticsImpl (3) and XDisplayImpl (IXDisplayImpl, 3-4). Interface ids, slots and argument counts are tools/gdk_runtime_calls.py's measurement of libHttpClient.GDK.dll; each slot is the function at that position of xgameruntime-docs' layout, and behaves as Microsoft's GDK reference page for it says. - Persistent local storage is <overlay>\.gta6rt-pls\, made on first use and hidden from GAME:\ listings; sizes count the terminator; a short buffer is E_FAIL (ERROR_INSUFFICIENT_BUFFER with device type Pc); space info reports the volume's free bytes and the folder's files; the space prompt completes with E_ABORT through XAsync; mounting another title's storage is FILE_NOT_FOUND with the handle cleared. - XGameRuntimeIsFeatureAvailable (bool) is true when the feature's class is served and the feature is documented for Windows: XDisplay, XStore and every unserved class are false. - XGameEventWrite accepts and logs (bounded); null required arguments are E_INVALIDARG. - XSystemGetAnalyticsInfo returns the named export's struct through the member-function return pointer. - XDisplayTryEnableHdrMode answers Disabled (SDR presentation) with the info zeroed; undocumented slot 3 is E_NOTIMPL. xgameruntime_test calls every slot as the thunks do (class id + measured interface id), with error paths and refused ids; file_system_test checks the storage folder stays out of GAME:\ listings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d#3471) Another contributor claimed XPersistentLocalStorageImpl first (RT-219, ItsNotRexed#3471), so this branch no longer serves it: its vtable, object and QueryApiImpl entry, its xgameruntime_test checks and its docs/runtime_imports.md row go, and file_system.cpp/.h, file_system_test.cpp and CMakeLists.txt are back to main's content (the .gta6rt-pls listing filter and the extra file_system.cpp in xgameruntime_test only served the storage class). XGameRuntimeFeatureImpl keeps the class id in its table, so XGameRuntimeIsFeatureAvailable(XPersistentLocalStorage) follows QueryApiImpl: false now, true once the class is served. The test checks it with the other features that follow their class. XGameRuntimeFeatureImpl, XGameEventImpl, XSystemAnalyticsImpl and XDisplayImpl are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Scope update in f7b10b9: I dropped |
|
Layout cross-check of f7b10b9 against the LGPL xgameruntime IDL (xodus-gaming/xgameruntime,
AI-assisted review (Claude Code). |
|
Correction to my comment above: your layout is the more trustworthy one, not the IDL's. I compared the two sources class by class. Where xgameruntime-docs marks a slot AI-assisted review (Claude Code). |
|
Needs a rebase: two hunks in runtime/shims/xgameruntime.cpp conflict with main — the class-list comment and QueryApiImpl, where main's object loop (which since 4c52ce2 includes g_persistent_storage) collided with your find_object() refactor. The resolution is small: keep find_object() and add g_persistent_storage to its list — resolving to the PR side alone would silently drop main's new XPersistentLocalStorageImpl service. Good news: your slot-3 feature test compares availability against QueryApiImpl dynamically, so it stays correct once PLS is in the list. One merge-order note: the docs and test comments credit tools/gdk_runtime_calls.py as the measurement source, but that tool currently exists only in #3455 — if that does not land first, the citation points at a file that is not in the tree. The four classes themselves read well: measured ids, per-slot behaviour documented, refusals for the unmeasured ones. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run). |
Conflicts in runtime/shims/xgameruntime.cpp, its test and docs/runtime_imports.md: - QueryApiImpl: find_object() stays and its list now has main's g_persistent_storage, package_object() and game_object(); query_served() adds the sibling files' query functions (user, gamesave, store, offline) after it, so no class main serves is dropped. - XGameEventImpl and XDisplayImpl are dropped from this branch: main now serves both in xgameruntime_offline.cpp (with LEONIDA_LOG_GAME_EVENTS and LEONIDA_HDR), and find_object() would have shadowed them. The branch keeps XGameRuntimeFeatureImpl and XSystemAnalyticsImpl. - XGameRuntimeIsFeatureAvailable asks class_served(), which goes through every file QueryApiImpl reaches: XPersistentLocalStorage, XGame, XGameSave, XGameUI, XPackage, XStore, XUser, XGameEvent and XGameStreaming are now true; XDisplay stays false (console-only); the test pins both and still compares every feature with QueryApiImpl. - The feature table's ids for classes xgameruntime.cpp has no object for are named k...ClassId, so tools/gdk_runtime_calls.py (which counts each `constexpr GUID k...Class`) doesn't report XLauncherImpl and the like as served; test_gdk_runtime_calls checks it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested 91d8edb on NVIDIA GeForce RTX 4080, driver 617.42, Windows 11 (clang-cl cross-build): xgameruntime_test exits 0 with "xgameruntime_test: OK (136 checks)" (the PR body says 130) and file_system_test exits 0 with "159 check(s), 0 failure(s)". tests/test_gdk_runtime_calls.py and the gdk_runtime_calls measurement tool were not run. AI-assisted. |
|
Merged upstream/main in 91d8edb (a merge commit, no force-push). As suggested,
Tests: Thanks @Dom-in for the IDL cross-check. Nothing from it needed applying: the two remaining classes agree with the IDL at slot 3, and main's (AI-assisted.) |
…est_docs_cli_flags FORK.md: boot-prep is upstream main 3faac55 + ItsNotRexed#2861, ItsNotRexed#1895, fork/first-boot and gdk-offline-classes (ItsNotRexed#3476, after its merge of main). ItsNotRexed#2218, ItsNotRexed#2784, ItsNotRexed#2594, ItsNotRexed#2839, ItsNotRexed#2954, ItsNotRexed#2957, ItsNotRexed#2750, ItsNotRexed#2833 and our ItsNotRexed#3455 are upstream now; fork/first-boot and gdk-runtime-calls are gone, so the fork-only files are carried as a patch when boot-prep is rebuilt. gta6rt now seeds its VkPipelineCache from the pipeline_cache.bin beside it when the header matches the device. tests/test_docs_cli_flags.py failed on boot-prep only: FORK.md, merged from fork/first-boot, quotes git commands, and the test wants every --flag in a Markdown page to appear in a source file. git's flags join FOREIGN, next to gh's and pip's (fork-only line). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
shayderrr
left a comment
There was a problem hiding this comment.
Review
Reviewed change in PR #3476: xgameruntime: serve XGameRuntimeFeature and XSystemAnalytics offline through QueryApiImpl.
Scope: docs/runtime_imports.md, runtime/shims/xgameruntime.cpp, runtime/test/xgameruntime_test.cpp, +1 more
Diff: +277 / -16 across 4 file(s).
The change stays inside the stated scope and the touched files line up with the description. No unrelated production paths are pulled in, and the stated behavior is directly exercised by the diff. I'm approving this one.
Reviewed by shayderrr via automated batch review.
|
Thanks @seblessa - I went through xgameruntime: serve XGameRuntimeFeature and XSystemAnalytics offline through QueryApiImpl and the diff around |
Claimed in the coordination issue as: #3381 (comment)
What and why
A title linked with
xgameruntime.libreaches the GDK only throughQueryApiImpland one vtable slot per function (docs/runtime_imports.md, "Run-time loaded modules").runtime/shims/xgameruntime.cppserves threading, errors, networking, system and package; any other class is refused with0x80070032, so the title takes its failure path. This adds five more classes a title is likely to touch at boot, none of them claimed elsewhere (XUser, XGameSave, XGame and XStore are left alone; XStore on purpose: no licence answers).Each slot's position and argument shape was checked against
libHttpClient.GDK.dll's statically linked thunks (class id inrcx, interface id inrdx, slot from the vtable call; measured withtools/gdk_runtime_calls.py, #3455, read-only on the retail package, nothing from it in the commit). The order follows xodus-gaming/xgameruntime-docs (GPL-3.0, facts only), and the semantics and return types follow Microsoft's public GDK reference pages, cited per method in the code. The measured argument counts match the documented signatures for every slot.XPersistentLocalStorageImpl(IXPersistentLocalStorageImpl3)<overlay>\.gta6rt-pls\, created on first use and hidden fromGAME:\listings like the overlay's marker folder (small change infile_system.cpp/.h), never inside the package. A short buffer returnsE_FAIL, as documented. Space info reports the volume's free bytes and the folder's used bytes. The space prompt completes withE_ABORT. Mounting another package's storage returnsFILE_NOT_FOUNDand clears the handleXGameRuntimeFeatureImplbool: true only for features whose class this runtime serves and that Microsoft documents as available on Windows;XDisplayandXStoreanswer falseXGameEventImplE_INVALIDARGXSystemAnalyticsImplXSystemGetAnalyticsInfoexport returns (the thunk's one argument is the hidden return-struct pointer, checked in its code)XDisplayImpl(IXDisplayImpl)Disabled(the runtime presents SDR) with the info struct zeroed; slot 3 is undocumented and returnsE_NOTIMPLEach object answers
QueryInterfacefor its class id and every interface id of its chain, through theinterface_idslistRuntimeObjectalready has.docs/runtime_imports.mdgets a row per class.Not included, because they would be guesswork today:
XGameStreamingImpl(four of its slots are called through an interface id the docs don't list),XAccessibilityImpl,XLauncherImpl,XUserDeviceImpl(it depends onXUserImpl).Tested
Windows 11 Pro (26300), VS 2022 Build Tools 17.14, Vulkan SDK 1.4.363; AMD Radeon iGPU (RDNA2, driver 25.10.36) as the default Vulkan device.
xgameruntime_test: 130 checks. Every new slot is called throughQueryApiImplexactly as a thunk does (class id plus the measured interface id), with outputs, error paths and the refusal of unknown ids.ctest: 132 of 132 passed (the tests that need game files skip;gameinputis disabled without SDL3 in that build).AI-assisted: written and tested with Claude Code.
Checklist
docs/design.md, with how it was confirmed. (n/a: no translator change.)🤖 Generated with Claude Code