XGameSave: decode %XX in save file names without slicing the name (#325) #452

Closed
raulmesa96 wants to merge 1 commit from upstream-pr/457 into main
raulmesa96 commented 2026-11-24 00:32:18 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by raulmesa96 on 2026-11-24T00:32:18Z.


dec in gamesave.rs sliced the save file name by byte index after a %; a name with a multi-byte character right after %x panicked inside an extern "system" call and aborted the process. It now reads the two digits as bytes, and both must be hex digits (so %+1 / %-1 are no longer decoded). Names XCL writes itself (enc) decode as before.

Fixes #325

What is in it

  • dec reads the escape's digits as bytes – crates/xcl/src/hle/xgameruntime/gamesave.rs
  • unit test dec_keeps_percent_not_followed_by_two_hex_digits (panicked with end byte index 3 is not a char boundary before the fix) – same file

Tested

  • NVIDIA GeForce RTX 3060 (driver 32.0.16.1088), Intel Core i5-12600K, Windows 11 25H2 build 26200, Rust 1.100.0 x86_64-pc-windows-msvc, debug
  • head aebea99 on main a6f5f7a, clean tree
  • cargo build --workspace then cargo test --workspace --no-fail-fast -- --test-threads=4: 677 passed, 0 failed, 41 ignored (the xcl lib: 637 passed, 0 failed, 21 ignored)
  • SKIPPED: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware (no wave64)
  • cargo test -p xcl --lib gamesave: 11 passed, 0 failed

Regression run

  • none: I have no Xbox title to run scripts/smoke.ps1 on. The change is limited to dec (decoding save file names) and is covered by the unit tests and the full suite above; I would be grateful if someone with a title could add the two xcl-smoke blocks.

Not tested

  • the regression run on a real title (see above)
  • AMD GPUs
  • a retail title writing or reading saves with such names

AI use

  • Claude Code with Claude Opus 5.5: wrote the fix, the test and this description; the tests above were run by it on the hardware named.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:6571829497 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/457). Originally posted by [raulmesa96](https://github.com/raulmesa96) on 2026-11-24T00:32:18Z. --- `dec` in `gamesave.rs` sliced the save file name by byte index after a `%`; a name with a multi-byte character right after `%x` panicked inside an `extern "system"` call and aborted the process. It now reads the two digits as bytes, and both must be hex digits (so `%+1` / `%-1` are no longer decoded). Names XCL writes itself (`enc`) decode as before. Fixes #325 **What is in it** - `dec` reads the escape's digits as bytes – `crates/xcl/src/hle/xgameruntime/gamesave.rs` - unit test `dec_keeps_percent_not_followed_by_two_hex_digits` (panicked with `end byte index 3 is not a char boundary` before the fix) – same file **Tested** - NVIDIA GeForce RTX 3060 (driver 32.0.16.1088), Intel Core i5-12600K, Windows 11 25H2 build 26200, Rust 1.100.0 `x86_64-pc-windows-msvc`, debug - head `aebea99` on `main` `a6f5f7a`, clean tree - `cargo build --workspace` then `cargo test --workspace --no-fail-fast -- --test-threads=4`: 677 passed, 0 failed, 41 ignored (the `xcl` lib: 637 passed, 0 failed, 21 ignored) - SKIPPED: `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware` (no wave64) - `cargo test -p xcl --lib gamesave`: 11 passed, 0 failed **Regression run** - none: I have no Xbox title to run `scripts/smoke.ps1` on. The change is limited to `dec` (decoding save file names) and is covered by the unit tests and the full suite above; I would be grateful if someone with a title could add the two `xcl-smoke` blocks. **Not tested** - the regression run on a real title (see above) - AMD GPUs - a retail title writing or reading saves with such names **AI use** - Claude Code with Claude Opus 5.5: wrote the fix, the test and this description; the tests above were run by it on the hardware named. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
upstream-sync closed this pull request 2026-11-24 11:04:44 +00:00
raylitebull commented 2026-11-24 11:05:57 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-24T10:44:06Z.


Closing as a duplicate of #442 / #448 for #325, which pass the PR description check (whereas this PR fails PR description).

<!-- greyfinch-sync:ivall/xcl:comment:7129173181 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/457#issuecomment-7129173181). Originally posted by [raylitebull](https://github.com/raylitebull) on 2026-11-24T10:44:06Z. --- Closing as a duplicate of #442 / #448 for #325, which pass the `PR description` check (whereas this PR fails `PR description`).

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!452
No description provided.