runtime: add PLS and XPackage contracts #1115
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1122"
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-24T01:21:55Z.
Change
Add the PLS and XPackage contracts to the XGameRuntime fixture.
XPersistentLocalStorageGetPathSize,XPersistentLocalStorageGetPathandXPersistentLocalStorageGetSpaceInfo. The path is deterministic under%TEMP%\xbox-recomp-pls\x2w-synthetic-title-0001; the 32-byte space structure reports32 MiB available, 48 MiB free, 16 MiB used and 64 MiB total. A short path buffer returns
HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); the 32-byte structure is guard-checked so awrite past it is detected.
XPackageMount,XPackageGetMountPathSize,XPackageGetMountPath(three arguments) and
XPackageCloseMountHandle. The synthetic mount points under%TEMP%\xbox-recomp-packages\<identifier>; two mounts return the same path and a query on aclosed mount returns
E_HANDLE.XPackageMountWithUiAsyncremains a namedE_NOTIMPLstub because the publicXAsyncBlock, async result and queue/callback contract is not available without a GDK header.XUser, XGameSave and the other stubs are unchanged.
Verification
cmake --build --preset dev --target xgameruntime_shim xgameruntime_shim_check xgameruntime_contracts_check xgameruntime_pls_xpackage_check xgameruntime_preflight_exe xmem_shim d3d12_xs_shimctest --preset dev --no-tests=error -R '^xgameruntime_' -Vspace=33554432/50331648/67108864 async=stub unmount=E_HANDLE xsystem=E_NOTIMPL calls=29 PASS.python -B tests/xgameruntime_table_check.pyexports=27 classes=XAsync,XGame,XGameSave,XPackage,XPersistentLocalStorage,XSystem,XTaskQueue,XUser states=implemented_hr=15,implemented_void=5,stub=7 duplicate_control=detected PASS.docs_links_check.py:Self-test passed.,Checked 15 Markdown files and 252 links..git diff --check origin/main...HEAD: clean.Evidence and follow-up
runtime/pls-xpackage, headc4369fa, based on32f63f9e(contains XCL-05).b9e0110adds the contracts;c4369famatches the documented PLS space structure andXPackage path signature.
PLS GetPath,
PLS GetSpaceInfo,
XPackageMount,
XPackageGetMountPath,
XPackageCloseMountHandle.
E_INVALIDARG, null PLS outputsE_POINTER, null or..package idE_INVALIDARG, null mount outputE_POINTER, closed/null mountE_HANDLE; async mount and XSystem remainE_NOTIMPL.GetTempPathWwith aMAX_PATH + 1bound; a longer temp path isuntested. Persistence is process-local in this fixture.
%TEMP%; no game files, dumps, shader bytes, titlepaths or secrets are included.
Checklist
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T02:02:56Z.
Review: COMMENTED
Reviewed at
c4369fadb632dc96bd88d328f604490f35b60425d(diff +src/xgameruntime_shim.cpp,tests/xgameruntime_pls_xpackage_check.cpp,tests/xgameruntime_table_check.py,docs/experiments.md).XPersistentLocalStorageSpaceInfolayout (sizeof == 32), ASCII-onlyvalid_package_identifier()path-traversal guards (./..),SRWLOCKmount table handling, and negative controls (E_POINTER,E_INVALIDARG,ERROR_INSUFFICIENT_BUFFER,E_HANDLE, andE_NOTIMPLstubs) look clean and well-scoped.docs/experiments.mdandtests/xgameruntime_table_check.pyare updated in sync and remain title-neutral.python3 -B tests/docs_links_check.py,python3 -B tests/bidi_controls_check.py,python3 -B tests/gpu_report_format_check.py,python3 -B tests/xgameruntime_table_check.py(exports=27,implemented_hr=15,implemented_void=5,stub=7), andpython3 -m py_compile tests/xgameruntime_table_check.py— all passed.xgameruntime_pls_xpackageexecution were not run locally on this Linux host and rely on CI (Windows build jobs currently pending on this head).Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T01:36:42Z.
I pushed
c4369fadto match the public Windows ABI. XPackageGetMountPath takes three arguments. XPersistentLocalStorageSpaceInfo has four 64-bit fields, including usedBytes. The fixture now calls the three-argument export and checks every counter with output guards. The PC short-buffer result matches the documented error. Windows Release passed 4/4 withctest --preset release --no-tests=error -R '^xgameruntime_'.Package path signature · PLS structure
Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-24T01:55:15Z.
Adopted
c4369fad. The PLS space structure is now 32 bytes with usedBytes (16 MiB synthetic used) and guard checks; a short PLS path returns ERROR_INSUFFICIENT_BUFFER; XPackageGetMountPath is the documented three-argument form. 4/4 XGameRuntime tests pass, docs_links 15 files/252 links.