XGameRuntime: refresh blob sizes after replacement (#2421) #2521

Open
github-bot wants to merge 1 commit from github-bot/gh-2521 into main AGit
Owner

@⁠luckyteagirl on GitHub · 2026-11-25 21:26 UTC · original
luckyteagirl:codex/xgameruntime-blobs-metadata → main · +38 −1 · 1 files · 1 commits · open

Fixes #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 with std::fs::metadata and add a Windows-only saved-DirEntry regression test.

Tested

  • Windows 11 Home build 26200; AMD Ryzen 9 5980HX; AMD Radeon RX 6800M, driver 30.0.13002.13003; Rust 1.99.0 / Cargo 1.99.0; debug test profile and release build.
  • Guarded release builds on main (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).
  • Negative control: temporarily restored 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.
  • Independent RTX 3080 Ti report on the same exact head: cargo build --workspace passed; cargo test --workspace --no-fail-fast -- --test-threads=4 completed 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

  • The paired 5-second main and PR-head runs below used the same local title (hash 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.
xcl-smoke v1
commit: 6d12f58a229bc73889878a448c64dc3af25eeba0
gpu: AMD Radeon RX 6800M
title: 2ef5fd64
seconds: 5
exit: 0x0
frames shown: 0 (PresentX 0)
presents per 2 s (last 3): 0 0
device removals: 0
crashes: 0
peak commit: 6555 MB
xcl-smoke v1
commit: c5f68eddf00db07ada4c5cddedabddf9c7eff300
gpu: AMD Radeon RX 6800M
title: 2ef5fd64
seconds: 5
exit: 0x0
frames shown: 0 (PresentX 0)
presents per 2 s (last 3): 0 0
device removals: 0
crashes: 0
peak commit: 6555 MB

Not tested

  • A full workspace suite on our RX 6800M; the independent RTX 3080 Ti suite skipped 25 GPU tests.
  • The retail title's blob-enumeration path, since the paired smoke runs showed no frames; other GPUs and Windows configurations.

AI use

  • OpenAI Codex, GPT-6 (exact model variant unavailable), implemented the fix and regression test, ran the focused checks, and drafted this description.
  • OpenAI Codex (GPT-6.2 Astra) verified the independent exact-head report and added its linked results to this description.
**@⁠luckyteagirl** on GitHub · 2026-11-25 21:26 UTC · [original](https://github.com/xcl-dev/xcl/pull/2521) `luckyteagirl:codex/xgameruntime-blobs-metadata` → `main` · +38 −1 · 1 files · 1 commits · open Fixes #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 with `std::fs::metadata` and add a Windows-only saved-`DirEntry` regression test. **Tested** - Windows 11 Home build 26200; AMD Ryzen 9 5980HX; AMD Radeon RX 6800M, driver 30.0.13002.13003; Rust 1.99.0 / Cargo 1.99.0; debug test profile and release build. - Guarded release builds on main (`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). - Negative control: temporarily restored `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. - Independent [RTX 3080 Ti report on the same exact head](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2521): `cargo build --workspace` passed; `cargo test --workspace --no-fail-fast -- --test-threads=4` completed 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** - The paired 5-second main and PR-head runs below used the same local title (hash `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. ```text xcl-smoke v1 commit: 6d12f58a229bc73889878a448c64dc3af25eeba0 gpu: AMD Radeon RX 6800M title: 2ef5fd64 seconds: 5 exit: 0x0 frames shown: 0 (PresentX 0) presents per 2 s (last 3): 0 0 device removals: 0 crashes: 0 peak commit: 6555 MB ``` ```text xcl-smoke v1 commit: c5f68eddf00db07ada4c5cddedabddf9c7eff300 gpu: AMD Radeon RX 6800M title: 2ef5fd64 seconds: 5 exit: 0x0 frames shown: 0 (PresentX 0) presents per 2 s (last 3): 0 0 device removals: 0 crashes: 0 peak commit: 6555 MB ``` **Not tested** - A full workspace suite on our RX 6800M; the independent RTX 3080 Ti suite skipped 25 GPU tests. - The retail title's blob-enumeration path, since the paired smoke runs showed no frames; other GPUs and Windows configurations. **AI use** - OpenAI Codex, GPT-6 (exact model variant unavailable), implemented the fix and regression test, ran the focused checks, and drafted this description. - OpenAI Codex (GPT-6.2 Astra) verified the independent exact-head report and added its linked results to this description.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:32:48 +00:00
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 21:42 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!

**@⁠DavidM1911** on GitHub · 2026-11-25 21:42 UTC · [original](https://github.com/xcl-dev/xcl/pull/2521#issuecomment-7175433566) 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!
Author
Owner

@⁠fromthemoonx on GitHub · 2026-11-25 22:35 UTC · original

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 on main here (40 of 40 pass). So this machine shows the stale-size effect only through the new test.

Tested: c5f68ed merged onto main e1d84b7 (clean; the only difference from the PR's base 6d12f58 is a README change). RTX 3060 12 GB (driver 610.88), Ryzen 7 5700X, Windows 11 Pro 26300, NTFS, Rust 1.100.0 MSVC, debug.

result
cargo test --workspace --no-fail-fast -- --test-threads=4 1424 passed, 0 failed, 46 ignored; 25 SKIPPED lines (no wave64, refused per-lane forms)
blob_entry_reports_replaced_file_size_from_path alone, 40 runs 40 of 40
blob_enumeration_sees_one_submitted_update alone, 40 runs: on main / with this PR 40 of 40 / 40 of 40
hle::xgameruntime::gamesave:: (12 tests), --test-threads=8, 30 runs 30 of 30
blob_info with e.metadata() instead of std::fs::metadata(&path) (scratch) the new test fails 3 of 3 at gamesave.rs:1175, left: 3, right: 11

Not 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.

**@⁠fromthemoonx** on GitHub · 2026-11-25 22:35 UTC · [original](https://github.com/xcl-dev/xcl/pull/2521#issuecomment-7176548205) **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 on `main` here (40 of 40 pass).** So this machine shows the stale-size effect only through the new test. **Tested:** `c5f68ed` merged onto `main` `e1d84b7` (clean; the only difference from the PR's base `6d12f58` is a README change). RTX 3060 12 GB (driver 610.88), Ryzen 7 5700X, Windows 11 Pro 26300, NTFS, Rust 1.100.0 MSVC, debug. | | result | |---|---| | `cargo test --workspace --no-fail-fast -- --test-threads=4` | 1424 passed, 0 failed, 46 ignored; 25 `SKIPPED` lines (`no wave64`, refused per-lane forms) | | `blob_entry_reports_replaced_file_size_from_path` alone, 40 runs | 40 of 40 | | `blob_enumeration_sees_one_submitted_update` alone, 40 runs: on `main` / with this PR | 40 of 40 / 40 of 40 | | `hle::xgameruntime::gamesave::` (12 tests), `--test-threads=8`, 30 runs | 30 of 30 | | `blob_info` with `e.metadata()` instead of `std::fs::metadata(&path)` (scratch) | the new test fails 3 of 3 at `gamesave.rs:1175`, `left: 3, right: 11` | **Not 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.
Author
Owner

@⁠SlopTart on GitHub · 2026-11-25 22:49 UTC · original

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 target x86_64-pc-windows-gnu run 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.

**@⁠SlopTart** on GitHub · 2026-11-25 22:49 UTC · [original](https://github.com/xcl-dev/xcl/pull/2521#issuecomment-7176837414) **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 target `x86_64-pc-windows-gnu` run 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.
Author
Owner

@⁠thehollowedone on GitHub · 2026-11-25 23:30 UTC · original

Independent Windows check of head c5f68ed. The saved-directory-entry regression and full workspace suite passed on this machine.

Tested

  • Windows 11 Pro build 26300; NVIDIA GeForce RTX 3080 Ti, driver 621.35; AMD Ryzen 7 9800X3D; Rust 1.99.1 MSVC; DXC/DXIL 1.8.2502.11; debug profile.
  • 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 explicit SKIPPED notices 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 and blob_enumeration_sees_one_submitted_update.
  • The PR head merges cleanly with main 08db802 in a local git merge-tree check; no merge commit was made.

Not tested

  • A retail title's blob-enumeration path or a paired title smoke run; AMD hardware. I did not run a negative control with the old metadata call, so this report establishes passing behavior on this head rather than an independent before/after reproduction.

AI use

  • Codex (GPT-6.2 Sol) inspected the diff, ran the commands above, checked the results, and drafted this report.
**@⁠thehollowedone** on GitHub · 2026-11-25 23:30 UTC · [original](https://github.com/xcl-dev/xcl/pull/2521#issuecomment-7177660455) Independent Windows check of [head `c5f68ed`](https://github.com/xcl-dev/xcl/commit/c5f68eddf00db07ada4c5cddedabddf9c7eff300). The saved-directory-entry regression and full workspace suite passed on this machine. **Tested** - Windows 11 Pro build 26300; NVIDIA GeForce RTX 3080 Ti, driver 621.35; AMD Ryzen 7 9800X3D; Rust 1.99.1 MSVC; DXC/DXIL 1.8.2502.11; debug profile. - `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 explicit `SKIPPED` notices 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 and `blob_enumeration_sees_one_submitted_update`. - The PR head merges cleanly with `main` `08db802` in a local `git merge-tree` check; no merge commit was made. **Not tested** - A retail title's blob-enumeration path or a paired title smoke run; AMD hardware. I did not run a negative control with the old metadata call, so this report establishes passing behavior on this head rather than an independent before/after reproduction. **AI use** - Codex (GPT-6.2 Sol) inspected the diff, ran the commands above, checked the results, and drafted this report.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2521/head:github-bot/gh-2521'
git switch 'github-bot/gh-2521'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2521'
git switch 'github-bot/gh-2521'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2521'
git switch 'github-bot/gh-2521'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2521'
git switch 'main'
git merge --squash 'github-bot/gh-2521'
git switch 'main'
git merge --ff-only 'github-bot/gh-2521'
git switch 'main'
git merge 'github-bot/gh-2521'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.