Skip to content

XGameRuntime: save containers whose names do not fit a Windows path component - #623

Closed
milas6669 wants to merge 2 commits into
xcl-dev:mainfrom
milas6669:xgameruntime-long-container-names
Closed

milas6669 wants to merge 2 commits into
xcl-dev:mainfrom
milas6669:xgameruntime-long-container-names

Conversation

@milas6669

Copy link
Copy Markdown
Contributor

Stacked on #621; only the top commit belongs here.

The percent-encoded container name became a folder name over 255 characters, so creating the container failed. Only folders that cannot hold the name are shortened; the exact name goes in a side file that the container listing reads back. Names that fit are stored as before.

Fixes #326. Not covered: the blob-name length limit.

What is in it

  • gamesave.rs: MAX_FOLDER_NAME, container_folder(), the name file in XGameSaveCreateContainer, each_container, delete_path
  • tests container_folder_shortens_only_what_a_folder_cannot_hold and long_container_names_save_and_come_back_exact

Tested

  • RTX 3070, Windows 11 Pro 10.0.26200, MSVC 19.44, Rust 1.100.0, debug build
  • cargo test --workspace -- --test-threads=4: 649 passed, 0 failed, 21 ignored
  • SKIPPED: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware (no wave64)

Regression run

  • not run: no title on this machine to run scripts/smoke.ps1 against

Not tested

  • AMD, a retail title, scripts/smoke.ps1 main vs PR head

AI use

  • Claude Code, Claude Sonnet 5.5: wrote the code, the tests and this description. Reviewed and opened by the person submitting.

XGameSaveSubmitUpdate wrote each blob with its own temp-and-rename, so a write
that failed halfway left the container with some of the update applied.

Stage every blob of the update under a ~xcltmp. name first, then rename the
staged files into place in order; if a step fails, the steps already applied
are rolled back. The write_atomic helper had no other caller and is removed.

Fixes xcl-dev#324
…omponent

A container name is percent-encoded into its folder name, which can exceed the
255-character limit of a path component, so creating the container failed.

Shorten only the folders that cannot hold the name and keep the exact name in a
side file that the container listing reads back. Names that fit are stored as
before, so existing saves are unchanged.

Stacked on the atomic save update (previous branch). Fixes ivall#326
@milas6669
milas6669 force-pushed the xgameruntime-long-container-names branch from c1d0877 to c75284c Compare November 24, 2026 02:46
@milas6669

Copy link
Copy Markdown
Contributor Author

Closing: #481 (and #492) already cover this and were opened earlier. Please review those instead.

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.

XGameSave: a long valid container name makes every save to it fail

1 participant