Skip to content

xgameruntime_gamesave: settle the missing-container and null blob-name assumptions from the executable's callers - #7571

Closed
MaxtorCoder wants to merge 2 commits into
ProjectLeonida:mainfrom
MaxtorCoder:gamesave-assumptions-from-exe
Closed

MaxtorCoder wants to merge 2 commits into
ProjectLeonida:mainfrom
MaxtorCoder:gamesave-assumptions-from-exe

Conversation

@MaxtorCoder

@MaxtorCoder MaxtorCoder commented Nov 23, 2026 •

Copy link
Copy Markdown

Claimed in the coordination issue as: #7496 (comment)

What and why

runtime/shims/xgameruntime_gamesave.cpp:20 and docs/runtime_imports.md:392 carry an ASSUMPTION note that tools/exe_checklist.py lists among the called ones. I checked two parts of it against the retail executable's own XGameSave callers (static read of my own 1.0.2.1 copy, nothing run):

  • Missing container. The title's one XGameSaveGetContainerInfo caller clears a flag that its callback sets when the container name matches. It then takes any successful HRESULT with the flag still clear as "no container" (a step in its save state machine), and turns a failing HRESULT into E_FAIL. The shim returns S_OK without calling the callback, which that path accepts. What the retail API itself returns there is not shown by the caller, so the note now records the caller's expectation, not the API's answer.
  • blobNames = nullptr. No caller passes it. The sync XGameSaveReadBlobData caller passes one name with a count of 1 and checks that the count written back is 1. The XGameSaveReadBlobDataAsync caller is not started when it has no name to read. Null-means-all stays the shim's assumption, unreached by the title.

The quota and the blob-name length stay an ASSUMPTION, since nothing here measures them. The measured notes are a separate comment block, so exe_checklist no longer folds them into the ASSUMPTION note. Comment and doc change only; the shim's behaviour is unchanged. Only call shapes and counts are quoted: no addresses, strings or bytes from the executable.

Tested

  • python -I tools/exe_checklist.py: the gamesave notes list only the quota, the name length and null-means-all (code and doc), without the measured prose; python -I tests/test_exe_checklist.py OK.
  • No code change, so no runtime test rerun.

AI-assisted: yes

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (No translator change.)

🤖 Generated with Claude Code

…e assumptions from the executable's callers

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MartinIndra02

Copy link
Copy Markdown
Contributor

Independent Windows test of 399bbb00e: pass.

Setup: Windows 11 x64, MSVC 19.44.35220 (RelWithDebInfo, Windows SDK 10.0.26100.0), no game files.

  • xgameruntime_test.exe: PASS (exit 0).

AI-assisted review/test.

@BatSmacker84

Copy link
Copy Markdown

Checked 399bbb00e (merges cleanly onto main 6312c057f) against the retail executable on Windows 11 26200, with the repo scanners, Capstone and dumpbin.

Pass

  • One direct caller per method. GetContainerInfo clears a flag that the callback sets on a name match; an unset flag advances the save state where it applies, and a negative HRESULT becomes E_FAIL in the outer wrapper.
  • The synchronous read passes one named blob and checks that the returned count is one; the asynchronous call requires a nonzero count and passes an inline name array.
  • Existing checklist tests 11/11; both Windows runtime tests pass.

Needs changes

  • The caller code can't show what the retail API returns, and it never passes a null name list, so null-means-all, the quota and the name limit aren't settled by it. Suggested: "The observed missing-container path accepts any successful HRESULT with no matching callback. The shim returns S_OK without invoking the callback. The observed reads supply names; null-means-all is shim behavior."
  • tools/exe_checklist.py still lists the measured prose because it shares the ASSUMPTION comment block; a blank source line before it separates them.

No conflict with #8104 or #6996 individually (those two conflict with each other).

AI-assisted: Codex GPT-6.2 Sol ran the checks, Claude Opus 5.5 reviewed the report. The executable was read in place (SHA-256 e95020b2…8993); nothing from the image is quoted.

…MPTION list, and say what is shim behavior

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaxtorCoder

Copy link
Copy Markdown
Author

Thanks, both points were right. Fixed in 8657196:

  • Wording: the measured notes (comment and docs/runtime_imports.md) now say what the caller shows. It clears a flag its callback sets on a name match, takes any successful HRESULT with the flag still clear as "no container", and turns a failure into E_FAIL. The shim's S_OK without a callback is a path it accepts; what the retail API returns there is not shown. Null-means-all moves back into the ASSUMPTION note as shim behavior that the title never reaches, since its reads always name their blobs.
  • Checklist: the measured notes are now their own comment block after a blank source line, so exe_checklist lists only the quota, the name length and null-means-all for the shim and the doc. tests/test_exe_checklist.py passes.

The PR description is updated to match.

@comtek21516

Copy link
Copy Markdown

Tested 865719665 on main at 867d922f0, in one tree with #9083, #9023, #8527 (four clean merges): pass.

For this change. xgameruntime_gamesave passes natively and under Wine with the settled missing-container and null blob-name answers.

Setup. Built with MSVC 14.52 (Visual Studio 18), Windows SDK 10.0.26100, Vulkan SDK 1.4.363.1, Ninja RelWithDebInfo on Windows Server 2025 (no Vulkan driver there), then the same binaries run through scripts/run_wine_tests.py under wine-11.0 (WineHQ stable, xvfb-run) on a Quadro RTX 4000 (Turing), NVIDIA 615.71.09, Ubuntu 22.04.5, where the layer tests report device: Quadro RTX 4000.

passed failed skipped
native Windows, this tree 147 4 124
Wine on the GPU, main 867d922f0 210 12 54
Wine on the GPU, this tree 210 12 54

Under Wine the tree is test by test the same as main. The four native failures are gameinput_host, d3d12_sparse_queue_family, vk_bindless_ps_tex and vk_bindless_ps_imgatomic, which fail the same way on main on that machine (#7452). The 12 under Wine are the same 12 as on main (host comparisons Wine cannot answer, and d3d12_xdxr_rt, d3d12_indirect_rt, d3d12_indirect_dispatch_count).

Because the four were built together, there is no per-PR negative control in this run: a regression would have shown as a difference from main, and there is none. No game files used. AI-assisted (Claude Code).

@BatSmacker84

Copy link
Copy Markdown

Re-checked 865719665 (one commit since 399bbb00e; still merges cleanly): both points from my earlier check are addressed. Pass from my side.

  • The doc and the shim comment now keep what the caller shows apart from what the shim does: the caller accepts any successful HRESULT with the flag still clear as "no container", the retail API's own return isn't claimed, and null-means-all is stated as shim behavior the title doesn't reach.
  • The measured notes are separated from the ASSUMPTION block by a blank source line, so tools/exe_checklist.py no longer picks them up as an assumption.

AI-assisted: Claude Opus 5.5 compared the new commit with the earlier executable check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants