Skip to content

[upstream #1072] RPF: commit an extracted record past MAX_PATH with a verbatim path - #82

Closed
ufoptg wants to merge 1 commit into
mainfrom
upstream-pr/1072
Closed

ufoptg wants to merge 1 commit into
mainfrom
upstream-pr/1072

Conversation

@ufoptg

@ufoptg ufoptg commented Nov 24, 2026

Copy link
Copy Markdown
Owner

xcl rpf --extract ... --out <folder> writes each record through atomic_write_with, which moved its temporary file into place with MoveFileExW on the plain paths. That call fails with error 3 ("The system cannot find the path specified") for a path of MAX_PATH characters or more, although the folder and the temporary file exist; std's own file calls add the \\?\ prefix, this one did not. So an extraction into a deep output folder failed. move_path now gives MoveFileExW the absolute path, prefixed with \\?\ (or \\?\UNC\) when it is 260 characters or longer; shorter, verbatim and device paths are unchanged. The same mistake in the XGameSave code is xcl-dev#922's; this PR does not touch that file.

What is in it

  • crates/xcl/src/rpf.rs: move_path and its two uses in atomic_write_with (+68/-2 with tests).
  • Tests, same file: move_path_prefixes_only_what_is_past_max_path (drive, UNC, short, verbatim, verbatim UNC, device, the 259 and 260-character edges, .. folded) and atomic_write_commits_past_max_path (a real write into a 300+ character path; it fails with error 3 without the change).

Tested

Regression run

The change is in xcl rpf, which a title run does not reach, so this only shows that nothing else moved. After an unmeasured warm-up of each build, with no other build or title run on the machine, the runs alternated: head 446, main 447, main 445, head 444 frames; no device removals or crashes. The second pair is shown.

main:

xcl-smoke v1
commit: 6efdabcdaac93ce5cc123a85e85deba5d49cb294
gpu: AMD Radeon RX 6650 XT
title: retail
seconds: 60
exit: 0x0
frames shown: 445 (PresentX 451)
presents per 2 s (last 3): 59 41 0
device removals: 0
crashes: 0
peak commit: 15271 MB

This PR:

xcl-smoke v1
commit: 6de9cf7945400f125efe10bf14a5e8f80cde81f2
gpu: AMD Radeon RX 6650 XT
title: retail
seconds: 60
exit: 0x0
frames shown: 444 (PresentX 448)
presents per 2 s (last 3): 58 42 0
device removals: 0
crashes: 0
peak commit: 15268 MB

Not tested

AI use

  • Claude Code, Claude Sonnet 5.5 (claude-sonnet-5-5): wrote the change, the tests and this description, and ran the tests above.

Mirror of xcl-dev#1072 (auto-synced, do not edit).

atomic_write_with moved its temporary file into place with MoveFileExW on
the plain paths. That call fails with error 3 (path not found) for a path
of MAX_PATH characters or more, although the folder and the temporary file
exist (std's own file calls add the \\?\ prefix, this one does not). So
`xcl rpf --extract ... --out <deep folder>` failed on records whose output
path is 260 characters or longer.

move_path gives MoveFileExW the absolute path, prefixed with \\?\ (or
\\?\UNC\) when it is 260 characters or longer; shorter, verbatim and device
paths are unchanged.

Assisted-by: Claude Code (Claude Sonnet 5.5)
@ufoptg

ufoptg commented Nov 25, 2026

Copy link
Copy Markdown
Owner Author

Upstream PR xcl-dev#1072 was closed or merged.

@ufoptg ufoptg closed this Nov 25, 2026
@ufoptg
ufoptg deleted the upstream-pr/1072 branch November 25, 2026 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants