XGameRuntime: save blobs beyond the Windows path limit #1836

Open
gloger2003 wants to merge 1 commit from upstream-pr/1846 into main
gloger2003 commented 2026-11-24 21:44:43 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by gloger2003 on 2026-11-24T21:44:43Z.


Fixes #722. XGameSave could write the sibling temporary file, then fail to move it into place when the save path exceeded Windows' legacy path limit. Normalize the paths and pass their extended-length forms to the existing atomic replace.

What is in it

  • gamesave.rs preserves the existing replace and write-through flags, and tests creating and replacing a long-path blob and converting Windows path forms.
  • README.md notes that long Windows save paths are supported.

Tested

  • Radeon RX 7800 XT (driver 32.0.32029.2010), Ryzen 7 5700X, Windows 11 build 26300.9974, Rust 1.100.0 MSVC, DXC 1.9.2602.17. Debug tests and release title runs.
  • The new long-path regression failed on the base with E_FAIL. All 12 XGameSave tests passed with the change.
  • cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --show-output: 891 passed, 0 failed, 42 ignored. The heap-window fallback test skipped with the opt-in off and passed in a separate real-GPU run with heap windows enabled.

Regression run
Minecraft Preview, the same 1× MSAA settings in both runs. The baseline's first run with default settings stopped at startup after a device removal.

xcl-smoke v1
commit: b9b6ea62080cc62fc19e212033372d01c6214e5c
gpu: AMD Radeon RX 7800 XT
title: Xbox-Series-1.18.3064.0
seconds: 30
exit: 0x0
frames shown: 1609 (PresentX 1609)
presents per 2 s (last 3): 120 120 120
device removals: 0
crashes: 0
peak commit: 3380 MB
xcl-smoke v1
commit: 20b51dc577d68963b0ddfcce310952777fa5c63c
gpu: AMD Radeon RX 7800 XT
title: Xbox-Series-1.18.3064.0
seconds: 30
exit: 0x0
frames shown: 1636 (PresentX 1636)
presents per 2 s (last 3): 120 120 120
device removals: 0
crashes: 0
peak commit: 3360 MB

Not tested

  • A live UNC share. The unit test checks UNC path conversion without connecting to a share.
  • The title run covers startup and rendering. The long-path save itself is covered by the local XGameSave test.

AI use

  • OpenAI Codex (GPT-6.2 Sol, high reasoning effort, Fast mode) reproduced the bug, wrote the fix and tests, ran validation, and drafted this description.
