Repository navigation
Conversation
…st (Marvisak#2497) With a stray `v18446744073709551615` folder next to a committed `v1`, the next number `highest + 1` overflowed: a debug build panicked, and a release build wrapped to 0, committed `v0` (not canonical, so never read), returned S_OK and removed `v1`, losing the save. The number now comes from `checked_add`; with none, the update returns NO_ACCESS, as for a container with no readable version, before anything is written or removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Verification (Windows 11, WARP/CPU only) — head Tested: the PR head =
Diff read: Side by side with #2525 (head
WARP-only caveat is moot for the filesystem logic; no real GPU used. Synthetic data only. AI use: Claude Code (Claude Sonnet 5.5). |
|
Automated triage for the maintainers. Merge candidate: in Generated by Claude Code |
…er is above the highest (Marvisak#2497)
fuzeofficlal
left a comment
There was a problem hiding this comment.
Reviewed and verified against main (63bcca43) on Windows 11 — clean fix for #2497 and ready to merge:
- Using
v.highest.checked_add(1)inUpdate::submit(crates/victory-hle/src/modules/xgamesave.rs:514-516) returnsNO_ACCESSbefore writing or pruning prior versions whenhighest == u64::MAX, eliminating both release wraparound tov0and debug overflow panic.
Local verification:
cargo test --locked -p victory-hle: 153/153 unit (includingxgamesave12/12 withno_version_above_the_highest_number_is_refused_and_kept) + 2/2 integration tests passedcargo clippy --all-targets -p victory-hle -- -D warnings+cargo xtask policy(191 files ok): 0 warnings
…no number wraps Three more ways the committed save could be lost or become unreachable, found in open PRs of the family and reviewed against our code: - Removing unfinished or superseded versions no longer fails the read or the update. A virus scanner or the search index holding a file open (os errors 32 and 4395 are seen, the latter when the title is started from an app whose AppData is a redirected package copy) made `remove_dir_all(...)?` fail, and `containers` then dropped the container: the title saw no save and started a new game. The stale folder now stays for the next look; committing a version retries for up to a second where Windows reports the folder held (PR Marvisak#1838, adamMasMusic; same defect as BESTegolol ca800f5434). - A version counts only if every blob its manifest names is a file there. A newer version left without a blob (a crash, a partial copy) used to win and the last complete one was removed (PR Marvisak#1981, WerG0D). - A stray `v18446744073709551615` left no number above it: `+ 1` wrapped to `v0`, which is not read, and the update then removed the committed version. Such an update is refused before anything is written (PR Marvisak#2511, Creaa). Each comes with its test. Nothing here deletes more than before: every removal that remains happens after the surviving version was read whole. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…er is above the highest (Marvisak#2497)
|
Independent verification (Windows, Rust 1.100.0/MSVC, head b730d1e, synthetic save directories only, no game data):
AI-assisted (Hy4 flash). GPU/driver: N/A (CPU only). Did not replay a real title save. |
…version number is above the highest (Marvisak#2497)
An update whose container folder holds a stray
v18446744073709551615next to a committedv1lost the save in release builds: the next version numberhighest + 1wrapped to 0, the update committedv0(not a canonical version, so reads ignore it), returnedS_OKand removedv1. In debug builds it panicked on the addition. The update is now refused withNO_ACCESS(what an unreadable container already returns) before anything is written or removed. Fixes #2497.What is in it
crates/victory-hle/src/modules/xgamesave.rs:Update::submittakes the next number withhighest.checked_add(1)and returnsNO_ACCESSwhen there is none.no_version_above_the_highest_number_is_refused_and_kept: a committedv1and a strayv18446744073709551615; the update returnsNO_ACCESS, the save reads as before,v1stays and nov0appears.Tested
xgamesave.rs:511), release fails withleft: 0, right: -2138898430(S_OKinstead ofNO_ACCESS). With the fix it passes in both; the 12xgamesavetests pass in debug and release.cargo clippy --workspace --all-targets --locked -- -D warnings: clean.cargo test --workspace --locked --no-fail-fast: 697 passed, 5 failed, 10 ignored. The 5 fail the same way onmain940d32fon this NVIDIA card and are outside this change:victory-gpudynamic_slots_are_held_until_released,lists_share_a_table_and_copies_keep_their_views;victory-shadera_heap_buffer_read_by_element_takes_the_views_stride,a_heap_buffer_read_where_no_buffer_view_is_reads_zeros,gathers_at_a_level_match_the_hardware(the same five as in Test report: RTX 5070 (Blackwell), Windows 11, 70564ae: 471 passed, 5 failed, 7 ignored (4 from the 1,000,000 view heap cap) #1744 on an RTX 5070).Not tested
AI use
🤖 Generated with Claude Code