Repository navigation
XGameSave: GetContainerInfo of a container with no saved data succeeds - #1192
emirduran707 wants to merge 1 commit into
Conversation
|
Independent first-launch check using XCL’s bundled test title with a scratch save-flow fixture. Windows 11 build 26300, Ryzen 7 9800X3D, Rust 1.99.1 MSVC, release. I built with
This exercised the title’s named XGameRuntime imports and on-disk persistence across processes. Retail save behavior was outside the test. AI-assisted. Codex (GPT-6, exact variant unavailable) wrote and ran the fixture and drafted this report. Retest on I checked both enumeration APIs with synthetic save files. A provider root that was a file returned When the callback continued past the healthy slot, both an unfiltered scan and a prefix covering both slots reported the healthy result first and then returned Windows 11 build 26300, Ryzen 7 9800X3D, Rust 1.99.1 MSVC debug. AI-assisted. Codex (GPT-6 family, exact variant unavailable) wrote and ran the fixture and drafted this update. |
|
Independent verification on current Machine: Windows 11, Ryzen 9 7900X; Rust stable MSVC, debug.
AI use: test runs by Devin (Cognition, SWE-2); no code changes. |
|
Rerun on the new head
Same machine, debug. The reports below are for Whole-suite run, to go with the two runs above ( Tested
Not tested
AI use
|
Adapt xcl-dev#1192 with separate validation of path and filename, and snapshot directory metadata before delivering callbacks. Propagate storage errors before delivering any result. The corrected game-save module passed 13 tests. Assisted-by: Claude Code (Claude Opus 5.5) Assisted-by: T3 Code (gpt-6.2-astra)
|
On Tested: Windows 11, debug, CPU only. Both cases return
Test (append to gamesave.rs)#[cfg(test)]
mod lookup_probe {
use super::*;
unsafe extern "system" fn hit(_i: *const ContainerInfo, ctx: *mut c_void) -> bool { *(ctx as *mut u32) += 1; true }
#[test]
fn unreadable_storage_is_not_no_save() {
let mut pr = Provider { magic: MAGIC_PROVIDER, root: std::env::current_exe().unwrap() };
let mut n = 0u32;
let r = unsafe { XGameSaveGetContainerInfo(&mut pr, b"slot\0".as_ptr(), &mut n as *mut _ as *mut c_void, Some(hit)) };
assert_eq!((r, n), (E_FAIL, 0));
}
#[test]
fn unreadable_container_is_not_no_save() {
let root = std::env::temp_dir().join(format!("xcl-probe-{}", std::process::id()));
std::fs::create_dir_all(root.join("slot")).unwrap();
std::fs::write(root.join("slot").join("b"), b"not a directory").unwrap();
let mut pr = Provider { magic: MAGIC_PROVIDER, root: root.clone() };
let mut n = 0u32;
let r = unsafe { XGameSaveGetContainerInfo(&mut pr, b"slot\0".as_ptr(), &mut n as *mut _ as *mut c_void, Some(hit)) };
std::fs::remove_dir_all(&root).unwrap();
assert_eq!((r, n), (E_FAIL, 0));
}
}AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this comment. I checked the points before posting. |
0e4fefe to
5c3aaca
Compare
|
Fixed in
Reproduced both cases with AI use: Antigravity with Gemini 4 Neon wrote the fix, test, and this reply. |
XGameSaveGetContainerInfo returned 0x80830010 whenever no stored container matched the name: on first launch, for a container that was created but never written, and for an empty or too-long name. A title that checks FAILED(hr) treats its own first launch as a save error. 0x80830010 is not "container not found". Microsoft's code defines it as the user quitting from the device-contention dialog: - PlayFab/PlayFabCSdk, Source/PlayFabGameSave/Source/Platform/Windows/ PFGameSaveFilesAPIProvider_GRTS.cpp (c2c0321): "static const HRESULT E_GS_USER_QUIT = 0x80830010;" - microsoft/XBOX-GDK-dotnet, src/GDK.Net/HResult.cs (ef349b1): "EGsUserQuit = unchecked((int)0x80830010)"; the E_GS_* codes before it run from 0x80830001 to 0x8083000F, none of them "not found". The XGameSaveGetContainerInfo reference page says the name "will return only one result if found" and lists as common errors only E_GS_INVALID_CONTAINER_NAME, E_GS_USER_CANCELED, E_GS_CONTAINER_NOT_IN_SYNC, E_GS_CONTAINER_SYNC_FAILED and E_GS_HANDLE_EXPIRED. GDK.Net's GameSaveProvider.GetContainerInfo (a089dcc) calls it, throws only on a failed HRESULT, and reports "not found" itself when the call succeeded but the callback added nothing. A missing container now returns S_OK without calling the callback. An empty or over-256-byte name returns E_GS_INVALID_CONTAINER_NAME, the check XGameSaveCreateContainer and XGameSaveDeleteContainer already make with valid_container_name_length. The E_GS_CONTAINER_NOT_FOUND constant had no other user and is removed. Storage I/O errors when listing the provider root or a container's blob directory now return E_FAIL instead of being reported as "no saved data". containers_blobs_round_trip asserted the wrong code after deleting a container; it now asserts S_OK and that the callback was not called, which checks more than before. The new tests cover a never-created container, a created but never-submitted one, a 256-byte name, empty and 257-byte names, and unreadable provider/container storage. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Assisted-by: Antigravity (Gemini 4 Neon)
5c3aaca to
e41e105
Compare
|
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
Thanks! — Devin |
… + xcl-dev#1050 + xcl-dev#1846, gamesave.rs verbatim reference-only) Windows hle/xgameruntime/gamesave.rs verbatim reference-only (hle is cfg(windows), 0 tests run on Linux): xcl-dev#1192 GetContainerInfo S_OK without saved data + each_container/try_blobs_of Result plumbing + drop E_GS_CONTAINER_NOT_FOUND; xcl-dev#1050 container mtime as newest of container/b/ display/blobs; xcl-dev#1846 cfg(windows) move_path extended-length prefix in replace_file + 2 cfg(windows) tests + README line. each_container lands once (xcl-dev#1192 structure with the xcl-dev#1050 container_modified call, never both modified forms); dec keeps the landed hex_val form (no regress).
…cl-dev#492, gamesave.rs verbatim reference-only) Port live pr492head=7bf139f9 (1 file +143/-8, OPEN): Update.name + MAX_CONTAINER_ENC/LONG_PREFIX/container_dir_name (live FNV-1a fnv64 form via crate::gpu::shader::fnv64, not the keeper sip-hash draft) + delete_path/create-container resolution + each_container hash-folder legs hand-applied onto the landed xcl-dev#1192 Result form + apply(dir,name) name-sidecar hand-applied onto the landed atomic+quota apply + both submit paths + round-trip test verbatim. Landed direct apply() test callers gain the name arg (short dirs, sidecar no-op). cfg(windows)-only, no Linux twin, 0 tests on Linux; fidelity gate replaces failing-first (all 125 PR + lines present, all 8 - lines honored).
|
NVIDIA and AMD full-suite run, to go with the reports above by fromthemoonx, since none of them covers AMD. Tested exact head Tested
Not tested
AI use
|
XGameSaveGetContainerInforeturned0x80830010for a container that has no saved data: a name never used (a title's first launch), or a container created but never submitted. That code is not "container not found". Microsoft's own code names itE_GS_USER_QUIT:PFGameSaveFilesAPIProvider_GRTS.cppin PlayFab/PlayFabCSdk, andHResult.csin microsoft/XBOX-GDK-dotnet. It is the result of the "quit game" choice on the device-contention dialog. The documentedE_GS_*codes before it run from0x80830001to0x8083000F, and none of them means "not found".The function's documentation lists no not-found error; the name "will return only one result if found". Microsoft's .NET wrapper (
GameSaveProvider.GetContainerInfo) fails only on a failed HRESULT, and reports "not found" itself when the call succeeded and the callback was not called. So a title asking for its save slot on first launch was told the user chose to quit the game.Now a valid name returns
S_OK, and the callback is called only if the container exists. An empty or over-long name returnsE_GS_INVALID_CONTAINER_NAME, the same check and error asXGameSaveCreateContainerandXGameSaveDeleteContainer. The wrong constant is removed; nothing else used it. Storage I/O errors when listing the provider root or a container'sbdirectory (for example, when either is not a directory) returnE_FAILinstead of being silently treated as "no saved data".What is in it
crates/xcl/src/hle/xgameruntime/gamesave.rs:try_blobs_ofandeach_containerpropagate non-NotFoundI/O errors asE_FAILthroughXGameSaveGetContainerInfo,XGameSaveEnumerateContainerInfo, andXGameSaveEnumerateContainerInfoByName.get_container_info_of_a_container_without_saved_data_succeeds_without_a_resultandget_container_info_reports_storage_errors.containers_blobs_round_trip, the assertion after deleting a container now expectsS_OKand no callback. Before, it asserted the wrong code.Tested
cargo build --workspace, thencargo test --workspace --no-fail-fast -- --test-threads=4on e41e105 (rebased ontomain1a0bbe3): 1250 passed, 2 failed, 46 ignored; 8 SKIPPED (6 inlower_dxil::tests::{f16,f32}_programs_on_the_gpu;heap_window_out_of_memory_falls_back_to_the_switch_form;pso_measurement_compiles_an_exact_synthetic_record)gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1,gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_3) fail identically on unmodifiedmain1a0bbe3on this GPU (seeds 722 and 1599).cargo test -p xcl --lib gamesave -- --test-threads=4: 12 passed, 0 failedget_container_info_reports_storage_errorsfailed on0e4fefe(left: 0,right: -2147467259); passes on5c3aacaRegression run
main:
this PR:
Not tested
XGameSaveCreateContainer.AI use
main1a0bbe3(a conflict in the tests ofcrates/xcl/src/hle/xgameruntime/gamesave.rs; both tests kept) and reran the suite and smoke runs above.