runtime: add XUser and XGameSave contracts #1062
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1069"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-24T00:14:10Z.
Change
Make the XUser and XGameSave representative calls observable in the fixture-only XGameRuntime
shim.
stub,implemented_hrandimplemented_void. Stubs keep the bounded log andE_NOTIMPL; implemented entries returntheir result and record a deterministic success entry.
XUserFindUserById,XUserGetId,XUserDuplicateHandleandXUserCloseHandlewith the fixed synthetic XUID0x0009000000000001.blobs, then
XGameSaveSubmitBlobWrite,XGameSaveSubmitUpdateandXGameSaveReadBlobDatawith their close paths. It does not persist to disk or sync with Xbox.handle for the same named container sees the same blobs, and reopening it after closing both
handles still reads the committed data. Independent names on one provider stay isolated.
by another container, submitting the old update returns
E_GS_HANDLE_EXPIRED(
0x8083000D) and leaves the new container unchanged.XUserAddAsyncandXGameSaveInitializeProviderAsyncremain named, logged stubs: thepublic
XAsyncBlock, result structures and queue/callback semantics are not available withouta GDK header, so they are not simulated.
tests/xgameruntime_contracts_check.cppis the synthetic title. It calls XUser andXGameSave, checks exact values and asserts the log contains no
E_NOTIMPLfor those calls.Negative controls call XPackage and XGame functions and require
E_NOTIMPLplus log entries.Verification
cmake --build --preset dev --target xgameruntime_shim xgameruntime_shim_check xgameruntime_contracts_check xgameruntime_preflight_exe xmem_shim d3d12_xs_shimctest --preset dev --no-tests=error -R '^xgameruntime_' -Vxgameruntime_thunks,xgameruntime_contractsandxgameruntime_preflight_stub_refused.xgameruntime contracts: user=implemented game-save=implemented reopen=ok stale=E_GS_HANDLE_EXPIRED negative=E_NOTIMPL x2 PASS.python -B tests/xgameruntime_table_check.pyexports=20 classes=XAsync,XGame,XGameSave,XPackage,XSystem,XTaskQueue,XUser states=implemented_hr=9,implemented_void=4,stub=7 duplicate_control=detected PASS.docs_links_check.py:Self-test passed.,Checked 15 Markdown files and 238 links..git diff --check origin/main...HEAD: clean.Evidence and follow-up
runtime/xuser-xgamesave, head7182b78, based ond33845b(includes XCL-04).a891097adds the contracts;7182b78fixes the XGameSave data lifetimes after review.XUserGetId,
XUserDuplicateHandle,
XUserCloseHandle,
XGameSaveInitializeProvider,
XGameSaveCreateContainer,
XGameSaveCreateUpdate,
XGameSaveSubmitBlobWrite,
XGameSaveSubmitUpdate,
XGameSaveReadBlobData.
XUserAddAsyncandXGameSaveInitializeProviderAsyncpages. The missing async contract is a named limitation, not a silent stub.
provider-scoped container store and the synthetic title for the two classes grouped by XCL-05.
The async surface remains unimplemented and explicitly logged.
Checklist
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T00:25:02Z.
Review: CHANGES_REQUESTED
Windows Release passed all three existing XGameRuntime tests. A second source-built check found two data lifetime problems:
Please add those cases, plus independent names on one provider. The fixture can remain in memory, with an explicit scope for provider identity.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T00:50:17Z.
Review: APPROVED
The revised storage separates named data from open handles and expires updates on container close. I reran the three Windows Release fixture tests on
7182b787. Opening the same name and reopening it both find the committed data, while a stale update returns E_GS_HANDLE_EXPIRED and leaves the other container unchanged. The strict preflight control also still refuses the unimplemented async path. This clears my previous review on the fixture scope.Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-24T00:40:15Z.
Fixed in
7182b78. Container data is now a provider-scoped store keyed by container name, independent of open handles: a second handle and a reopened handle both read the original blob, and slot-a/slot-b stay isolated on one provider. Updates bind to the parent container handle id, provider scope and store id; after the parent closes and its slot is reused, XGameSaveSubmitUpdate returns E_GS_HANDLE_EXPIRED (0x8083000D) and slot-b is unchanged. Added those controls; 3/3 xgameruntime tests pass, table check passes, docs_links passes with 15 files/238 links.