Repository navigation
Conversation
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)
|
Full-suite run, since this PR has no test report yet. Tested exact head Tested
Not tested
AI use
|
Adapt xcl-dev#1072 with NT-prefix preservation. Real extractor probes verified the payload and destination handling on long drive and UNC paths and restored the short NT-path behavior. Assisted-by: T3 Code (gpt-6.2-astra)
|
On Tested: Windows 11, debug, CPU only.
// std::path::absolute treats the NT prefix as a root-relative DOS path
if path.as_os_str().as_encoded_bytes().starts_with(br"\??\") {
return Ok(path.as_os_str().encode_wide().chain([0]).collect());
}With it on Test (append to rpf.rs)#[cfg(test)]
mod nt_probe {
use super::*;
use std::time::{SystemTime, UNIX_EPOCH};
#[test]
fn nt_form_destination_commits() {
let nonce = SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_nanos();
let root = std::env::temp_dir().join(format!("xcl-rpf-nt-{}-{nonce}", std::process::id()));
std::fs::create_dir_all(&root).unwrap();
let nt = std::path::PathBuf::from(format!(r"\??\{}\record.bin", root.display()));
let r = atomic_write(&nt, b"payload");
let data = std::fs::read(root.join("record.bin"));
std::fs::remove_dir_all(&root).unwrap();
assert!(r.is_ok(), "{r:?}");
assert_eq!(data.unwrap(), b"payload");
}
}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. |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
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 D3D12.X: map a one-slice title texture's packed mips where D3D12 addresses them #470 fixes), andtransitions_apply_when_their_list_is_submittedandd32s8_targets_take_their_own_size_of_video_memory(PoisonErrorafter it; they pass alone; Tests: a panicking title-texture test no longer poisons the others #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: XGameRuntime: prefix MoveFileExW paths with \\?\ past MAX_PATH (#722) #922).AI use
claude-sonnet-5-5): wrote the change, the tests and this description, and ran the tests above.