<!-- greyfinch-sync:ivall/xcl:issue:5480848805 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1846). Originally posted by [gloger2003](https://github.com/gloger2003) on 2026-11-24T21:44:43Z. --- Fixes #722. XGameSave could write the sibling temporary file, then fail to move it into place when the save path exceeded Windows' legacy path limit. Normalize the paths and pass their extended-length forms to the existing atomic replace. **What is in it** - `gamesave.rs` preserves the existing replace and write-through flags, and tests creating and replacing a long-path blob and converting Windows path forms. - `README.md` notes that long Windows save paths are supported. **Tested** - Radeon RX 7800 XT (driver 32.0.32029.2010), Ryzen 7 5700X, Windows 11 build 26300.9974, Rust 1.100.0 MSVC, DXC 1.9.2602.17. Debug tests and release title runs. - The new long-path regression failed on the base with `E_FAIL`. All 12 XGameSave tests passed with the change. - `cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --show-output`: 891 passed, 0 failed, 42 ignored. The heap-window fallback test skipped with the opt-in off and passed in a separate real-GPU run with heap windows enabled. **Regression run** Minecraft Preview, the same 1× MSAA settings in both runs. The baseline's first run with default settings stopped at startup after a device removal. ``` xcl-smoke v1 commit: b9b6ea62080cc62fc19e212033372d01c6214e5c gpu: AMD Radeon RX 7800 XT title: Xbox-Series-1.18.3064.0 seconds: 30 exit: 0x0 frames shown: 1609 (PresentX 1609) presents per 2 s (last 3): 120 120 120 device removals: 0 crashes: 0 peak commit: 3380 MB ``` ``` xcl-smoke v1 commit: 20b51dc577d68963b0ddfcce310952777fa5c63c gpu: AMD Radeon RX 7800 XT title: Xbox-Series-1.18.3064.0 seconds: 30 exit: 0x0 frames shown: 1636 (PresentX 1636) presents per 2 s (last 3): 120 120 120 device removals: 0 crashes: 0 peak commit: 3360 MB ``` **Not tested** - A live UNC share. The unit test checks UNC path conversion without connecting to a share. - The title run covers startup and rendering. The long-path save itself is covered by the local XGameSave test. **AI use** - OpenAI Codex (GPT-6.2 Sol, high reasoning effort, Fast mode) reproduced the bug, wrote the fix and tests, ran validation, and drafted this description.
frenziedcoder commented 2026-11-24 22:06:59 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by frenziedcoder on 2026-11-24T22:05:28Z.


NVIDIA test report for 20b51dc: full suite green, the PR's 2 own tests pass (atomic_save_creates_and_replaces_a_blob_past_max_path, move_paths_preserve_windows_path_forms), and a clean smoke pair on the retail title (1653 vs 1649 frames).

Tested

  • NVIDIA GeForce RTX 5080 16 GB (driver 617.14, 32-lane waves), AMD Ryzen 7 9800X3D, 64 GB, Windows 11 Pro 25H2 (26200.9974), rustc 1.100.0 stable-x86_64-pc-windows-msvc, DXC 1.8.2502.11 (SDK 10.0.26100.0). Exact head 20b51dc577d68963b0ddfcce310952777fa5c63c, no local changes.
  • cargo build --workspace && cargo test --workspace -- --test-threads=4 (debug): 891 passed, 0 failed, 42 ignored; the PR's 2 own tests pass (atomic_save_creates_and_replaces_a_blob_past_max_path, move_paths_preserve_windows_path_forms). SKIPPED: gpu_geometry_wave32_prefix_count_over_a_mask (no wave64), gpu_wave32_program_in_wave64_hardware (no wave64), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • test_title_draws_with_a_root_signature_under_the_debug_layer reports ok, but this machine has no D3D12 debug layer (debug layer requested but unavailable … (0x887A002D)), so it ran without the layer and is no evidence either way.

Regression run (scripts/smoke.ps1 -Seconds 60, release, the retail title of #505 at its start screen; XCL_PSO_PRELOAD=0 for both builds, because this machine's preload list holds the program of #1307)

base (b9b6ea6, this PR's merge base with main):

xcl-smoke v1
commit: b9b6ea62080cc62fc19e212033372d01c6214e5c
gpu: NVIDIA GeForce RTX 5080
title: RetailTitle
seconds: 60
exit: 0x0
frames shown: 1649 (PresentX 1649)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14603 MB

this PR:

xcl-smoke v1
commit: 20b51dc577d68963b0ddfcce310952777fa5c63c
gpu: NVIDIA GeForce RTX 5080
title: RetailTitle
seconds: 60
exit: 0x0
frames shown: 1653 (PresentX 1653)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14602 MB

Not tested: the world load (the smoke runs stop at the start screen, so code that only runs later is not exercised there); AMD.

AI use: Claude Code (Claude Opus 5.5) built and ran the tests and smoke runs on my machine and wrote this report; I checked it.

<!-- greyfinch-sync:ivall/xcl:comment:7145789949 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1846#issuecomment-7145789949). Originally posted by [frenziedcoder](https://github.com/frenziedcoder) on 2026-11-24T22:05:28Z. --- **NVIDIA test report for `20b51dc`: full suite green, the PR's 2 own tests pass (`atomic_save_creates_and_replaces_a_blob_past_max_path`, `move_paths_preserve_windows_path_forms`), and a clean smoke pair on the retail title (1653 vs 1649 frames).** **Tested** - NVIDIA GeForce RTX 5080 16 GB (driver 617.14, 32-lane waves), AMD Ryzen 7 9800X3D, 64 GB, Windows 11 Pro 25H2 (26200.9974), rustc 1.100.0 `stable-x86_64-pc-windows-msvc`, DXC 1.8.2502.11 (SDK 10.0.26100.0). Exact head `20b51dc577d68963b0ddfcce310952777fa5c63c`, no local changes. - `cargo build --workspace && cargo test --workspace -- --test-threads=4` (debug): **891 passed, 0 failed, 42 ignored**; the PR's 2 own tests pass (`atomic_save_creates_and_replaces_a_blob_past_max_path`, `move_paths_preserve_windows_path_forms`). SKIPPED: `gpu_geometry_wave32_prefix_count_over_a_mask` (no wave64), `gpu_wave32_program_in_wave64_hardware` (no wave64), `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). - `test_title_draws_with_a_root_signature_under_the_debug_layer` reports ok, but this machine has no D3D12 debug layer (`debug layer requested but unavailable … (0x887A002D)`), so it ran without the layer and is no evidence either way. **Regression run** (`scripts/smoke.ps1 -Seconds 60`, release, the retail title of #505 at its start screen; `XCL_PSO_PRELOAD=0` for both builds, because this machine's preload list holds the program of #1307) base (`b9b6ea6`, this PR's merge base with `main`): ``` xcl-smoke v1 commit: b9b6ea62080cc62fc19e212033372d01c6214e5c gpu: NVIDIA GeForce RTX 5080 title: RetailTitle seconds: 60 exit: 0x0 frames shown: 1649 (PresentX 1649) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14603 MB ``` this PR: ``` xcl-smoke v1 commit: 20b51dc577d68963b0ddfcce310952777fa5c63c gpu: NVIDIA GeForce RTX 5080 title: RetailTitle seconds: 60 exit: 0x0 frames shown: 1653 (PresentX 1653) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14602 MB ``` **Not tested:** the world load (the smoke runs stop at the start screen, so code that only runs later is not exercised there); AMD. *AI use: Claude Code (Claude Opus 5.5) built and ran the tests and smoke runs on my machine and wrote this report; I checked it.*
DavidM1911 commented 2026-11-25 02:08:43 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T01:15:34Z.


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

  • cargo test -p xcl --lib: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7149365571 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1846#issuecomment-7149365571). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T01:15:34Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
JJAutoCompare commented 2026-11-25 03:05:59 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T03:02:38Z.


PR #1846 — XGameRuntime long-path save verification

Verified 20b51dc577d68963b0ddfcce310952777fa5c63c on STOR-WINLAB. The PR supplies absolute, extended-length Windows paths for both operands of the atomic MoveFileExW blob replacement.

Environment

Windows 11 Enterprise Evaluation build 26200.9974, Ryzen 7 3800X, Intel Arc A770 16 GiB (driver 32.0.101.9175, DoublePrecisionFloatShaderOps=0, wave sizes 8–32). Rust 1.100.0 (0ef1bc386), DXC/DXIL 1.9.2609.5. Debug/test profiles with debug info and incremental compilation disabled. XCL_ADAPTER=A770.

Tested

  • cargo build --workspace and cargo test --workspace --no-run both passed.
  • cargo test -p xcl hle::xgameruntime::gamesave::tests:: -- --nocapture — 12 passed, 0 failed, 0 ignored. Both new tests also passed in the workspace suite. atomic_save_creates_and_replaces_a_blob_past_max_path verified both writes returned S_OK and read back the expected bytes at a path of at least 260 UTF-16 code units. move_paths_preserve_windows_path_forms verified drive-path normalization and conversion or preservation of UNC path strings.
  • cargo test --workspace --no-fail-fast -- --test-threads=4 ran once under the shared Arc lock and exited 101. Summed across 20 harness summaries, Cargo reported 873 passed, 18 failed, 42 ignored. The log contains 4 SKIPPED lines. Those tests contributed to Cargo's pass count and provide no coverage.

Failures and skips

  • 17 GPU library failures. 13 returned 0x80070057 from CreateComputePipelineState, including FP64 cases. Four had result mismatches in FMA, mip sampling, FP16 high-half preservation, and whole-wave reductions.
  • The bundled-title E2E test failed its dynamic depth-bias check (blue pixel, expected green). The title log also recorded an XAudio2 mastering-voice error (0x80070490).
  • Logged skips comprised two wave64 cases, one driver-cache measurement, and one heap-window fallback case.

Not tested

Live UNC writes, retail-title smoke on main or PR head, optional game samples, other GPUs, and D3D12 debug-layer coverage (missing d3d12SDKLayers.dll). No baseline suite was run to establish whether the failures predate the PR.

AI use

T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr1846-suite.log and published this report.

<!-- greyfinch-sync:ivall/xcl:comment:7151533136 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1846#issuecomment-7151533136). Originally posted by [JJAutoCompare](https://github.com/JJAutoCompare) on 2026-11-25T03:02:38Z. --- # PR #1846 — XGameRuntime long-path save verification Verified `20b51dc577d68963b0ddfcce310952777fa5c63c` on STOR-WINLAB. The PR supplies absolute, extended-length Windows paths for both operands of the atomic `MoveFileExW` blob replacement. **Environment** Windows 11 Enterprise Evaluation build 26200.9974, Ryzen 7 3800X, Intel Arc A770 16 GiB (driver 32.0.101.9175, `DoublePrecisionFloatShaderOps=0`, wave sizes 8–32). Rust 1.100.0 (`0ef1bc386`), DXC/DXIL 1.9.2609.5. Debug/test profiles with debug info and incremental compilation disabled. `XCL_ADAPTER=A770`. **Tested** - `cargo build --workspace` and `cargo test --workspace --no-run` both passed. - `cargo test -p xcl hle::xgameruntime::gamesave::tests:: -- --nocapture` — 12 passed, 0 failed, 0 ignored. Both new tests also passed in the workspace suite. `atomic_save_creates_and_replaces_a_blob_past_max_path` verified both writes returned `S_OK` and read back the expected bytes at a path of at least 260 UTF-16 code units. `move_paths_preserve_windows_path_forms` verified drive-path normalization and conversion or preservation of UNC path strings. - `cargo test --workspace --no-fail-fast -- --test-threads=4` ran once under the shared Arc lock and exited 101. Summed across 20 harness summaries, Cargo reported **873 passed, 18 failed, 42 ignored**. The log contains **4 `SKIPPED ` lines**. Those tests contributed to Cargo's pass count and provide no coverage. **Failures and skips** - 17 GPU library failures. 13 returned `0x80070057` from `CreateComputePipelineState`, including FP64 cases. Four had result mismatches in FMA, mip sampling, FP16 high-half preservation, and whole-wave reductions. - The bundled-title E2E test failed its dynamic depth-bias check (blue pixel, expected green). The title log also recorded an XAudio2 mastering-voice error (`0x80070490`). - Logged skips comprised two wave64 cases, one driver-cache measurement, and one heap-window fallback case. **Not tested** Live UNC writes, retail-title smoke on main or PR head, optional game samples, other GPUs, and D3D12 debug-layer coverage (missing `d3d12SDKLayers.dll`). No baseline suite was run to establish whether the failures predate the PR. **AI use** T3 Code / Codex (`gpt-6.2-sol`, `reasoningEffort: high`) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, `gemini-4-neon`) verified counts against `pr1846-suite.log` and published this report.
github-actions[bot] commented 2026-11-28 08:01:29 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-28T08:01:29Z.


Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

<!-- greyfinch-sync:ivall/xcl:comment:7236311845 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1846#issuecomment-7236311845). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-28T08:01:29Z. --- Nothing has happened on this PR for 3 days, so it is marked `stale` and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto `main` if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.
Foniass commented 2026-12-01 06:58:16 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T06:58:16Z.


Triage (#1607) – head 20b51dc

The only other PR for #722 was #922, which is now closed. Main's replace_file in gamesave.rs still passes plain paths to MoveFileExW, so the fix is not on main yet. move_path adds \\?\ / \\?\UNC\ after std::path::absolute and leaves verbatim paths alone, and the long-path test creates and replaces a blob past 260 characters. No problems found in the diff. The branch conflicts with main and needs a rebase.
Recommendation: keep open.

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

<!-- greyfinch-sync:ivall/xcl:comment:7303493707 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1846#issuecomment-7303493707). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T06:58:16Z. --- **Triage (#1607)** – head 20b51dc The only other PR for #722 was #922, which is now closed. Main's `replace_file` in `gamesave.rs` still passes plain paths to `MoveFileExW`, so the fix is not on main yet. `move_path` adds `\\?\` / `\\?\UNC\` after `std::path::absolute` and leaves verbatim paths alone, and the long-path test creates and replaces a blob past 260 characters. No problems found in the diff. The branch conflicts with main and needs a rebase. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1846:upstream-pr/1846'
git switch 'upstream-pr/1846'

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.

git switch 'main'
git merge --no-ff 'upstream-pr/1846'
git switch 'upstream-pr/1846'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1846'
git switch 'upstream-pr/1846'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1846'
git switch 'main'
git merge --squash 'upstream-pr/1846'
git switch 'main'
git merge --ff-only 'upstream-pr/1846'
git switch 'main'
git merge 'upstream-pr/1846'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!1836
No description provided.