Repository navigation
VFS: fix Unicode case-folding slicing and verbatim root normalisation - #316
Michael-Glaser wants to merge 1 commit into
Conversation
|
Reviewed commit
A few concrete items before moving this out of draft:
|
|
A Windows run for this draft, since Not tested says it has not been built or run on Windows yet: Tested
With this PR's Not tested
AI use: Claude Code with Claude Opus 5.5 ran the build and tests and wrote this comment; the numbers come from those runs. |
f0bd1ea to
ce99a57
Compare
|
Thanks @0xKaji and @regiumlepidi! Rebased onto main (a6f5f7a, commit ce99a57) and applied the review items: strip_verbatim now handles \?\ and ??\ UNC prefixes case-insensitively, strip_path_prefix_ci trims repeated separators after the root, and added the extra UNC, mixed-separator, and verbatim game_root test cases. |
Vfs::classify_with compared abs.to_lowercase() against self.game_root_lc and then sliced the original abs at self.game_root.len() + 1. When Unicode case folding changes UTF-8 byte length (e.g. ẞ 3->2 bytes, İ 2->3 bytes, K 3->1 byte), that slice panics (out of bounds or mid-codepoint) inside an extern "system" file hook or returns a corrupted relative path. Vfs::new also did not call strip_verbatim on game_root or data_root_lc, and strip_verbatim only matched uppercase \?\UNC\ (letting lowercase \?\unc\ or \??\UNC\ fall through as relative paths instead of UNC). Match game_root_lc component-by-component on abs (strip_path_prefix_ci, trimming any repeated separators after the root), handle \?\ and \??\ UNC prefixes case-insensitively in strip_verbatim, and normalise game_root, data_root_lc, and pls_root_lc with strip_verbatim + trim_sep. Assisted-by: Antigravity (Gemini 4 Neon)
ce99a57 to
a9ce85e
Compare
|
Regression run of Against the limits in CONTRIBUTING.md: 101 % of AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, AI use: Claude Code (Claude Opus 5.5) built both trees and ran |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
… upstream xcl-dev#316) Per-component game-root match (strip_path_prefix_ci) so folding-expanding chars (ẞ/İ/K) keep the input's rel casing instead of slicing a lowercased string at a stale byte offset; strip_verbatim UNC-case-insensitive; Vfs::new roots normalised through strip_verbatim. Linux reconciliations: matcher is separator-agnostic (host paths use /), host_path_string strips before separator replacement, UNC classify arm uses the same helper. Test ports the upstream table (Windows legs verbatim, Linux legs via UNC/temp roots since untranslated drive paths Reject).
…(port upstream xcl-dev#1560, reconciled) Upstream xcl-dev#1560 base predates Reject/OpenCommit/write_lock/GENERIC_READ, the Linux norm/logical split, the xcl-dev#316 sep-agnostic matcher and the xcl-dev#1170 clamp, so this ports concepts + 5 tests instead of going verbatim. Linux keeps its twin layers (checked_*/ensure_mount_contained, host_path_string, below_mount clamp: mount-escape '..' stays in-mount vs upstream Game '..'). Failing-first E0277 x18 pre-fix; 5/5 new tests green. Lib 631/0/1 (+5). Title 12 GPU-only FAILs byte-identical to baseline; retail SIGSEGV +0x2237320 HOLDS, M1-RE TERMINAL.
Vfs::classify_withsliced un-lowercasedabsusingself.game_root.len() + 1after.to_lowercase(), which panics or corruptsrelwhen Unicode case folding changes UTF-8 byte length (ẞ,İ,K).Vfs::newalso missedstrip_verbatimongame_rootanddata_root_lc.What is in it
crates/xcl/src/vfs.rs: matchgame_root_lcper\component (strip_path_prefix_ci), applystrip_verbatim+trim_septo roots inVfs::new, and addclassify_handles_unicode_case_folding_and_verbatim_roots.Tested
aarch64-apple-darwin, Rust 1.100.0):cargo check --offline --target x86_64-pc-windows-msvc --workspace --tests(0 errors, 0 new warnings).Not tested
cargo testandscripts/smoke.ps1not run yet.AI use