- rdna2spirv: declare each packed vertex input register once; a register whose elements disagree on the component
type is refused (SHADER-644).
- runtime: a title's VirtualAlloc drops the console's MEM_GRAPHICS / MEM_TITLE type bits the host rejects (RT-217).
- runtime: XPersistentLocalStorageImpl is served from <overlay>\persistent with the package's 2048 MB quota
(RT-219; layout from the public docs, not measured in a caller).
- runtime: G:\ names the package and T:\ a scratch folder in the overlay; paths under the configured folders and
every path with no folders configured stay host paths (RT-218).
- winhttp_offline: header blocks and timeouts the host WinHTTP rejects are rejected the same way.
- cfg_structure.run: a limit of zero or less runs no blocks.
- shader_meta: an s_movk_i32 with a register operand and a float immediate beyond float32 are left unknown instead
of raising.
Each comes with a test that fails on the old code. Conflicts with main resolved here (internal_dir() hides T:'s
folder; both file_system_test blocks kept).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
IXGameImpl3 : IXGameImpl2 : IXGameImpl (xgameruntime include/xgame.idl), slots
3-5: XGameGetXboxTitleId gives MicrosoftGame.Config's <TitleId> (E_FAIL without
one, E_INVALIDARG for a null pointer), void XLaunchNewGame is logged and
returns, XLaunchRestartOnCrash succeeds with nothing registered. A retail Gen9
title asks QueryApiImpl for this class (Freminet/ScarlettX's observation).
The config reader is shared with XPackageGetUserLocale. The two tests that used
XGameImpl's id as their example of an unserved class now use XGameSaveImpl's.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GetEnvironmentVariableA narrowed a game folder named outside the ANSI code page
(e.g. a runic or CJK character on cp1252), so the package locale lookup missed
its MicrosoftGame.Config. Read the variable and open the file wide. The test
uses U+16A0, which no ANSI code page has (it fails with the narrow read).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
93e65132 added the IXSystemImpl5 inheritance check with a `bool all`,
which hides the `bool all` of the GetProcAddress check at line 188;
MSVC reports C4456 at line 400. The inner flag is now all_inherited.
No behaviour change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review (@Flyander):
- slot 7 is void XPackageGetInstallationProgress(monitor,
XPackageInstallationProgress*): it now writes an installed, launchable,
completed package instead of an HRESULT stub ignoring its output.
- slots 8, 10, 22, 34 are bool methods (UpdateInstallationMonitor, the two
Unregister* calls, UninstallPackage); E_NOTIMPL read as true. They return
false / true / true / false, as documented for nothing to do offline.
- XPackageGetUserLocale returns the package-declared locale closest to the
user's (MicrosoftGame.Config <Resource Language>, from LEONIDA_GAME_DIR or
--game-dir), never the host locale; with none declared it succeeds
without writing, as Microsoft documents.
- QueryInterface answers IXPackageImpl and IXPackageImpl2 too (the IDL
chain IXPackageImpl3 : IXPackageImpl2 : IXPackageImpl).
And @Ingenioeren's finding: XPackageGetMountPath uses gta6rt's --game-dir
(rt::fs::game_dir()) after LEONIDA_GAME_DIR, before the launcher folder.
xgameruntime_test links file_system.cpp; +6 checks (88).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
libHttpClient.GDK.dll asks QueryApiImpl for XPackageImpl with IXPackageImpl3's
id through 30 thunks (slots 3-19, 22, 24-27, 30, 32-34, 37-40), each in
the argument shape of the method at that position of xgameruntime-docs'
IXPackageImpl (3-34), IXPackageImpl2 (35-38) and IXPackageImpl3 (39-40)
lists, e.g. 10 (monitor, token, bool), 14 (id, count, selectors), 24-26
the mount path trio, 39 (kind, scope, context, callback).
Slots with an offline answer forward to the XPackage functions already
on main, so the vtable and the named exports agree: 3 the package
identifier, 4 packaged process, 25 the mount path; plus 11 the host user's
locale, 24 the mount path size (exactly what 25 needs) and 26 closing a
mount (nothing to release). Every other slot logs its number once and
returns E_NOTIMPL, so the first boot lists what the title needs.
xgameruntime_test +6 (80): the IXPackageImpl3 id, 3 and 4 equal the
exports, the locale and its short-buffer error, 24/25 sizes, 5/40 stubs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Slot 8 is the private XAsyncBeginAlloc: no public page, never called by the package's DLLs, signature not measured.
The generic private slot answered 0, so a caller got S_OK for an async call whose provider never received
XAsyncOp::Begin and whose completion never arrives. It now returns E_NOTIMPL and logs once.
Test: xgameruntime_test calls slot 8 with a provider that counts XAsyncOp::Begin and requires either a failure or one
Begin. Fails on ec8ec4c9 (S_OK, 0 Begin), passes with the change; the mutant answering S_OK is caught.
AI-assisted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- tests/semantic: BaseVertex/BaseInstance read 0 in the wave interpreter; the LDS MockGens follow
SHADER-309 (lds_bound, lds_access, lds_atomic); abs emission tests load their operand, since
SHADER-315 folds scalar ALU on constants.
- test_translate: the dynamic gather sampler is a loaded word, not s16 + 0 (SHADER-315 folds it).
- test_world_build: DDS downscale weights colours by alpha (62804d0d).
- test_fspx_shaders_stage: the fake disassembler writes the listing make_game now checks.
- xgameruntime_test: re-read the package id after clearing the LEONIDA_PACKAGE_ID override.
- docs: one row per topic again in design.md (72 topics) and README.md; one Other languages line;
embedded_shaders.md keeps one copy of each bullet; animation.md links the heading anchor.
- tools/scripts: character_textures uses report_paths.same_report_path; stdout guard on six programs;
LF write in vs_input_survey; the cl.exe fallback compiles winhttp_offline.cpp.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review (@Flyander):
- QueryInterface accepted the class id and IXSystemImpl5 only. The IDL
chain is IXSystemImpl5 : IXSystemImpl4 : IXSystemImpl3 : IXSystemImpl2 :
IXSystemImpl (xgameruntime include/xsystem.idl), so every one of them is
served by the same vtable. RuntimeObject now carries a null-terminated
list of interface ids instead of one newer id (XNetworkingImpl's list is
IXNetworkingImpl2).
- XSystemGetXboxLiveSandboxId requires sandboxIdSize >=
XSystemXboxLiveSandboxIdMaxBytes (16); buffers of 7-15 bytes returned
S_OK. copy_id takes the API minimum.
Tests: a 15-byte sandbox buffer is refused, 16 accepted; all five
IXSystemImpl ids give the same object.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
XCurl.dll reads HKLM\Microsoft\GamingServices ServiceRetryTimeout, then
LoadLibraryExW(L"gameplatformservices.dll", nullptr,
LOAD_LIBRARY_SEARCH_SYSTEM32) and GetProcAddress'es GetApiVersionImpl and
QueryApiImpl (disassembled, no code run). The shims didn't own that module,
so the load went to the host: on a PC with Gaming Services it would reach
the real PC runtime's QueryApiImpl and bypass the offline classes; without
it XCurl returns 0x87E00196. Either way the result depended on what the
player has installed.
The shim table now serves gameplatformservices.dll!QueryApiImpl (the
offline one) and GetApiVersionImpl(uint64_t*, uint64_t*), measured at its
call site (two pointers to 64-bit locals, result unread; XCurl compares the
pair with the last one it saw), writing the same two values every call.
owns_dll() follows from the table, so library_loader answers the load.
xgameruntime_test: the LoadLibraryExW(..., SEARCH_SYSTEM32) load, the
versions and the shared QueryApiImpl (+3, 65). docs/runtime_imports.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Checked against Microsoft's reference pages: bool XSystemIsHandleValid(
XSystemHandle) and void XSystemAllowFullDownloadBandwidth(bool). Slot 7
returned an HRESULT, so S_OK (0) read as "not valid" to a conforming
caller. The test calls both with the documented types.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
libHttpClient.GDK.dll asks QueryApiImpl for XSystemImpl with IXSystemImpl5's
interface id and calls slots 3-8 (thunks disassembled, no code run): three
(size, buffer, used) id queries, then two pointers, one pointer and a bool:
xgameruntime-docs' IXSystemImpl list (console id, Xbox Live sandbox id,
app-specific device id), IXSystemImpl3's (XSystemHandleTrack,
XSystemIsHandleValid) and IXSystemImpl4's (XSystemAllowFullDownloadBandwidth),
IXSystemImpl2 and 5 adding no known method.
Offline answers: the existing 39-byte console-id placeholder, sandbox
RETAIL, a 45-byte app-specific device-id placeholder (short buffers get
ERROR_INSUFFICIENT_BUFFER, null E_INVALIDARG), handle tracking accepted and
never called back, a non-null handle valid, bandwidth S_OK.
docs/runtime_imports.md: libHttpClient calls five classes through thunks
(not only an id table, as the table said): their slot ranges, with the
XSystemImpl and XPackageImpl rows. xgameruntime_test +5 checks (74).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review (@Flyander): XNetworkingQuerySecurityInformationForUrl[Utf16]AsyncResult
is (XAsyncBlock*, size_t bufferByteCount, size_t* bufferByteCountUsed,
uint8_t* buffer, XNetworkingSecurityInformation** information); slots 10 and 13
had the last three as buffer, information, used, so a conforming caller got
nullptr written into its buffer and its used count left unset.
xgameruntime_test: both slots with a sentinel buffer and distinct outputs;
the buffer stays untouched, used and information are zeroed in place (both
checks fail with the old order).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
XCurl.dll asks QueryApiImpl for XNetworkingImpl with IXNetworkingImpl2's
interface id and calls slots 11-17 (measured with the #1877 thunk
disassembly, docs/runtime_imports.md): the UTF-16 URL security-information
async trio, the server certificate check, the connectivity hint and its
change registration. QueryApiImpl refused the class, so each of those
calls failed with class-not-provided.
The class answers as a console without a network: the connectivity hint is
initialized with level None; the preferred-port and URL security-info
queries fail with HRESULT_FROM_WIN32(ERROR_NETWORK_UNREACHABLE), the *Async
ones by completing their XAsyncBlock with it through XAsyncRun; the
certificate check fails the same way; change registrations return tokens
whose callbacks never fire; IXNetworkingImpl2's three additions are
E_NOTIMPL. RuntimeObject gains an optional newer interface id so
QueryInterface answers IXNetworkingImpl2 too.
xgameruntime_test (+8 checks, 69): both interface ids, the hint, the async
call completing with no network and its result size, the certificate
check, register/unregister, the port query and slot 20. tiny_gdk_load's
refused-class check uses an id no class has.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Handle IXNetworkingImpl2 query for class {37e56907-2f10-41e8-b72f-36edb185331a}.
- Return offline answers matching console behavior without network:
* Connectivity hint: networkInitialized=true, level=None (1), cost=Unknown (0).
* Port query and URL security queries fail with ERROR_NETWORK_UNREACHABLE.
* Async queries complete through XAsync with ERROR_NETWORK_UNREACHABLE.
* Correct ABI parameter order for AsyncResult:
(async, bufferByteCount, bufferByteCountUsed*, buffer*, information**).
* VerifyServerCertificate fails offline with ERROR_NETWORK_UNREACHABLE.
* Registration tokens are tracked without firing offline.
* IXNetworkingImpl2 extension methods return E_NOTIMPL.
- Update docs and tests in xgameruntime_test and tiny_gdk_load.
#1877's IXErrorImpl slot 3 returned void, but xgameruntime-docs gives
HRESULT WINAPI XErrorReport(HRESULT status, const char* message), so a
caller that checks the result read whatever was left in rax. It now returns
S_OK after reporting. Slot 5 matches Microsoft's void XErrorSetOptions(
XErrorOptions, XErrorOptions) instead of returning an HRESULT nobody reads
(XErrorSetCallback was already void). The test checks slot 3's S_OK.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A GDK title reaches XTaskQueue/XAsync/XThread/XError through
xgameruntime.lib thunks, not named imports: QueryApiImpl(class, class),
one vtable slot with `this` first, then Release. QueryApiImpl refused
every class, so none of those calls could work.
The slot order is xgameruntime-docs' Layout list after IUnknown, and is
measured: the thunks linked into the package's libHttpClient.GDK.dll and
XCurl.dll (disassembled, not run) call IXThreadingImpl slots 3-7 and 9-30
and IXErrorImpl slot 3, each with the argument shape of the documented
function at that position (docs/runtime_imports.md, "Class layouts,
measured").
- XThreadingImpl: 28 slots forwarded to third_party/xtaskqueue (the same
code the named exports use), a per-thread time-sensitive flag, and the
two private slots (XAsyncBeginAlloc, XTaskQueueIsEmpty) logged once.
- XErrorImpl: XErrorReport (the docs' "_unknown_" slot; HRESULT + string)
logs and calls the XErrorSetCallback callback; XErrorSetOptions is S_OK.
- Process-wide singletons; QueryInterface answers IUnknown and the class.
- xgameruntime_test drives both slot by slot; tiny_gdk_load (under
gta6rt --run) creates and closes a queue through slots 12 and 17.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The package's GDK modules don't import xgameruntime.dll. libHttpClient.GDK.dll and XCurl.dll have no import
entry for it, but both carry the wide string "xgameruntime.dll" and the names InitializeApiImpl[Ex|Ex2],
QueryApiImpl and UninitializeApiImpl next to a statically linked XGameRuntimeInitialize: xgameruntime.lib's
thunks LoadLibraryW the runtime and GetProcAddress those names. Bound to the host, that bypasses the offline
shim. The executable is very likely built the same way.
- library_loader.cpp: LoadLibrary*/GetModuleHandle*/GetProcAddress/FreeLibrary for kernel32, kernelbase and the
api-ms-win-core-libraryloader sets. A module the registry owns (rt::shims::owns_dll) gets a pseudo-handle and
GetProcAddress resolves through the registry; an unserved name is NULL with ERROR_PROC_NOT_FOUND. Every other
module goes to the host.
- xgameruntime.cpp: the five entry points, with the signatures and the unknown-class error documented by
xodus-gaming/xgameruntime-docs (GPL-3.0, facts only). QueryApiImpl logs the class and interface ids and refuses
them, so the first boot with the executable names the COM interfaces to implement.
- xgameruntime_test drives the path through XCurl.dll's api-set binding; docs/runtime_imports.md records the
measurement and the new dry-run counts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every GDK title calls XGameRuntimeInitialize first and builds its async work on
XTaskQueue/XAsync. Add an xgameruntime.dll shim table for those, ahead of the
executable: XGameRuntimeInitialize/Uninitialize (reference counted),
XSystemGetDeviceType (Series X; LEONIDA_DEVICE_TYPE overrides) and
XSystemGetConsoleId (placeholder), plus the 23 XTaskQueue/XAsync functions.
XTaskQueue/XAsync come from microsoft/libHttpClient (MIT), copied unmodified
into third_party/xtaskqueue (task queue only, no HTTP stack); a small pch.h
stand-in lets them build alone. xgameruntime_test drives the table through
the shim registry the way a title boots. Nothing goes online.