Repository navigation
VFS: keep game files hidden after delete-on-close - #1038
gloger2003 wants to merge 1 commit into
Conversation
An open with FILE_FLAG_DELETE_ON_CLOSE removes only the overlay file on close. Record a whiteout after the native open succeeds and retain it when another handle opens the existing overlay entry. Exercise two handles in the test title and check that the original game tree stays byte-identical. The Windows workspace suite passed on an RX 7800 XT.
|
The new e2e expectation in this PR fails on the current base: The title itself finishes clean ( i.e. the Environment: Windows 11 10.0.26300, NVIDIA GeForce RTX 5090 (driver 621.24), Rust 1.100.0 MSVC 14.44.35207, debug build, clean AI-assisted (opencode): applied the patch to a built tree, ran the suite, inspected the overlay's whiteout file, reverted it. |
|
Test report for this PR's head Tested
main: PR: This laptop's frame rate drops from run to run as it heats up (an earlier Not tested
AI use
|
|
Independent verification, merged onto current Machine: Windows 11, Ryzen 9 7900X + RTX 3060 Ti; Rust stable MSVC, debug.
AI use: test runs by Devin (Cognition, SWE-2); no code changes. |
Empirical test report (7f93905)Hardware / environment
Commands and results
Observed behavior
Not tested The full GPU workspace suite and game smoke runs were omitted. The PR adds its two-handle delete-on-close regression check inside the D3D12-dependent test title. The workspace build compiled that check, and the CPU VFS filter left it unexecuted. AI use Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against |
…stream xcl-dev#1038) Only a new overlay entry may clear a whiteout: prepare_write_staged returns is_new threading through OpenCommit, and reopening an existing entry keeps the delete-on-close whiteout (was: commit_write_unlocked cleared it unconditionally, resurrecting the original after close). Successful opens with FILE_FLAG_DELETE_ON_CLOSE record the whiteout at open; the last close deletes the overlay copy (handle->rel tracking in kernelx_linux, last-close semantics). Also fixes a self-deadlock the port introduced: a map-guard temporary in an if-let scrutinee lives through the body and deadlocks on the last-close re-lock of the same map (std mutexes are not reentrant); bind before the if-let. Gates: check --tests + --workspace 0 errors; lib 622/0/1; title e2e 12 GPU FAILs = baseline, 0 non-GPU; retail frontier holds (SIGSEGV exe+0x2237320, exit 139). Title e2e delete-on-close coverage needs a Windows cross-build (link.exe absent here) — not included.
…upstream xcl-dev#1038) Reference-only on Linux (vfs_hooks.rs is cfg(windows)): apply_open_decision takes Option<OpenCommit> and commits via commit_open(rel, is_new) so only a new overlay entry clears a whiteout; new open_file wrapper stages via open_decision_staged_for (keeps xcl-dev#1362 fail-before-commit + xcl-dev#1433 CreateFile2 flags validation a verbatim open_decision_for port would regress) and records the whiteout via commit_overlay_removal on successful DELETE_ON_CLOSE open of a game-original file. README 2-line hunk verbatim. Title/e2e delete-on-close hunks NOT ported: title is cfg(windows) using std::os::windows APIs (link.exe absent per PROMPT.md 0.9); the prebuilt PE is stale so the e2e whiteout assert would newly FAIL. Linux behavior for the same shape is pinned by vfs.rs reopening-keeps-whiteout + vfs_hooks_linux + kernelx_linux delete-on-close tests.
|
Re-verification on RTX 3060 Ti (Windows 11): still a merge conflict with current |
…dev#1054) Windows vfs_hooks.rs hunks reference-only (cfg(windows), never compiled on Linux): overlay_file_rel + set_file_info_vfs + hk_set_file_info_by_handle handling classes 4 (FILE_DISPOSITION_INFO, byte != 0) and 21 (FILE_DISPOSITION_INFO_EX, DELETE without ON_CLOSE), hook-table row, both tests. Byte-identical to pr1054head except the tests' open_for_delete helper, which passes the staged tuple to this tree's reconciled (xcl-dev#1038) apply_open_decision(vfs, staged, ...) signature, as all hk_create_file call sites do (upstream's 4-arg form predates the xcl-dev#1038 reconcile). Linux twin in hle/kernelx_linux.rs: SetFileInformationByHandle resolves the game rel BEFORE the mark via /proc/self/fd + overlay-root prefix (skip dirs via file metadata; read-only original-pointing handles resolve via the game root so the game folder is never deleted directly; host files resolve to no rel). A successful disposition-delete records the whiteout at set time and removes the overlay copy when the marking handle closes (Windows deletes at close, which also keeps a taken-back delete reversible); a taken-back delete records a write. Last error is preserved across the bookkeeping and a successful call leaves the caller's last error alone. Marks finalise best-effort in close_file_handle (bind-before-use, same non-reentrant-mutex rule as delete_on_close). Export-table row added for GetProcAddress probes. Failing-first: new tests fail pre-fix (E0425, no such function); grafted onto pre-fix HEAD in an isolated worktree with a neutered always-fail stub both fail at runtime (0 passed / 1 failed each), green with the fix. Gates: cargo check -p xcl --tests + --workspace 0 errors; lib 624/0/1 threads=4 (was 622, +2, zero regressions); fresh-root title ExitProcess(0xc), 12 unique FAILs all D3D12.X GPU-only, 0 non-GPU (e2e wrapper FAILs by design); retail SIGSEGV game_scarlett_master.exe+0x2237320 fault 0x0 exit 139, called_stubs 20, xgr exactly 3 apis — frontier HOLDS, M1-RE TERMINAL.
Part of #998. Opening a mounted game file with
FILE_FLAG_DELETE_ON_CLOSEused to remove the overlay copy and expose the original again.What is in it
Tested
Windows 11 build 26300.9974, AMD Radeon RX 7800 XT (32.0.32029.2010), Ryzen 7 5700X, Rust 1.100.0 MSVC, Windows SDK DXC 1.9.2602.17.
cargo build --locked --workspaceandcargo test --locked --workspace --no-fail-fast -- --test-threads=4 --show-outputon the source in7f93905: 727 passed, 0 failed, 41 ignored, no explicit GPU capability skips.The new test reproduced the original resurfacing, including after a second writable open. The release build with the fix completed the in-tree title with zero failures.
Local merge of this exact head into main 47efa2e (tree bbccc1d): rebuilt the workspace, then ran all tests on the RX 7800 XT. 741 passed, 0 failed, 41 ignored, no explicit GPU capability skips. The delete-on-close e2e test and the previously failing truncate_existing_validation_errors test both passed.
Also checked a local combination with VFS: a delete through a handle hides the game file (#998) #1054 at 7ecc08f. In that combination, opening with FILE_FLAG_DELETE_ON_CLOSE, calling FileDispositionInfo(FALSE), then closing made the original visible again. Windows still deletes the overlay copy, but the explicit-disposition hook clears the whiteout. This is an interaction between the two PRs.
Regression run
Independent runs by Curry-976 on a GeForce RTX 4050 Laptop GPU. The contributor reports 727 passed, 0 failed, 41 ignored in the workspace suite, with two wave64 capability skips. The smoke runs were back to back.
main:
PR:
Not tested
XCL_SAMPLE_*files.FILE_FLAG_DELETE_ON_CLOSEfor files. Deletion or renaming viaSetFileInformationByHandleremains separate.AI use