RPF: commit an extracted record past MAX_PATH with a verbatim path #1064
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1072"
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 iggyvilla on 2026-11-24T11:17:11Z.
xcl rpf --extract ... --out <folder>writes each record throughatomic_write_with, which moved its temporary file into place withMoveFileExWon the plain paths. That call fails with error 3 ("The system cannot find the path specified") for a path ofMAX_PATHcharacters 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_pathnow givesMoveFileExWthe 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 #922's; this PR does not touch that file.What is in it
crates/xcl/src/rpf.rs:move_pathand its two uses inatomic_write_with(+68/-2 with tests).move_path_prefixes_only_what_is_past_max_path(drive, UNC, short, verbatim, verbatim UNC, device, the 259 and 260-character edges,..folded) andatomic_write_commits_past_max_path(a real write into a 300+ character path; it fails with error 3 without the change).Tested
cargo test -p xcl --lib rpf::tests: 7 passed, 0 failed, 0 ignored. Without the changeatomic_write_commits_past_max_pathfails withOs { code: 3, kind: NotFound }.cargo test --workspace --no-fail-fast -- --test-threads=4on6de9cf7: 726 passed, 3 failed, 41 ignored, 0 SKIPPED. The 3 failures are the ones already onmain:placed_title_textures_share_vram_and_preserve_pixels(also fails alone; the packed-mip bug #470 fixes), andtransitions_apply_when_their_list_is_submittedandd32s8_targets_take_their_own_size_of_video_memory(PoisonErrorafter it; they pass alone; #673).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,main447,main445, head 444 frames; no device removals or crashes. The second pair is shown.main:This PR:
Not tested
xcl rpfon a real package into a deep folder (only the synthetic archive tests and the directatomic_writetest).MoveFileExWcallers (XGameSave: #922).AI use
claude-sonnet-5-5): wrote the change, the tests and this description, and ran the tests above.Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T14:25:06Z.
Full-suite run, since this PR has no test report yet. Tested exact head
6de9cf7(on its base6efdabc).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 729 passed, 0 failed, 41 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.move_path_prefixes_only_what_is_past_max_path,atomic_write_commits_past_max_path.Not tested
AI use
xcl preflight— the environment checks without starting a game #1057Imported from ivall/xcl. Originally posted by kacper-serewis on 2026-11-24T20:22:28Z.
On
6de9cf7, a destination in NT form (\??\C:\...\record.bin; short path, existing folder) fails:atomic_writeworks on the base6efdabcand returns error 123 (ERROR_INVALID_NAME) with the PR.Tested: Windows 11, debug, CPU only.
std::path::absolutetreats\??\as a root-relative path. Suggested, at the top ofmove_path:With it on
6de9cf7the test below and the PR's own pass (cargo test -p xcl --lib rpf::: 8 passed, 0 failed).Test (append to rpf.rs)
AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this comment; the suggested change was written with T3 Code (gpt-6.2-astra). I checked the points before posting.
upstream-sync referenced this pull request2026-11-24 23:06:49 +00:00
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T08:51:27Z.
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 throny on 2026-11-27T23:28:25Z.
merge-check claim
head:
6de9cf7945Imported from ivall/xcl. Originally posted by throny on 2026-11-27T23:41:25Z.
merge-check
base:
2c717a04head:
6de9cf7945merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 1468 passed, 0 failed, 47 ignored (26 SKIPPED lines); base alone: 1466 passed, 0 failed, 47 ignored (26 SKIPPED lines)
review: one open point from the thread, still on this head: a path given in the NT form (backslash, two question marks, backslash, then the drive) worked on main and fails with error 123 with this PR; the fix suggested there is not in the diff. Otherwise fine: the path is made absolute (which folds '..') before the verbatim prefix is added, UNC paths get the UNC form, verbatim and device paths are left alone; record names are still sanitised by extraction_path, which the PR does not change, so nothing can be written outside the extraction root.
performance: none (CLI extraction only).
verdict: not yet: handle the NT-form path (or say it is out of scope and have the maintainer accept that); small, I will re-check on a new head.
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 KOLESNiii on 2026-11-28T03:54:07Z.
merge-check claim
head:
6de9cf7945Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-28T04:06:02Z.
Tested
Clean
6de9cf7945400f125efe10bf14a5e8f80cde81f2on native Windows 11 25H2 build 26200.9974, Ryzen 7 3800X, fixed NTFS C: volume, and Rust 1.100.1 MSVC x64 debug. I reran the hash-pinned stockxcl.exeagainst two hash-verified synthetic archives.xcl.exe rpf <original.rpf> --extract Probe: --out <directory>used ordinary absolute C: paths. Both extracted payloads matched byte-for-byte at each resolved final path length of 259, 260, and 320 UTF-16 units, excluding the terminator.xcl.exe rpf <collision.rpf> --extract Probe: --out <same 320-unit case directory>preserved both original files and wrote the two new payloads byte-for-byte toProbe_Harbor.00000040andProbe_Meadow.00000075, at 329 UTF-16 units each.4 CLI cases passed, 0 failed or skipped. All four native processes exited 0 and reported two extractions each. Every destination contained exactly the expected files, with no temporary files left behind.
Not tested
NT-device paths, UNC paths, the base revision, release builds, XGameSave, retail packages or smoke, GPU execution, and the full workspace suite.
AI use
T3 Code through the Codex harness (
gpt-6.2-sol) verified the executable and synthetic inputs, ran the CLI checks, and wrote this report.Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-28T10:19:14Z.
merge-check
base:
e429936c10head:
6de9cf7945merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2128 passed, 9 failed, 48 ignored, 25 SKIPPED: 21 no wave64, 3 per-lane f16/f32 forms refused (#1426 semantics), 1 no heap windows; failing: gpu::dxil::module::split::tests::dispatch_chain_oversized_loop_matches_whole, gpu::dxil::module::split::tests::dispatch_chain_wave32_live_loops, gpu::dxil::module::split::tests::dispatch_chain_wave64_live_loops_and_exchange, gpu::recomp::heap_window_tests::gpu_heap_flat_reads_match_guarded_and_root_output, gpu::recomp::tests::gpu_compute_mode_dispatch_abi, gpu::recomp::tests::gpu_float_cas_uses_ieee_equality, test_title_draws_with_a_root_signature_under_the_debug_layer, test_title_runs_and_game_folder_is_untouched, test_title_runs_under_the_debug_layer_with_dred: these 9 fail on the base too (the base e429936c's suite, run alone on this PC with the same command: 2126 passed, 9 failed, 48 ignored, 25 SKIPPED, these same 9 failing), and each also failed when rerun alone on this merge (the two debug-layer e2e tests stop on the D3D12 debug layer rejecting a pixel shader as corrupt or unsigned, and test_title_runs_and_game_folder_is_untouched on the test title's console command list memory-methods check, "post-Wait32/64 write failed"); not caused by this PR. The suite ran on this PC at the same time as 4 other PRs' suites, in one queued job.
review: none. Whole diff read (rpf.rs move_path: absolute path, \?\ or \?\UNC\ prefix at 260 characters or more, verbatim and device paths left alone; atomic_write_with uses it for both MoveFileExW paths; 2 tests). std's file calls already handle long paths; MoveFileExW does not, which this covers. A relative path becomes absolute against the same current directory MoveFileExW would have used.
performance: no runtime cost of note (one path conversion per extracted file commit).
verdict: safe to merge
hardware / tool and model: Windows 11 build 26300.9974, NVIDIA GeForce RTX 2070 SUPER 8 GB (driver 621.40, wave32 only), AMD Ryzen 5 3600XT; rustc 1.100.1 (20ddd0171 2026-11-25) x86_64-pc-windows-msvc, debug test profile; trial merge 7ac72d5d5613e6144117c78244fcf9f4b5beb7ee (local, not pushed). Claude Code: Claude Opus 5.5 (coordination, full-diff review, draft).
correction (2026-11-28): the base counts above were first given as 2128 passed: that base run reused this PC's merge test binary (one cargo target dir for both sides). The base was rerun with its own target dir; the same 9 tests fail on it, so the classification and the verdict stand.
Imported from ivall/xcl. Originally posted by Parakeet-Wheat on 2026-11-30T23:03:18Z.
merge-check
base:
86e86fcb33head:
6de9cf7945merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2891 passed, 0 failed, 51 ignored; SKIPPED: 26 (22 no wave64, 2 no heap windows, 1 driver cache needs Developer Mode, 1 no GPU_UPLOAD heaps); failing: none
review: Whole diff read. The fix works: with the two
MoveFileExWcall sites put back on the raw path,atomic_write_commits_past_max_pathfails with error 3. With the PR, it passes. The NT-form point from kacper-serewis is still open on this head. We added a test that callsatomic_writewith a short NT-form path (\??\and an absolute path in the temp folder). With main'srpf.rs, it writes the file. With this PR'srpf.rs, it fails with error 123, and no file is written.std::path::absolutereads\??\as a root-relative path. The early return that kacper-serewis suggested is not in the diff.performance: none: one path conversion per extracted file commit.
verdict: not yet: an NT-form destination that works on main fails with error 123 on this head. Add the suggested
\??\early return, or have a maintainer accept the change in scope.hardware / tool and model: RTX 3070 8 GB (610.88), AMD Ryzen 5 5600X, Windows 11 Home 26300, Rust 1.95.0, debug / Claude Code, Claude Opus 5.5 (merge, build, suite, hand mutation, NT-path test and review)
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T04:45:16Z.
Triage (#1607) – head
6de9cf7No open or merged PR makes the same change; main's
rpf.rs:atomic_write_withstill passes plain paths toMoveFileExW. #1285 also touches RPF extraction filenames, but it bounds their length rather than prefixing the commit path.move_pathmakes the path absolute and adds\\?\or\\?\UNC\only from 260 characters on, and leaves verbatim and device paths alone. That matches MoveFileExW's MAX_PATH limit. The end-to-end test builds a path over 300 characters. 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.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T11:57:04Z.
merge-check
base:
1c8b551475head:
6de9cf7945merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2911 passed, 0 failed, 51 ignored; SKIPPED: 28 (20 no wave64, 2 no d3d12SDKLayers.dll, 1 no D3D12 debug layer, 1 no heap windows, 1 cannot disable the driver cache, 3 others; the same set as on main); failing: none
review: read the whole diff (+68/-2).
atomic_write_withnow givesMoveFileExWabsolute paths and adds\\?\/\\?\UNC\from 260 UTF-16 units on, soxcl rpf --extractcan commit a record into a deep output folder. Findings: (1) The same plain-path move remains in the pipeline library.shaders/pipeline_library.rs~146 on main builds itsMoveFileExWpaths the same way, and the description's Not tested names only XGameSave (#922) as another caller; that belongs in a separate PR and doesn't block this one. Fine:std::path::absolutereturns a verbatim path unchanged and otherwise normalises it throughGetFullPathNameWbefore the length check, so the prefixed path is already clean; the 259 / 260 edge matches MAX_PATH with its NUL;\\.\and\\?\UNC\paths aren't prefixed twice; with nolongPathAwaremanifest in the crate,atomic_write_commits_past_max_pathfails without the change; it merges cleanly into main and alongside #1285 (which bounds the temporary name instead); no other PR makes this change; the smoke title doesn't reachxcl rpf, as the description says.performance: 60 s smoke of a retail title, main
1c8b5514vs this merge (09f3db83): 1652 -> 1673 frames shown (101 %; last presents per 2 s: 60 60 60), peak commit 18228 -> 19182 MB, 0 device removals, 0 crashes. The smoke title doesn't reachxcl rpf, so the run is a regression check only.verdict: safe to merge: the fix is correct, its test (
atomic_write_commits_past_max_path) passes here, the suite passes and the smoke run is clean; the same plain-path move in the pipeline library is a separate PRhardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5
AI-written and posted by Foniass without a human check of each point.
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.