Skip to content

XGameRuntime: ignore mixed-case game-save temp files - #2373

Open
mokkamokacaffe wants to merge 1 commit into
xcl-dev:mainfrom
mokkamokacaffe:xgameruntime/case-insensitive-temp-blobs
Open

mokkamokacaffe wants to merge 1 commit into
xcl-dev:mainfrom
mokkamokacaffe:xgameruntime/case-insensitive-temp-blobs

Conversation

@mokkamokacaffe

@mokkamokacaffe mokkamokacaffe commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

blobs_of filtered atomic-write temporary files case-sensitively even though Windows filesystems compare their names case-insensitively. An uppercase ~XCLTMP.* crash leftover could therefore appear as a title-visible save blob and affect enumeration and quota accounting.

Fixes #2366.

What is in it

  • crates/xcl/src/hle/xgameruntime/gamesave.rs: use the existing ASCII-insensitive prefix helper when excluding atomic-write temporary files.
  • Extend the existing atomic-write regression test with lowercase and uppercase crash leftovers while retaining valid encoded ~xcltmp.* blob coverage.

Tested

  • Ritolino tested head f6a2573d merged onto 8b957bec on the Windows NTFS machine that reproduced XGameRuntime: blob_enumeration_sees_one_submitted_update fails on Windows NTFS (DirEntry::metadata cache) #2421. All 11 game-save tests passed and blob enumeration passed 10/10 repetitions. The separate barrier failure reproduced on both the original head and parent, then passed on both sides after the upstream assertion correction. NTFS repetitions · Paired barrier controls

  • Linux compile-only: cargo check -p xcl --lib --tests --target x86_64-pc-windows-msvc passed; Windows test binaries were not executed in this run.

  • Windows 11 Pro build 26300, Intel Core i7-11800H, NVIDIA GeForce RTX 3070 Laptop GPU, exact head f6a2573d02dc10a50ca23d6084083955143cb1a6: cargo test -p xcl --lib gamesave — 11 passed, 0 failed, 0 ignored. The original blob_enumeration_sees_one_submitted_update reproduction passed.

  • Windows 11 on NTFS, NVIDIA GeForce RTX 5070 12 GB (driver 621.35, wave32), DXC 1.8.2502.11 / Windows SDK 10.0.26100.0, exact head f6a2573: cargo test -p xcl --lib gamesave — 11 passed, 0 failed, including the atomic-write and case-insensitive enumeration regressions.

  • On that RTX 5070, cargo test -p xcl --lib both in parallel and with --test-threads=1: 1215 passed, 5 failed, 26 ignored. The failures were the four DXIL fuzz tests (CreateComputePipelineState: E_OUTOFMEMORY) and the existing bridged-mask barrier assertion. Reported skips: 13 no-wave64, 3 unsupported per-lane VOP3-modifier cases, and 1 driver-cache test requiring Windows Developer Mode.

  • Windows 11, NVIDIA GeForce RTX 3060 Ti, with this branch merged into then-current main: cargo test -p xcl --lib reported 1219 passed, 1 failed. The deterministic failure was gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier, outside this PR's game-save code; the focused game-save suites above remained green.

Regression run

Main ran first, followed by the exact PR #2373 head. Each run used its own release build and stock smoke script. Both worktrees were clean immediately before launch, and the starting caches had identical SHA-256 indexes across all 31,056 files. Both runs exited normally with zero crashes and zero device removals. The PR showed 925 frames against main’s 1,144 (80.9%).

Main

xcl-smoke v1
commit: 06f90c1986f43698d0405eff3c2ab0af230e1ed9
gpu: NVIDIA GeForce RTX 4080 SUPER
title: retail-local
seconds: 60
exit: 0x0
frames shown: 1144 (PresentX 1144)
presents per 2 s (last 3): 53 28 33
device removals: 0
crashes: 0
peak commit: 14960 MB

PR #2373

xcl-smoke v1
commit: f6a2573d02dc10a50ca23d6084083955143cb1a6
gpu: NVIDIA GeForce RTX 4080 SUPER
title: retail-local
seconds: 60
exit: 0x0
frames shown: 925 (PresentX 925)
presents per 2 s (last 3): 47 45 53
device removals: 0
crashes: 0
peak commit: 14799 MB

Not tested

  • A passing full cargo test --workspace -- --test-threads=4 run on PR head f6a2573d.
  • Runtime behavior on AMD or Intel GPUs.
  • Runtime behavior under Linux/Wine or Proton.

AI use

  • OpenAI Codex with GPT-5 implemented the fix and regression coverage, reviewed the diff, compiled the Windows target and drafted this description.
  • The RTX 3070 Laptop test report was run and drafted with Antigravity (Gemini 4 Neon), then reviewed by its contributor.

Windows filesystems compare names case-insensitively, but blob enumeration filtered the atomic-write prefix case-sensitively. Reuse the existing ASCII-insensitive prefix helper and cover both lowercase and uppercase crash leftovers.\n\nFixes xcl-dev#2366\n\nAssisted-by: OpenAI Codex (GPT-5)
@ahmetbagci8

Copy link
Copy Markdown

Verified on the Windows 11 machine where #2366 reproduced.

Tested

  • Commit: f6a2573d02dc10a50ca23d6084083955143cb1a6
  • Hardware / OS: Intel Core i7-11800H, NVIDIA GeForce RTX 3070 Laptop GPU, Windows 11 Pro (Build 26300)
  • cargo test -p xcl --lib gamesave: 11 passed; 0 failed; 0 ignored (1.09s) — blob_enumeration_sees_one_submitted_update now passes cleanly.

