VFS: a write below a missing parent fails with ERROR_PATH_NOT_FOUND instead of conjuring the folder #1259
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1259
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1259"
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?
@pickles976 on GitHub · 2026-11-24 13:55 UTC · original
pickles976:vfs-write-parent-check→main· +38 −0 · 1 files · 1 commits · openWhat:
prepare_writerancreate_dir_allon the overlay parent with no merged-view check. SoCreateFileW("G:\nodir\f.bin", CREATE_ALWAYS)— parent in neither layer — creatednodirand succeeded where Windows failsERROR_PATH_NOT_FOUND; and a write below a removed directory resurrected the folder viacommit_write → remove_whiteout(children staying whited out).stage_write(the copy/move path) already carries exactly the guard being added here, so the two entry points currently disagree on the same path. Found by @emirduran707's static audit (their #577 comment, 11:53Z); this implements theprepare_writehalf of their suggested fix.What is in it
prepare_write: reject withERROR_PATH_NOT_FOUNDunless the virtual parent is a folder in the merged view (is_dir, matchingstage_write's check line-for-line) — before anything is created on disk;create_dir_allwas there for).create_dirmulti-level case from the same report —vfs::tests::directoriescodifies multi-level creation as the contract (create_dir("saves\slot1") == Ok(())), and whether the emulated console should matchCreateDirectoryW's one-level semantics is a maintainer call, not a silent test rewrite. Details in my #577 reply.Tested
x86_64-pc-windows-gnu(llvm-mingw toolchain, clang+lld, static libunwind), release test profile, rustc stable; lib tests executed under Wine 9 (wineviaCARGO_TARGET_..._RUNNER):cargo test -p xcl --lib vfs::tests --target x86_64-pc-windows-gnu -- --test-threads=1: 15 passed, 0 failed, 0 ignored (12 pre-existing + 3 new; no GPU tests in the filtered set). The fullcargo test --workspacefrom Linux requires the same cross + Wine setup (lib does not link natively here —retour); CI covers the workspace.Regression run
Requesting the
test-onlylabel: CPU-only host, no title package or Windows desktop here, so nosmoke.ps1blocks — same lane @ryosen0 used with the recent VFS PR; happy to have it smoke-partnered if a reviewer wants title evidence beyond the unit level.Not tested
smoke.ps1on a real title (see above); thevfs_hooksCreateFileW end-to-end path under Wine (the two known Wine-9CopyFile2blockers in that suite are unrelated to this change and still abort on base).AI use
@dcastell1 on GitHub · 2026-11-24 14:01 UTC · original
Verified on Windows 11 10.0.26300, NVIDIA GeForce RTX 5090 (driver 621.24), Rust 1.100.0 MSVC 14.44.35207, debug build, on
main@930e8b4(baseline 751 passed, 0 failed, 41 ignored on this box):Three more than the baseline; a write below a missing parent failing with the right error is covered and green.
Tree restored afterwards (full diff against a clean checkout), hardware adapter, no Wine, no game data. AI-assisted (opencode): applied the patch to a built tree, ran the suite, reverted it.
@pickles976 on GitHub · 2026-11-24 14:02 UTC · original
Thanks @dcastell1 — full-workspace green on native Windows (754 vs 751 baseline) is stronger unit evidence than my Wine cross-run, and the clean-patch/revert discipline is noted.\n\nTo the maintainers: the two
xcl-smokelint failures are the known Linux-contributor wall — this box has no title package and no Windows desktop, and the change is CPU-only VFS error-path logic with no GPU or title interaction. Requesting thetest-onlylabel for this PR (the lane established when #763 was reviewed): the risk surface is exactly what the 3 new unit tests + dcastell1's full-suite native run cover; a title regression beyond that would need the fix to corrupt the overlay, which the whited-out and game-only-parent tests are precisely about. Happy to add smoke blocks later if a reviewer wants them before merge.@DavidM1911 on GitHub · 2026-11-24 14:05 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:Thanks!
@pickles976 on GitHub · 2026-11-24 15:20 UTC · original
Sequencing note for the reviewer from my side of the VFS lane: #1362 (staged whiteout preservation) and this PR are complementary halves of the same #577 third-party audit — theirs fixes failed-open resurrection, this one missing-parent conjuring. The textual conflict is one renamed function: my guard slots at the top of
prepare_write_stagedafter their rename with zero semantic change, and the joint test set (their whiteout tests + this PR's 3) covers both halves. Whichever merges second rebases onto the other — flagging so it is a plan, not a surprise.@Toons29 on GitHub · 2026-11-25 03:20 UTC · original
Regression run of
3460d080on the retail title, for this PR's Regression run section. Both blocks are fromscripts/smoke.ps1as printed, not edited:mainon4178e888, this PR on its head commit with no uncommitted changes, same title and time.Against the limits in CONTRIBUTING.md: 100 % 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.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.