XGameRuntime: refresh blob sizes after replacement (#2421) #2511
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2521"
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?
Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-25T21:26:28Z.
Part of #2421. Read blob sizes from the file path after atomic replacement so Windows directory-entry metadata cannot report a stale size.
What is in it
crates/xcl/src/hle/xgameruntime/gamesave.rs: refresh blob sizes withstd::fs::metadataand add a Windows-only saved-DirEntryregression test.Tested
6d12f58a229bc73889878a448c64dc3af25eeba0) and this commit (c5f68eddf00db07ada4c5cddedabddf9c7eff300):cargo build --locked --release -p xcl -j 2, exit 0, memory/time guard not triggered. Logs:work-2421/logs/release-main.log,work-2421/logs/release-head.log.CARGO_BUILD_JOBS=2; isolated test target:work-2421/target.cargo test -p xcl --lib hle::xgameruntime::gamesave::tests::blob_entry_reports_replaced_file_size_from_path -- --exact: 1 passed, 0 failed, 0 ignored (1,324 filtered).cargo test -p xcl --lib hle::xgameruntime::gamesave::tests::blob_enumeration_sees_one_submitted_update -- --exact: 1 passed, 0 failed, 0 ignored (1,324 filtered).DirEntry::metadata(); the new test failed as expected (0 passed, 1 failed), reporting 3 bytes instead of 11. Restored the fix and reran both tests successfully.cargo build --workspacepassed;cargo test --workspace --no-fail-fast -- --test-threads=4completed with 1,424 passed, 0 failed, 46 ignored, and 25 explicit GPU skips (21 native-wave64, three refused per-lane, one heap-window). The saved-entry regression also passed. These are the independent reporter's results, not runs on our RX 6800M.git diff --check: passed.Regression run
2ef5fd64), adapter and duration. Both exited 0 with no device removals or crashes, but showed 0 frames; these runs covered startup only and did not reach blob enumeration. Two 7-second head attempts stopped at the unchanged 1 GiB memory guard (free commit 964 MB and 834 MB), so they produced no smoke block.Independent main:
Independent PR head:
Not tested
~XCLTMP.entry appeared. #2373 addresses that filter. A second report identified transient writerMoveFileExWfailures and a reader-thread lifetime hazard on panic. This PR addresses stale size metadata only.AI use
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T21:42:24Z.
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!
Imported from ivall/xcl. Originally posted by fromthemoonx on 2026-11-25T22:35:19Z.
Full suite on NVIDIA: passes. The new test fails with
DirEntry::metadata()put back (3 of 3,left: 3, right: 11), so it catches the stale size. But #2421's own test,blob_enumeration_sees_one_submitted_update, did not fail onmainhere (40 of 40 pass). So this machine shows the stale-size effect only through the new test.Tested:
c5f68edmerged ontomaine1d84b7(clean; the only difference from the PR's base6d12f58is a README change). RTX 3060 12 GB (driver 610.88), Ryzen 7 5700X, Windows 11 Pro 26300, NTFS, Rust 1.100.0 MSVC, debug.cargo test --workspace --no-fail-fast -- --test-threads=4SKIPPEDlines (no wave64, refused per-lane forms)blob_entry_reports_replaced_file_size_from_pathalone, 40 runsblob_enumeration_sees_one_submitted_updatealone, 40 runs: onmain/ with this PRhle::xgameruntime::gamesave::(12 tests),--test-threads=8, 30 runsblob_infowithe.metadata()instead ofstd::fs::metadata(&path)(scratch)gamesave.rs:1175,left: 3, right: 11Not tested: a title's save path, a release build, AMD.
AI use: Claude Code (Claude Opus 5.5) ran the tests and the scratch change, and wrote this report.
Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-25T22:49:54Z.
Tested: current PR head merged onto current
origin/main(clean), Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT (NAVI31), cargo targetx86_64-pc-windows-gnurun under wine-11.0 (Proton), rustc 1.94.0, vkd3d-proton 3.1 with the XCL patch, official MS DXC (binaries 2026-09-29).gpu_suite (cold cache): 164 passed / 3 failed, no crashes. The three are the known baseline on this lane (seed-1003 fuzz, mad/mac contraction, promoted-UAV-clear driver gap, PR #2490); none caused by this PR.Targeted run of
blob_entry_reports_replaced_file_size_from_path: passed. This is XGameRuntime, CPU-side; it runs fine under the Wine lane.Not tested: retail titles (no title data on this lane, counts only).
AI use: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting.
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-25T23:30:38Z.
Independent Windows check of head
c5f68ed. The saved-directory-entry regression and full workspace suite passed on this machine.Tested
cargo test -p xcl --lib hle::xgameruntime::gamesave::tests::blob_entry_reports_replaced_file_size_from_path -- --exact: 1 passed, 0 failed, 0 ignored.cargo build --workspace: passed.cargo test --workspace --no-fail-fast -- --test-threads=4: 1,424 passed, 0 failed, 46 ignored. The 25 explicitSKIPPEDnotices were 21 native-wave64 cases (unavailable on this GPU), three refused per-lane cases, and one unavailable heap-window case. The suite included both the new saved-entry test andblob_enumeration_sees_one_submitted_update.main08db802in a localgit merge-treecheck; no merge commit was made.Not tested
AI use
Imported from ivall/xcl. Originally posted by Ritolino on 2026-11-26T17:06:58Z.
Tested
c5f68edmerged cleanly ontomain(8b957bec) on the Windows 11 machine where#2421reproduces (NVIDIA GeForce RTX 4080,rustc 1.100.0, debug).hle::xgameruntime::gamesave::tests::blob_enumeration_sees_one_submitted_updatestill fails intermittently (3/5runs failed;blob_entry_reports_replaced_file_size_from_pathpassed).Printing
rowswhen the assertion trips shows that the failure is not a staleDirEntry::metadata()size —blobs_ofis enumerating an extra temp file (len=17) whose prefix is uppercase with a.tmpsuffix, bypassing the case-sensitivestarts_with(TMP_PREFIX)filter (~xcltmp.):(Likely related to
#2366/#2373, where case-insensitive filtering of~xcltmp.is still pending.)AI use: Antigravity with Gemini 4 Neon (Medium) and Gemini 4 Hydrogen (Medium) ran the diagnostic loop and drafted this report; reviewed by human.
Imported from ivall/xcl. Originally posted by Decodere on 2026-11-27T03:58:33Z.
Independent desktop NVIDIA verification of PR #2521 at head
c5f68eddf00db07ada4c5cddedabddf9c7eff300(1commit; exact parent & merge-base:6d12f58a229bc73889878a448c64dc3af25eeba0, pre-#2555ancestor ofmain).Environment
7956 MiBreported by D3D12), driver32.0.16.2114(NVIDIA621.14, WDDM 3.2)31.9 GiBusable), Windows 11 Home26200(NTFS, Developer Mode off)rustc 1.100.0 (0ef1bc386 2026-11-09)MSVC, DXC1.9.2609.5,--releaseTargeted release tests & build (
c5f68edd)cargo test --release -p xcl --lib blob_entry_reports_replaced_file_size_from_path -- --nocapture(3 consecutive runs)1 passed; 0 failed; 0 ignored; 1324 filtered out× 3 (0.01s× 3,0skipped; live Windows 11 NTFS verification)cargo test --release -p xcl --lib hle::xgameruntime::gamesave:: -- --test-threads=1(3 consecutive runs)12 passed; 0 failed; 0 ignored; 1313 filtered out× 3 (2.00s,1.09s,0.43s,0skipped)cargo build --release -p xcl1m 08s, exit0,0new warnings)Paired quiet 60 s retail smoke (
title: 29640639)Exact parent & merge-base (
6d12f58a229bc73889878a448c64dc3af25eeba0, cached baseline on the same machine):PR #2521 (
c5f68eddf00db07ada4c5cddedabddf9c7eff300):Runtime log observations (
xcl.log)9222log lines,0[ERROR]/ device-removal / panic lines (XGameRuntime: QueryApiImpl ... -> XGameSave: XCLinitialized cleanly;dxil_cache:460hits,0misses,0failures).19549 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped); last memory sample14011 MB committed by the process; video memory 6115 MB local, 4681 MB non-local.Limits of coverage
std::fs::metadata(&path)blob-size lookup after atomic file replacement (avoiding stale Windows NTFSDirEntry::metadata()sizes) was verified directly on Windows 11 NTFS viahle::xgameruntime::gamesave::tests::blob_entry_reports_replaced_file_size_from_path(3/3) and the fullhle::xgameruntime::gamesave::suite (12/12× 3).XGameSaveAPI binding non-regression (single-run frame/commit delta vs. cached parent reflects normal startup variance, not this PR); it did not drive an interactive in-title save-blob replacement and re-enumeration cycle.AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).
Imported from ivall/xcl. Originally posted by throny on 2026-11-28T13:55:30Z.
merge-check claim
head:
c5f68eddf0Imported from ivall/xcl. Originally posted by throny on 2026-11-28T14:12:23Z.
merge-check
base:
e13d6250head:
c5f68eddf0merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2131 passed, 10 failed, 48 ignored (26 SKIPPED lines). The 10 failures are the ones main itself has at
e13d6250on this GPU (#3093: the nine since #2959 and, since today, gpu::dxil::msaa_tests::direct_msaa_loads_precede_get_dimensions), the same set with and without this PR; base alone: 2130 passed, 10 failed, 48 ignored.review: the change itself is harmless (one metadata call per blob per enumeration), but by a tester's report in the thread it does not fix #2421: the test of that issue still fails in 3 of 5 runs with this PR, and the cause shown there is a temporary file with an upper-case prefix that gets past the case-sensitive prefix filter in blobs_of (main has a case-insensitive helper that blobs_of does not use). I did not reproduce this here; the suite passed once with it.
performance: negligible (save API only).
verdict: not yet: either include the case-insensitive filter, or change "Fixes #2421" to "Part of #2421".
hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).
Imported from ivall/xcl. Originally posted by relativespace2K on 2026-11-30T01:41:21Z.
merge-check
base:
53e85fb1head:
c5f68eddf0merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2789 passed, 6 failed, 49 ignored; failing: gpu::dxil::compact_tests::gpu_compact_form_with_micro_blocks_and_literal_table_runs_as_the_plain_form, gpu::recomp::pso::shader_cache_tests::console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk, hle::d3d12x::standin::tests::concurrent_shell_miss_reuses_winner_and_releases_loser_pipeline, ram_budget::tests::windows_takes_a_working_set_maximum_and_lifts_it, and two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs (in
--test gpu_two_pass_cache_e2e, so 5 failing tests give 6 failures). The same five fail on base53e85fb1alone (2788 passed, 6 failed, 49 ignored there), so none comes from this PR; its new test passed. 13 SKIPPED lines, all environmental: no D3D12 debug layer / d3d12SDKLayers.dll, no heap windows, no GPU_UPLOAD, per-lane f16/f32 forms refused.review: no blocking finding; 38 lines, one file, whole diff read.
blobs_ofnow stats the path instead of using theDirEntrysnapshot, which on Windows comes from the directory enumeration and can still carry the old size after an atomic replace; the size is what a save's blob list hands back, so the fix is in the right place, andunwrap_or(0)keeps the old fallback for a vanishing file. The new test takes aDirEntry, replaces the blob withwrite_atomicand asserts the reported size is the new one: that is exactly the stale case on Windows, and it is#[cfg(windows)]because elsewhere the entry is not cached that way. No duplicate: #2373/#2420/#2793/#2439 touch game-save enumeration for other reasons, none refreshes the size of a replaced blob. throny'snot yetasked either for the case-insensitive filter or for the description to sayPart of #2421: the description has saidPart of #2421.since 2026-11-27, before that check, and the mixed-case temp-file filter is a separate change (#2373), not part of #2421's root cause (the stale DirEntry size). I keep safe to merge on that basis; if the maintainers want the filter in the same PR, it is not in this diff.performance: one extra metadata call per blob when a container's blobs are listed (a handful per save operation), nothing per frame.
verdict: safe to merge
hardware / tool and model: AMD Radeon RX 6800 XT 16 GB (RDNA2, wave64), driver 32.0.21045.29003; Ryzen 5 5600, 32 GB RAM; Windows 10 IoT Enterprise LTSC 2024, 10.0.26100 build 26100.9974; Rust 1.100.0; DXC 1.9.2602.17; debug build. DeepSeek Harness coding agent, model DeepSeek V4.1 Flash.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:15:37Z.
Triage (#1607) – head
c5f68edNo open or merged PR makes the same change. Main moved the enumeration into
try_blobs_of(commit1028ba5), but it still sizes each blob withe.metadata()(theDirEntrysnapshot). #2979 changes only the enumeration test.No problems found in the diff. The rebase onto main needs
blob_info(or itsfs::metadata(path)call) moved intotry_blobs_of.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.