Not tested

  • Full workspace suite and scripts/smoke.ps1.

AI use

  • Antigravity harness (Gemini 4 Neon) ran cargo test -p xcl --lib gamesave on this commit and drafted this report; the author reviewed it before posting.

@FIJI1299

Copy link
Copy Markdown

Tested commit f6a2573 on Windows:

Environment

  • OS: Windows 11 (NTFS)
  • GPU: NVIDIA GeForce RTX 5070 (12 GB VRAM, driver 621.35, wave32)
  • DXC: 1.8.2502.11 (Windows SDK 10.0.26100.0)

Results

  • hle::xgameruntime::gamesave tests (cargo test -p xcl --lib gamesave): 11 passed, 0 failed (including atomic_writes_preserve_xcltmp_blobs_and_skip_leftover_temps and case_insensitive_blob_and_container_matching_on_ntfs).
  • Full library test suite (cargo test -p xcl --lib): 1215 passed, 5 failed, 26 ignored (both parallel and with --test-threads=1).
  • Unrelated failures (all in gpu::*):
    • gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3: CreateComputePipelineState returned E_OUTOFMEMORY (0x8007000E) on this driver.
    • gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier: assertion failed (left: 3, right: 1 group barriers).
  • GPU tests skipped on this adapter:
    • 13 (no wave64)
    • 3 (wave32, per-lane form: refused (unsupported V_CVT_F16_F32 / V_MUL_F16 / V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's)))
    • 1 (cannot disable the driver cache (Windows Developer Mode is required): 0x887A002D)

@DavidM1911

Copy link
Copy Markdown
Contributor

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: 1 real failure, deterministic (also fails --test-threads=1, 1219/1):
gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier
  assertion failed: group barriers in the program (lower_dxil.rs:1155)

The lowered program is missing an expected group barrier (or emits one where none is expected). Needs a fix before merge.

— Devin

rootw0rm pushed a commit to rootw0rm/xcl that referenced this pull request Nov 26, 2026
@Ritolino

Copy link
Copy Markdown
Contributor

Independent Windows 11 x64 verification of #2373 head f6a2573d merged cleanly onto current main (8b957bec) on the machine where #2421 (blob_enumeration_sees_one_submitted_update) reproduces reliably (failing on main and still failing 3/5 runs on #2521 due to an uppercase ~XCLTMP.<pid>.<id>.tmp file bypassing starts_with(~xcltmp.)):

Tested

  • Windows 11 x64, AMD Ryzen 9 7950X, NVIDIA GeForce RTX 4080 (wave32), rustc 1.100.0 (stable-x86_64-pc-windows-msvc), debug
  • cargo test -p xcl --lib gamesave::tests: 11 passed, 0 failed, 0 ignored
  • cargo test -p xcl --lib blob_enumeration_sees_one_submitted_update (10 consecutive runs): 10/10 passed, 0/10 failed

This confirms #2373 resolves the #2421 failure on Windows NTFS.

AI use: Antigravity with Gemini 4 Hydrogen (Medium) ran the merge/test loop and drafted this report; reviewed by human.

@mokkamokacaffe

Copy link
Copy Markdown
Contributor Author

I reproduced the reported shader-barrier failure on both the original PR head and its unchanged parent. Both counted 3 barriers where the test expected 1. The paired results show that the failure predates this game-save change.

Tested

Windows 11, NVIDIA GeForce RTX 4080 SUPER, DXC/DXIL 1.9.2609.5, debug test profile. Each run used a separate detached worktree and one test thread.

Revision Shader-barrier regression Game-save suite
Original parent 68a284a5 Failed, expected 1 and counted 3 Not run
PR head f6a2573d Failed, expected 1 and counted 3 11 passed, 0 failed
Test merge’s first parent fa671a2f 1 passed Not run
GitHub test merge 3ceabd59 1 passed 11 passed, 0 failed

The newer pair includes an upstream correction that checks for zero barriers after the divergent entry branch. The corrected assertion passed with and without this PR. Upstream test correction

Both game-save runs passed atomic_writes_preserve_xcltmp_blobs_and_skip_leftover_temps and blob_enumeration_sees_one_submitted_update. The atomic-write test covers uppercase and lowercase temporary-file leftovers and checks that a legitimately named save blob remains visible.

Commands used:

cargo test --locked -p xcl --lib gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier -- --exact --test-threads=1
cargo test --locked -p xcl --lib gamesave::tests -- --test-threads=1

Not tested

Full workspace suite and retail smoke in this verification.

AI use

OpenAI Codex (GPT-6) ran the checks, compared the assertions across revisions, and drafted this comment.

@mokkamokacaffe
mokkamokacaffe marked this pull request as ready for review November 27, 2026 12:49
@github-actions github-actions Bot added the area:hle kernelx, XGameRuntime, XAudio2, VFS, PE loader, TLS, EH label Nov 29, 2026
@Foniass

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Triage (#1607) – head f6a2573

No open or merged PR makes the same change: main's blobs_of in crates/xcl/src/hle/xgameruntime/gamesave.rs still filters TMP_PREFIX case-sensitively, and #2521 / #543 do not touch that filter. The fix reuses the existing starts_with_ignore_ascii_case, and the test adds an upper-case ~XCLTMP. leftover that would be listed as a blob without the fix. No problems found in the diff.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:hle kernelx, XGameRuntime, XAudio2, VFS, PE loader, TLS, EH

Projects

None yet

Development

Successfully merging this pull request may close these issues.

XGameRuntime: blobs_of filters ~xcltmp. case-sensitively, leaking uppercase temp files on Windows

6 participants