VFS: normalize forward and trailing slashes in whiteouts and paths #1289

Open
mahfuzinam0045-spec wants to merge 1 commit from upstream-pr/1299 into main
mahfuzinam0045-spec commented 2026-11-24 14:29:45 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by mahfuzinam0045-spec on 2026-11-24T14:29:45Z.


Normalize forward slashes (/), leading slashes, and trailing slashes in VFS path helpers, whiteout management, and directory enumeration.

What is in it

  • crates/xcl/src/vfs.rs:
    • Vfs::wkey: normalize forward slashes and trim leading/trailing separators so that keys in .xcl_whiteouts and lookup keys are canonicalized.
    • Vfs::is_whiteout: correctly splits ancestors on \ even when queried with forward slashes (e.g. data/gone.txt).
    • Vfs::has_whiteouts_under: correctly handles rel_dir with trailing slashes (e.g. data\ or data/), avoiding double-slash prefix mismatches.
    • Vfs::overlay_path & Vfs::original_path: strip leading/trailing separators and normalize forward slashes to avoid malformed path joins.
    • Vfs::stage_write, Vfs::check_original_dir_empty, & Vfs::remove_dir: normalize path arguments before parent splitting and prefix formatting.
    • Added unit test whiteouts_and_paths_normalize_slashes.
  • crates/xcl/src/vfs_hooks.rs:
    • collect_game_entries: normalize slashes before splitting rel into directory and search pattern, fixing searches using forward slashes (e.g. data/*).
    • Added test assertion for forward-slash enumeration under find_first_on_whited_out_and_recreated_directory.

Tested

  • Local MSVC/MinGW C toolchains (link.exe/gcc.exe) are absent on this development environment. Full validation and regression suite run via GitHub Actions CI (PR checks).
  • Logic verified against new unit tests whiteouts_and_paths_normalize_slashes and find_first_on_whited_out_and_recreated_directory.

Regression run

Regression testing requires Windows SDK and DXC toolchains. Relying on project CI.

Not tested

  • End-to-end game titles with full GPU rendering on physical console dumps.

AI use

Antigravity (Gemini 3.8 Flash) was used to diagnose the slash normalization discrepancy in vfs.rs and vfs_hooks.rs, implement canonicalization across path and whiteout helpers, and author the unit tests.

<!-- greyfinch-sync:ivall/xcl:issue:5474102574 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1299). Originally posted by [mahfuzinam0045-spec](https://github.com/mahfuzinam0045-spec) on 2026-11-24T14:29:45Z. --- Normalize forward slashes (`/`), leading slashes, and trailing slashes in VFS path helpers, whiteout management, and directory enumeration. ### What is in it - `crates/xcl/src/vfs.rs`: - `Vfs::wkey`: normalize forward slashes and trim leading/trailing separators so that keys in `.xcl_whiteouts` and lookup keys are canonicalized. - `Vfs::is_whiteout`: correctly splits ancestors on `\` even when queried with forward slashes (e.g. `data/gone.txt`). - `Vfs::has_whiteouts_under`: correctly handles `rel_dir` with trailing slashes (e.g. `data\` or `data/`), avoiding double-slash prefix mismatches. - `Vfs::overlay_path` & `Vfs::original_path`: strip leading/trailing separators and normalize forward slashes to avoid malformed path joins. - `Vfs::stage_write`, `Vfs::check_original_dir_empty`, & `Vfs::remove_dir`: normalize path arguments before parent splitting and prefix formatting. - Added unit test `whiteouts_and_paths_normalize_slashes`. - `crates/xcl/src/vfs_hooks.rs`: - `collect_game_entries`: normalize slashes before splitting `rel` into directory and search pattern, fixing searches using forward slashes (e.g. `data/*`). - Added test assertion for forward-slash enumeration under `find_first_on_whited_out_and_recreated_directory`. ### Tested - Local MSVC/MinGW C toolchains (`link.exe`/`gcc.exe`) are absent on this development environment. Full validation and regression suite run via GitHub Actions CI (`PR checks`). - Logic verified against new unit tests `whiteouts_and_paths_normalize_slashes` and `find_first_on_whited_out_and_recreated_directory`. ### Regression run Regression testing requires Windows SDK and DXC toolchains. Relying on project CI. ### Not tested - End-to-end game titles with full GPU rendering on physical console dumps. ### AI use Antigravity (Gemini 3.8 Flash) was used to diagnose the slash normalization discrepancy in `vfs.rs` and `vfs_hooks.rs`, implement canonicalization across path and whiteout helpers, and author the unit tests.
futurepro62 commented 2026-11-24 15:05:59 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T14:36:56Z.


Full-suite run, since this PR has no test report yet. Tested exact head 79e6c33 (on its base 930e8b4).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 752 passed, 0 failed, 41 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • The new tests ran and passed: whiteouts_and_paths_normalize_slashes.

Not tested

  • AMD, a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
<!-- greyfinch-sync:ivall/xcl:comment:7134665401 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1299#issuecomment-7134665401). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-24T14:36:56Z. --- Full-suite run, since this PR has no test report yet. Tested exact head `79e6c33` (on its base `930e8b4`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4`: **752 passed, 0 failed, 41 ignored**. SKIPPED (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. - The new tests ran and passed: `whiteouts_and_paths_normalize_slashes`. **Not tested** - AMD, a release build, a game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
DavidM1911 commented 2026-11-24 16:07:18 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T15:52:40Z.


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

  • cargo test -p xcl --lib -- --test-threads=1: all passed, 0 failed, 21 ignored. (Parallel runs intermittently abort with 0xc0000005 — same harness flake seen on unmodified main.)

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7136763001 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1299#issuecomment-7136763001). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T15:52:40Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib -- --test-threads=1`: all passed, 0 failed, 21 ignored. (Parallel runs intermittently abort with 0xc0000005 — same harness flake seen on unmodified `main`.) Thanks!
Toons29 commented 2026-11-25 04:10:25 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Toons29 on 2026-11-25T03:21:43Z.


Regression run of 79e6c33a on the retail title, for this PR's Regression run section. Both blocks are from scripts/smoke.ps1 as printed, not edited: main on 4178e888, this PR on its head commit with no uncommitted changes, same title and time.

xcl-smoke v1
commit: 4178e888c0b5be50a2887eda45cdb832763b68a4
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1618 (PresentX 1618)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 14831 MB
xcl-smoke v1
commit: 79e6c33a731e626d409ebf0c8242e0a72b5b2883
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1628 (PresentX 1628)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14813 MB

Against the limits in CONTRIBUTING.md: 101 % of main's frames, 100 % of its peak commit, no crash, no device removal.

AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, cargo build --release -p xcl, 60 s, XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.

AI use: Claude Code (Claude Opus 5.5) built both trees and ran scripts/smoke.ps1; I checked the blocks before posting.

<!-- greyfinch-sync:ivall/xcl:comment:7151842235 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1299#issuecomment-7151842235). Originally posted by [Toons29](https://github.com/Toons29) on 2026-11-25T03:21:43Z. --- Regression run of `79e6c33a` on the retail title, for this PR's **Regression run** section. Both blocks are from `scripts/smoke.ps1` as printed, not edited: `main` on `4178e888`, this PR on its head commit with no uncommitted changes, same title and time. ``` xcl-smoke v1 commit: 4178e888c0b5be50a2887eda45cdb832763b68a4 gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1618 (PresentX 1618) presents per 2 s (last 3): 61 60 60 device removals: 0 crashes: 0 peak commit: 14831 MB ``` ``` xcl-smoke v1 commit: 79e6c33a731e626d409ebf0c8242e0a72b5b2883 gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1628 (PresentX 1628) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14813 MB ``` Against the limits in CONTRIBUTING.md: 101 % of `main`'s frames, 100 % of its peak commit, no crash, no device removal. AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, `cargo build --release -p xcl`, 60 s, `XCL_NETWORK=0`. This is a regression check only: it does not show whether the run reaches the code this PR changes. AI use: Claude Code (Claude Opus 5.5) built both trees and ran `scripts/smoke.ps1`; I checked the blocks before posting.
github-actions[bot] commented 2026-11-28 08:01:40 +00:00 (Migrated from github.com)

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


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:7236313875 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1299#issuecomment-7236313875). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-28T08:01:40Z. --- 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 05:22:18 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T05:22:18Z.


Triage (#1607) – head 79e6c33

#1560 also normalizes separators in whiteout keys and in overlay_path / original_path (through clean_rel), as part of a much wider rewrite of vfs.rs (+392/-86: verbatim roots, .. traversal, ASCII lowercasing). This PR was opened first and is the narrow version, so the two are different approaches rather than duplicates.
No problems found in the diff. Main still has wkey as a plain to_lowercase. The failing check is the PR description.
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:7301700119 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1299#issuecomment-7301700119). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T05:22:18Z. --- **Triage (#1607)** – head 79e6c33 #1560 also normalizes separators in whiteout keys and in `overlay_path` / `original_path` (through `clean_rel`), as part of a much wider rewrite of `vfs.rs` (+392/-86: verbatim roots, `..` traversal, ASCII lowercasing). This PR was opened first and is the narrow version, so the two are different approaches rather than duplicates. No problems found in the diff. Main still has `wkey` as a plain `to_lowercase`. The failing check is the PR description. 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/1299:upstream-pr/1299'
git switch 'upstream-pr/1299'

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/1299'
git switch 'upstream-pr/1299'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1299'
git switch 'upstream-pr/1299'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1299'
git switch 'main'
git merge --squash 'upstream-pr/1299'
git switch 'main'
git merge --ff-only 'upstream-pr/1299'
git switch 'main'
git merge 'upstream-pr/1299'
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!1289
No description provided.