XGameSave: XCL_IMPORT_SAVE turns a PS5 story save into the Xbox container #665
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!665
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-665"
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?
@MrCheese5 on GitHub · 2026-11-24 03:07 UTC · original
MrCheese5:xgamesave-ps5-import→main· +201 −2 · 4 files · 1 commits · openThe newer retail game's PS5 and Xbox builds store a story save in the same format. On PS5, the packed copy inside a decrypted save folder's
chives.dat(SLAYER1header, then an ASAV file) is byte for byte what the Xbox build keeps as a slot'sSave Game Datablob: the same ASAV header, the same encrypted LZ4 payload and the same 32-byte signature. The title's own verify, decrypt and decompress steps accept it unchanged. The only thing missing is the Xbox build's 296-byteSave Game Headerblob, which holds sizes and hashes.XCL_IMPORT_SAVE=<folder>[;<folder>…]writes one container per folder when the title opens its save provider. The container is named after the ASAV slot (SARC0000,SARC0015, …) and gets the ASAV file asSave Game Dataplus a computedSave Game Header. A slot that already exists is left alone unlessXCL_IMPORT_SAVE_FORCE=1is set. XCL decrypts, re-encrypts and signs nothing: the ASAV is copied as is, and the change contains no key.Format, as the title reads it:
Save Game Header: u32 6 | u32 data size | u32 joaat of the data | u32 header hash | u64 time | u32 0 | u32 stored size (ASAV +0x18) | u32 unpacked size (ASAV +0x1c) | UTF-16 title (0x100 bytes). The header hash is a joaat chained over time, title, +0x18, +0x1c, +0x20 and +0x08. joaat here is Jenkins one-at-a-time over signed bytes.What is in it
crates/xcl/src/hle/xgameruntime/save_import.rs: the hash, the header builder, thechives.datreader andimport_once, with unit tests on synthetic datacrates/xcl/src/hle/xgameruntime/gamesave.rs:open_providercallsimport_once;encandapplybecomepub(super)so the import writes through the same path asXGameSaveSubmitUpdateREADME.md: the variableTested
cargo test -p xcl --lib save_import: 3 passed, 0 failedcargo test --workspace -- --test-threads=4: 690 passed, 0 failed, 41 ignored; SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardwareRegression run
Both runs are without
XCL_IMPORT_SAVE, the default path, to show that nothing else changes. Each uses its own fresh data root.Not tested
SLAYER1+ ASAV with a valid header checksum and warns otherwise), and saves other than story saves.AI use
🤖 Generated with Claude Code
@RandomGithub12309 on GitHub · 2026-11-24 04:39 UTC · original
Test run and review of
31978f61f67bfeed7143c738e6bbfd8395b2a446merged cleanly ontomain(f4ce27c):Tested
32.0.16.2114, wave32, SM 6.6), Intel Core Ultra 7 255HX (20 cores), Windows 11 Build 26300,rustc 1.100.0stable-x86_64-pc-windows-msvc, debug buildcargo test --workspace -- --test-threads=4directly on the PR's older base (bdab194) hung past 180s atgpu_uma_import_check_at_initand sibling GPU tests; on the clean merge ontomain(f4ce27c) it completed cleanly.cargo build --workspace+cargo test --workspace -- --test-threads=4(on merge ontof4ce27c)hle::xgameruntime::save_import::tests::joaat_s_sign_extends_bytes,header_carries_sizes_and_chained_hashes, andchives_asav_checks_the_packed_copypass)SKIPPED:gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask,gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware(no wave64)Review
pub fn container_header(data: &[u8])lacks bounds checks (crates/xcl/src/hle/xgameruntime/save_import.rs):chives_asavenforcessize >= ASAV_HEADER(0x170), butcontainer_headerispuband slices&data[0x20..0x28]/&data[0x28..0x128]directly, so callers passing fewer than0x128bytes panic.Onceinimport_once: Only the firstXGameSaveproviderrootimports saves if a title opens multiple providers with different configs, andimport_once+gamesave::applyhas no on-disk test.Not tested
chives.datfolder or loading the imported container in a retail titleAI use
31978f6ontof4ce27c, audited the diff, ran the workspace suite, and wrote this report.@luckyteagirl on GitHub · 2026-11-25 04:02 UTC · original
Windows AMD test report for PR #665 at
31978f61f67bfeed7143c738e6bbfd8395b2a446Setup: Windows 11 build 26200, AMD Radeon RX 6800M (driver
30.0.13002.13003), Ryzen 9 5980HX, Rust1.99.0MSVC, DXC/DXIL1.9.2609.5. Checked out the PR's exact head in a clean worktree;XCL_ADAPTER=6800M,XCL_REQUIRE_GPU=1,XCL_DIRECT_DXIL=0for the focused runs.Tested
cargo test --locked -p xcl --lib -j 2 save_import -- --test-threads=1 --show-output: 3 passed, 0 failed, 0 ignored. These are the PR's synthetic ASAV/hash/header tests.gamesave: 10 passed, 0 failed, 0 ignored.cargo build --locked --workspace -j 2: passed.cargo test --locked --workspace --no-fail-fast -j 2 -- --test-threads=4 --show-output --skip gpu::: 413 passed, 0 failed, 23 ignored across completed binaries; 295 library tests filtered out by thegpu::skip. Three subcases printedSKIPPED(reserved cube support and missing D3D12 debug layer twice).Full-suite limit: The same workspace test command without
--skip gpu::exited withSTATUS_ACCESS_VIOLATION(0xc0000005) while thexcllibrary harness was in GPU tests, before it printed a library total. The other completed binaries had 40 passed, 0 failed, 20 ignored. This run does not establish a passing full suite, and I cannot attribute the process crash to this PR's save change from this evidence.Not tested: Importing a real decrypted PS5 save, the resulting container in a retail title,
XCL_IMPORT_SAVE_FORCE, or a paired title smoke. No private save or game data was uploaded.AI assistance: OpenAI Codex (GPT-6) ran these checks and drafted this report.
@JJAutoCompare on GitHub · 2026-11-25 06:24 UTC · original
Empirical test report (
31978f61)Hardware / environment
31978f61f67bfeed7143c738e6bbfd8395b2a446, checked out detached.0ef1bc386), Cargo 1.100.0 (3acc79c0c), x86_64-pc-windows-msvc. DXC 1.9.2609.5 (01b62ad47). Unoptimized test profile with debug info and incremental compilation disabled.XCL_ADAPTER=NONE_CPU_ONLYandRUST_TEST_NOCAPTURE=1. The build and both runs used Cargo directly outside the Arc test wrapper.Commands and results
cargo test --workspace --no-runexited 0 and built 15 test executables. It ran zero tests. The compiler emitted a deprecation warning forAtomic::fetch_update.cargo test -p xcl --lib hle::xgameruntime::save_import::tests::exited 0 with 3 passed, 0 failed, 0 ignored, 0 skipped, and 668 filtered out.cargo test -p xcl --lib hle::xgameruntime::gamesave::tests::exited 0 with 10 passed, 0 failed, 0 ignored, 0 skipped, and 661 filtered out.SKIPPED.Observed behavior
The new tests passed for signed-byte hashing, Xbox header size fields and hash changes after a payload edit, and ASAV extraction from a synthetic packed save. Extraction recovered the expected slot and exact payload, excluded trailing padding, and rejected a bad checksum and non-SLAYER1 input. Existing XGameSave unit tests passed for provider initialization, container and blob round trips, name matching, and deletion.
Not tested
Full GPU workspace suite, game smoke runs, retail save loading, and provider-driven import with force replacement.
AI use
Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr665-focused.log and published.
@DavidM1911 on GitHub · 2026-11-25 12:21 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!
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.