XGameSave: long container names use a hashed folder (#326) #481

Open
github-bot wants to merge 1 commit from github-bot/gh-481 into main AGit
Owner

@⁠Grimkaaah on GitHub · 2026-11-24 00:56 UTC · original
Grimkaaah:fix/326-gamesave-long-container-name → main · +150 −10 · 1 files · 1 commits · open

Summary

  • When enc(name) would exceed 200 characters (Windows path component limit / / → %2F expansion), store the container under ~xclc.<fnv1a64> instead of the raw encoded name.
  • Persist the exact GDK container name in a container_name sidecar so enumerate / get-info / delete keep the real name.
  • Unit tests for the short/long folder naming and a full create → submit → enumerate → delete round-trip with a 256-char name.

Fixes #326

Test plan

  • cargo test -p xcl --lib hle::xgameruntime::gamesave:: (13 passed)
**@⁠Grimkaaah** on GitHub · 2026-11-24 00:56 UTC · [original](https://github.com/xcl-dev/xcl/pull/481) `Grimkaaah:fix/326-gamesave-long-container-name` → `main` · +150 −10 · 1 files · 1 commits · open ## Summary - When `enc(name)` would exceed 200 characters (Windows path component limit / `/` → `%2F` expansion), store the container under `~xclc.<fnv1a64>` instead of the raw encoded name. - Persist the exact GDK container name in a `container_name` sidecar so enumerate / get-info / delete keep the real name. - Unit tests for the short/long folder naming and a full create → submit → enumerate → delete round-trip with a 256-char name. Fixes #326 ## Test plan - [x] `cargo test -p xcl --lib hle::xgameruntime::gamesave::` (13 passed)
When enc(name) exceeds 200 chars, store under ~xclc.<fnv> and persist the exact name in container_name so create/submit/enumerate keep working on Windows path limits.

Co-authored-by: Cursor <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:22:55 +00:00
Author
Owner

@⁠H0UNDZER0 on GitHub · 2026-11-24 03:05 UTC · original

Tested on an RTX 5080, release build: pass, 679 passed, 0 failed.

  • Commit f9947a0f680d4fa9ee1731f7dd474bdc98e5ce3d, this PR's head as is (on its base 2997c9a), release build.
  • NVIDIA GeForce RTX 5080 16 GB, driver 621.24 (32.0.16.2124), 32-lane waves; Ryzen 7 9700X; Windows 11 Pro 24H2 (26100.9711); Rust 1.100.0 MSVC; DXC 1.9.2602.17 (Windows SDK 10.0.26100.0). No XCL_* variables set.
  • cargo build --release --workspace --locked: OK, the same single fetch_update warning as main.
  • cargo test --workspace --release --no-fail-fast --locked -- --test-threads=4, run twice (the second with --show-output): 679 passed, 0 failed, 41 ignored both times. main 2997c9a gives 676 / 0 / 41 on this PC: the difference is the 3 new tests, container_folder_name_short_stays_encoded, container_folder_name_long_uses_stable_hash_prefix and long_container_name_saves_and_enumerates, which pass.
  • SKIPPED: the usual 2, gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware (no wave64).
  • The test title (e2e), its save-storage check included, ends with failures: 0.

Not tested

  • A save made before this PR with a folder name of 201–255 characters, the upgrade case in the review above: no test covers it.
  • This PR merged onto a newer main. When this was written that was dd2ae9a; git merge-tree showed no conflict.
  • Debug build, retail titles, scripts/smoke.ps1.

AI use: Claude Code (Claude Opus 5.5, Claude Fable 5.2)

**@⁠H0UNDZER0** on GitHub · 2026-11-24 03:05 UTC · [original](https://github.com/xcl-dev/xcl/pull/481#issuecomment-7120767222) **Tested** on an RTX 5080, release build: **pass**, 679 passed, 0 failed. - Commit `f9947a0f680d4fa9ee1731f7dd474bdc98e5ce3d`, this PR's head as is (on its base `2997c9a`), release build. - NVIDIA GeForce RTX 5080 16 GB, driver 621.24 (32.0.16.2124), 32-lane waves; Ryzen 7 9700X; Windows 11 Pro 24H2 (26100.9711); Rust 1.100.0 MSVC; DXC 1.9.2602.17 (Windows SDK 10.0.26100.0). No `XCL_*` variables set. - `cargo build --release --workspace --locked`: OK, the same single `fetch_update` warning as `main`. - `cargo test --workspace --release --no-fail-fast --locked -- --test-threads=4`, run twice (the second with `--show-output`): **679 passed, 0 failed, 41 ignored** both times. `main` `2997c9a` gives 676 / 0 / 41 on this PC: the difference is the 3 new tests, `container_folder_name_short_stays_encoded`, `container_folder_name_long_uses_stable_hash_prefix` and `long_container_name_saves_and_enumerates`, which pass. - `SKIPPED`: the usual 2, `gpu_geometry_wave32_prefix_count_over_a_mask` and `gpu_wave32_program_in_wave64_hardware` (no wave64). - The test title (`e2e`), its save-storage check included, ends with `failures: 0`. **Not tested** - A save made before this PR with a folder name of 201–255 characters, the upgrade case in the review above: no test covers it. - This PR merged onto a newer `main`. When this was written that was `dd2ae9a`; `git merge-tree` showed no conflict. - Debug build, retail titles, `scripts/smoke.ps1`. **AI use:** Claude Code (Claude Opus 5.5, Claude Fable 5.2)
Author
Owner

@⁠MesshM on GitHub · 2026-11-24 05:24 UTC · original

Test run of f9947a0f680d4fa9ee1731f7dd474bdc98e5ce3d on AMD RDNA4. I merged it onto current main d208e14 locally (clean merge) and tested that tree.

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0 stable-x86_64-pc-windows-msvc, debug
  • cargo build --workspace + cargo test --workspace -- --test-threads=4 on the merge: 707 passed, 0 failed, 41 ignored, exit code 0; xcl lib tests 666 passed, 0 failed, 21 ignored
  • 0 SKIPPED; container_folder_name_long_uses_stable_hash_prefix and container_folder_name_short_stays_encoded pass.

Review: Duplicate of #492 (open), which also stores over-long container names in hashed folders for #326. Only one should land, and the folder naming must not change after it does, or existing saves would be lost.

Not tested: no retail title or regression run (I have no unpacked game), no XCL_SAMPLE_* tests, release build; the PR's head on its old base was not run, only its merge onto main.

Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.

**@⁠MesshM** on GitHub · 2026-11-24 05:24 UTC · [original](https://github.com/xcl-dev/xcl/pull/481#issuecomment-7122911681) Test run of `f9947a0f680d4fa9ee1731f7dd474bdc98e5ce3d` on AMD RDNA4. I merged it onto current `main` `d208e14` locally (clean merge) and tested that tree. **Tested** - AMD Radeon RX 9060 XT 16 GB (RDNA4), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0 `stable-x86_64-pc-windows-msvc`, debug - `cargo build --workspace` + `cargo test --workspace -- --test-threads=4` on the merge: **707 passed, 0 failed, 41 ignored**, exit code 0; `xcl` lib tests 666 passed, 0 failed, 21 ignored - **0 `SKIPPED`**; `container_folder_name_long_uses_stable_hash_prefix` and `container_folder_name_short_stays_encoded` pass. **Review:** **Duplicate of #492** (open), which also stores over-long container names in hashed folders for #326. Only one should land, and the folder naming must not change after it does, or existing saves would be lost. **Not tested:** no retail title or regression run (I have no unpacked game), no `XCL_SAMPLE_*` tests, release build; the PR's head on its old base was not run, only its merge onto `main`. Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.
Author
Owner

@⁠Alpha325 on GitHub · 2026-11-25 02:49 UTC · original

I reproduced the legacy-folder issue raised above using a synthetic save with a 201-character ASCII container name. I seeded the old encoded folder layout without a container_name sidecar, then ran the same fixture on parent 2997c9a and PR head f9947a0.

Operation Parent PR
Enumerate before opening One matching entry One matching entry
Open by name and read data Read the original bytes E_GS_BLOB_NOT_FOUND (0x80830008)
Update by name Updated the original folder; one entry Created a second folder; two entries
Delete by name Returned S_OK; zero entries remained Returned S_OK; the original entry remained

The fixture uses a canonical Windows path to isolate the folder-layout change from the Win32 full-path limit. It passed on the parent and failed on the PR. The PR’s 13 existing GameSave tests still passed.

Windows 11, Rust 1.100.0 MSVC debug, temporary synthetic save data only. AI use — OpenAI Codex (GPT-6) wrote and ran the fixture and drafted this report.

**@⁠Alpha325** on GitHub · 2026-11-25 02:49 UTC · [original](https://github.com/xcl-dev/xcl/pull/481#issuecomment-7151225125) I reproduced the legacy-folder issue raised above using a synthetic save with a 201-character ASCII container name. I seeded the old encoded folder layout without a `container_name` sidecar, then ran the same fixture on parent `2997c9a` and PR head `f9947a0`. | Operation | Parent | PR | |---|---|---| | Enumerate before opening | One matching entry | One matching entry | | Open by name and read `data` | Read the original bytes | `E_GS_BLOB_NOT_FOUND` (`0x80830008`) | | Update by name | Updated the original folder; one entry | Created a second folder; two entries | | Delete by name | Returned `S_OK`; zero entries remained | Returned `S_OK`; the original entry remained | The fixture uses a canonical Windows path to isolate the folder-layout change from the Win32 full-path limit. It passed on the parent and failed on the PR. The PR’s 13 existing GameSave tests still passed. Windows 11, Rust 1.100.0 MSVC debug, temporary synthetic save data only. AI use — OpenAI Codex (GPT-6) wrote and ran the fixture and drafted this report.
Author
Owner

@⁠Toons29 on GitHub · 2026-11-25 02:55 UTC · original

Regression run of f9947a0f on the retail title, for this PR's Regression run section. Both blocks are from scripts/smoke.ps1 as printed, not edited: main on 4178e888, this PR on its head commit with no uncommitted changes, same title and time.

xcl-smoke v1
commit: 4178e888c0b5be50a2887eda45cdb832763b68a4
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1618 (PresentX 1618)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 14831 MB
xcl-smoke v1
commit: f9947a0f680d4fa9ee1731f7dd474bdc98e5ce3d
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1482 (PresentX 1482)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14780 MB

Against the limits in CONTRIBUTING.md: 92 % of main's frames, 100 % of its peak commit, no crash, no device removal.

AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, cargo build --release -p xcl, 60 s, XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.

AI use: Claude Code (Claude Opus 5.5) built both trees and ran scripts/smoke.ps1; I checked the blocks before posting.

**@⁠Toons29** on GitHub · 2026-11-25 02:55 UTC · [original](https://github.com/xcl-dev/xcl/pull/481#issuecomment-7151369046) Regression run of `f9947a0f` on the retail title, for this PR's **Regression run** section. Both blocks are from `scripts/smoke.ps1` as printed, not edited: `main` on `4178e888`, this PR on its head commit with no uncommitted changes, same title and time. ``` xcl-smoke v1 commit: 4178e888c0b5be50a2887eda45cdb832763b68a4 gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1618 (PresentX 1618) presents per 2 s (last 3): 61 60 60 device removals: 0 crashes: 0 peak commit: 14831 MB ``` ``` xcl-smoke v1 commit: f9947a0f680d4fa9ee1731f7dd474bdc98e5ce3d gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1482 (PresentX 1482) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14780 MB ``` Against the limits in CONTRIBUTING.md: 92 % of `main`'s frames, 100 % of its peak commit, no crash, no device removal. AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, `cargo build --release -p xcl`, 60 s, `XCL_NETWORK=0`. This is a regression check only: it does not show whether the run reaches the code this PR changes. AI use: Claude Code (Claude Opus 5.5) built both trees and ran `scripts/smoke.ps1`; I checked the blocks before posting.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 14:05 UTC · original

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-25 14:05 UTC · [original](https://github.com/xcl-dev/xcl/pull/481#issuecomment-7164734715) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
Author
Owner

@⁠shdann on GitHub · 2026-11-24 01:02 UTC · original · reviewed

container_folder_name changes the location of existing saves with encoded folder names of 201–255 ASCII characters. For example, a valid name of 201 ASCII letters fits in a legacy folder. After this change enumeration still finds that folder, but opening or deleting the same name selects the new hash path. A subsequent update can create a second container with the same displayed name. Please resolve the existing legacy folder first, or migrate it safely, and add an upgrade test covering enumerate, read, update, and delete. Also preserve case-insensitive lookup for hashed names: the hash currently takes the original case-sensitive bytes. Static review with OpenAI Codex (GPT-6).

**@⁠shdann** on GitHub · 2026-11-24 01:02 UTC · [original](https://github.com/xcl-dev/xcl/pull/481#pullrequestreview-6032025367) · **reviewed** `container_folder_name` changes the location of existing saves with encoded folder names of 201–255 ASCII characters. For example, a valid name of 201 ASCII letters fits in a legacy folder. After this change enumeration still finds that folder, but opening or deleting the same name selects the new hash path. A subsequent update can create a second container with the same displayed name. Please resolve the existing legacy folder first, or migrate it safely, and add an upgrade test covering enumerate, read, update, and delete. Also preserve case-insensitive lookup for hashed names: the hash currently takes the original case-sensitive bytes. Static review with OpenAI Codex (GPT-6).
This pull request has changes conflicting with the target branch.
  • crates/xcl/src/hle/xgameruntime/gamesave.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/481/head:github-bot/gh-481'
git switch 'github-bot/gh-481'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-481'
git switch 'github-bot/gh-481'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-481'
git switch 'github-bot/gh-481'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-481'
git switch 'main'
git merge --squash 'github-bot/gh-481'
git switch 'main'
git merge --ff-only 'github-bot/gh-481'
git switch 'main'
git merge 'github-bot/gh-481'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.