VFS: reject CREATE_ALWAYS on original directories (#577) #644

Open
github-bot wants to merge 1 commit from github-bot/gh-644 into main AGit
Owner

@⁠fladit123 on GitHub · 2026-11-24 02:49 UTC · original
fladit123:fix/issue-577-create-always-directory → main · +70 −5 · 2 files · 1 commits · open

Part of #577 (item 1 only).

Reject CREATE_ALWAYS on an original game directory that is not present in the overlay, before prepare_write can create an overlay file that hides the directory.

What is in it

  • Reject invalid directory replacement before modifying the overlay, matching native Win32 error codes.
  • Add a regression test covering both flag configurations, overlay absence, directory visibility, and preservation of original file contents.
  • Preserve valid replacement of original files.
  • Rebase onto main 6d12f58a229bc73889878a448c64dc3af25eeba0.

Tested

  • Windows 11 Pro 26H2, NTFS.
  • Intel Core i5-12400F, 32 GB RAM.
  • NVIDIA GeForce RTX 4060 8 GB, driver 610.88.
  • Rust 1.100.0 MSVC, DXC 1.8.2502.11.
  • Candidate: 9c1eb168cd93b59126baea688bb966eb8c92522d.

Native Win32 and the corrected VFS agree:

Flags Win32 error
None ERROR_ACCESS_DENIED (5)
FILE_FLAG_BACKUP_SEMANTICS ERROR_FILE_EXISTS (80)

Validation results:

  • VFS: 12 passed, 0 failed.
  • VFS hooks: 11 passed, 0 failed.
  • The new CREATE_ALWAYS regression test passed.
  • Release builds of both main and candidate passed.
  • git diff --check passed.
  • Workspace: 1,423 passed, 1 failed, 46 ignored, exit code 101.

The sole workspace failure was blob_enumeration_sees_one_submitted_update, matching the existing report in #2421.

The failure was independently reproduced locally on the exact unmodified base commit: 4 of 29 enumerations mixed submitted updates on main, compared with 5 of 29 in the isolated candidate run.

Explicit runtime skips included:

  • Native wave64 GPU checks in gpu::dxil::kernel, gpu::recomp::lower, gpu::recomp::lower_dxil, and gpu::recomp::tests.
  • Unsupported F16 instruction variants associated with #1426.
  • pso_measurement_compiles_an_exact_synthetic_record: Windows Developer Mode required.
  • heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows.

These runtime skips are separate from the harness's ignored-test count.

Regression run

Both builds were tested locally on the same title for 60 seconds, with networking disabled and separate fresh title-data roots.

Main:

xcl-smoke v1
commit: 6d12f58a229bc73889878a448c64dc3af25eeba0
gpu: NVIDIA GeForce RTX 4060
title: be9c57f5
seconds: 60
exit: 0x0
frames shown: 708 (PresentX 708)
presents per 2 s (last 3): 23 26 31
device removals: 0
crashes: 0
peak commit: 8823 MB

PR:

xcl-smoke v1
commit: 9c1eb168cd93b59126baea688bb966eb8c92522d
gpu: NVIDIA GeForce RTX 4060
title: be9c57f5
seconds: 60
exit: 0x0
frames shown: 772 (PresentX 772)
presents per 2 s (last 3): 26 26 23
device removals: 0
crashes: 0
peak commit: 8816 MB

The candidate achieved 109.04% of main's frames and 99.92% of its peak committed memory.

An additional control was performed with reversed execution order and identical executable hashes:

Metric Main Candidate
Frames shown 167 423
Peak commit (MB) 14538 10950
Last three present windows 9 10 10 0 0 0
Device removals 0 0
Crashes 0 0
Exit code 0 0

Both pairs satisfy the numerical regression thresholds.

However, substantial run-to-run variability was observed. Earlier tests on a previous base also failed the numerical regression thresholds.

Inspection of the second pair's activity logs revealed prolonged zero-present intervals in both main and candidate, accompanied by closely matching target-page and local video-memory allocations. Main subsequently resumed presenting frames, while the candidate reached the 60-second cutoff before recovery.

These observations suggest similar loading or processing phases occurring at different times, but do not establish the underlying cause. No FPS improvement or memory optimization is claimed.

Previous independent AMD RX 9070 XT validation by @⁠eizispark on the original PR revision remains documented in the PR discussion:
https://github.com/ivall/xcl/pull/644#issuecomment-7121024016

Not tested

  • Native wave64 on my local GPU.
  • AMD or Intel GPU validation of this exact rebased commit.
  • Junction-specific behavior.
  • Whether the retail smoke exercised the specific VFS regression path.
  • Equivalent gameplay progress across all smoke runs.
  • Items 2 and 3 of #577, which remain outside this PR's scope.

AI use

  • OpenAI Codex: original investigation, implementation, and regression tests.
  • ChatGPT (GPT-6.2): review, validation planning, PowerShell guidance, comparative log analysis, and PR description.
  • Builds, tests, and smoke runs for the rebased candidate were executed locally by me on Windows.
**@⁠fladit123** on GitHub · 2026-11-24 02:49 UTC · [original](https://github.com/xcl-dev/xcl/pull/644) `fladit123:fix/issue-577-create-always-directory` → `main` · +70 −5 · 2 files · 1 commits · open Part of #577 (item 1 only). Reject `CREATE_ALWAYS` on an original game directory that is not present in the overlay, before `prepare_write` can create an overlay file that hides the directory. **What is in it** - Reject invalid directory replacement before modifying the overlay, matching native Win32 error codes. - Add a regression test covering both flag configurations, overlay absence, directory visibility, and preservation of original file contents. - Preserve valid replacement of original files. - Rebase onto main `6d12f58a229bc73889878a448c64dc3af25eeba0`. **Tested** - Windows 11 Pro 26H2, NTFS. - Intel Core i5-12400F, 32 GB RAM. - NVIDIA GeForce RTX 4060 8 GB, driver 610.88. - Rust 1.100.0 MSVC, DXC 1.8.2502.11. - Candidate: `9c1eb168cd93b59126baea688bb966eb8c92522d`. Native Win32 and the corrected VFS agree: | Flags | Win32 error | |---|---| | None | ERROR_ACCESS_DENIED (5) | | FILE_FLAG_BACKUP_SEMANTICS | ERROR_FILE_EXISTS (80) | Validation results: - VFS: 12 passed, 0 failed. - VFS hooks: 11 passed, 0 failed. - The new CREATE_ALWAYS regression test passed. - Release builds of both main and candidate passed. - `git diff --check` passed. - Workspace: 1,423 passed, 1 failed, 46 ignored, exit code 101. The sole workspace failure was `blob_enumeration_sees_one_submitted_update`, matching the existing report in #2421. The failure was independently reproduced locally on the exact unmodified base commit: 4 of 29 enumerations mixed submitted updates on main, compared with 5 of 29 in the isolated candidate run. Explicit runtime skips included: - Native wave64 GPU checks in `gpu::dxil::kernel`, `gpu::recomp::lower`, `gpu::recomp::lower_dxil`, and `gpu::recomp::tests`. - Unsupported F16 instruction variants associated with #1426. - `pso_measurement_compiles_an_exact_synthetic_record`: Windows Developer Mode required. - `heap_window_out_of_memory_falls_back_to_the_switch_form`: no heap windows. These runtime skips are separate from the harness's ignored-test count. **Regression run** Both builds were tested locally on the same title for 60 seconds, with networking disabled and separate fresh title-data roots. Main: ``` xcl-smoke v1 commit: 6d12f58a229bc73889878a448c64dc3af25eeba0 gpu: NVIDIA GeForce RTX 4060 title: be9c57f5 seconds: 60 exit: 0x0 frames shown: 708 (PresentX 708) presents per 2 s (last 3): 23 26 31 device removals: 0 crashes: 0 peak commit: 8823 MB ``` PR: ``` xcl-smoke v1 commit: 9c1eb168cd93b59126baea688bb966eb8c92522d gpu: NVIDIA GeForce RTX 4060 title: be9c57f5 seconds: 60 exit: 0x0 frames shown: 772 (PresentX 772) presents per 2 s (last 3): 26 26 23 device removals: 0 crashes: 0 peak commit: 8816 MB ``` The candidate achieved 109.04% of main's frames and 99.92% of its peak committed memory. An additional control was performed with reversed execution order and identical executable hashes: | Metric | Main | Candidate | |---|---:|---:| | Frames shown | 167 | 423 | | Peak commit (MB) | 14538 | 10950 | | Last three present windows | 9 10 10 | 0 0 0 | | Device removals | 0 | 0 | | Crashes | 0 | 0 | | Exit code | 0 | 0 | Both pairs satisfy the numerical regression thresholds. However, substantial run-to-run variability was observed. Earlier tests on a previous base also failed the numerical regression thresholds. Inspection of the second pair's activity logs revealed prolonged zero-present intervals in both main and candidate, accompanied by closely matching target-page and local video-memory allocations. Main subsequently resumed presenting frames, while the candidate reached the 60-second cutoff before recovery. These observations suggest similar loading or processing phases occurring at different times, but do not establish the underlying cause. No FPS improvement or memory optimization is claimed. Previous independent AMD RX 9070 XT validation by @⁠eizispark on the original PR revision remains documented in the PR discussion: https://github.com/ivall/xcl/pull/644#issuecomment-7121024016 **Not tested** - Native wave64 on my local GPU. - AMD or Intel GPU validation of this exact rebased commit. - Junction-specific behavior. - Whether the retail smoke exercised the specific VFS regression path. - Equivalent gameplay progress across all smoke runs. - Items 2 and 3 of #577, which remain outside this PR's scope. **AI use** - OpenAI Codex: original investigation, implementation, and regression tests. - ChatGPT (GPT-6.2): review, validation planning, PowerShell guidance, comparative log analysis, and PR description. - Builds, tests, and smoke runs for the rebased candidate were executed locally by me on Windows.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:28:16 +00:00
Author
Owner

@⁠eizispark on GitHub · 2026-11-24 03:22 UTC · original

Hardware check of e176775e13d92e41ed86afa418f21a5907586c35 (verified clean merge with main 63cdc25): pass.

Tested

  • Hardware: AMD Radeon RX 9070 XT (RDNA4, driver 32.0.32015.16001), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11, rustc 1.100.0 (0ef1bc386 2026-11-09), release + test profile
  • cargo test --workspace -- --test-threads=4: 688 passed, 0 failed, 41 ignored (GPU tests skipped on this adapter: none)
  • cargo test -p xcl --lib vfs_hooks: 11 passed, 0 failed (including the new CREATE_ALWAYS original-directory regression test)

Regression run
main (dd2ae9a):

xcl-smoke v1
commit: dd2ae9a70af5eb5aad60f02d86e386b72abe1e95
gpu: AMD Radeon RX 9070 XT
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1666 (PresentX 1666)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 14851 MB

PR (e176775):

xcl-smoke v1
commit: e176775e13d92e41ed86afa418f21a5907586c35
gpu: AMD Radeon RX 9070 XT
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1667 (PresentX 1667)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 14848 MB

Not tested

  • wave32-only GPUs (NVIDIA / Intel); gameplay past the menus

AI use

  • Antigravity (Gemini 4 Carbon) ran the build, test suite, and scripts/smoke.ps1 harness on this machine and formatted this report.
**@⁠eizispark** on GitHub · 2026-11-24 03:22 UTC · [original](https://github.com/xcl-dev/xcl/pull/644#issuecomment-7121024016) Hardware check of `e176775e13d92e41ed86afa418f21a5907586c35` (verified clean merge with `main` `63cdc25`): **pass**. **Tested** - Hardware: AMD Radeon RX 9070 XT (RDNA4, driver 32.0.32015.16001), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11, `rustc 1.100.0 (0ef1bc386 2026-11-09)`, release + test profile - `cargo test --workspace -- --test-threads=4`: `688 passed, 0 failed, 41 ignored` (GPU tests skipped on this adapter: `none`) - `cargo test -p xcl --lib vfs_hooks`: `11 passed, 0 failed` (including the new `CREATE_ALWAYS` original-directory regression test) **Regression run** `main` (`dd2ae9a`): ``` xcl-smoke v1 commit: dd2ae9a70af5eb5aad60f02d86e386b72abe1e95 gpu: AMD Radeon RX 9070 XT title: GTA6.Xbox.v1.0.2.1 seconds: 60 exit: 0x0 frames shown: 1666 (PresentX 1666) presents per 2 s (last 3): 61 60 60 device removals: 0 crashes: 0 peak commit: 14851 MB ``` PR (`e176775`): ``` xcl-smoke v1 commit: e176775e13d92e41ed86afa418f21a5907586c35 gpu: AMD Radeon RX 9070 XT title: GTA6.Xbox.v1.0.2.1 seconds: 60 exit: 0x0 frames shown: 1667 (PresentX 1667) presents per 2 s (last 3): 61 60 60 device removals: 0 crashes: 0 peak commit: 14848 MB ``` **Not tested** - wave32-only GPUs (NVIDIA / Intel); gameplay past the menus **AI use** - Antigravity (Gemini 4 Carbon) ran the build, test suite, and `scripts/smoke.ps1` harness on this machine and formatted this report.
Author
Owner

@⁠fladit123 on GitHub · 2026-11-24 16:41 UTC · original

Hey @⁠eizispark! Main has moved quite a bit and #644 now has a merge conflict. I'm preparing a rebased version that preserves the original VFS fix and regression test. Would you be available to rerun the paired smoke tests once I have the final candidate ready? No worries if you're busy. Thanks again for your previous help!

**@⁠fladit123** on GitHub · 2026-11-24 16:41 UTC · [original](https://github.com/xcl-dev/xcl/pull/644#issuecomment-7138052965) Hey @⁠eizispark! Main has moved quite a bit and #644 now has a merge conflict. I'm preparing a rebased version that preserves the original VFS fix and regression test. Would you be available to rerun the paired smoke tests once I have the final candidate ready? No worries if you're busy. Thanks again for your previous help!
Author
Owner

@⁠JJAutoCompare on GitHub · 2026-11-25 06:30 UTC · original

Empirical test report (e176775e)

Hardware / environment

  • Commit e176775e13d92e41ed86afa418f21a5907586c35 (PR #644), detached HEAD.
  • Windows build 10.0.26200.9974, AMD Ryzen 7 3800X 8-Core Processor, Rust 1.100.0 (0ef1bc386, x86_64-pc-windows-msvc), DXC 1.9.2609.5 (01b62ad47).
  • Unoptimized test profile. Focused CPU runs used XCL_ADAPTER=NONE_CPU_ONLY and RUST_TEST_NOCAPTURE=1. All commands ran outside Invoke-ArcTest.ps1, without holding the Arc GPU mutex.

Commands and results

  • cargo test --workspace --no-run exited 0. Workspace test binaries compiled and zero tests ran.
  • cargo test -p xcl --lib vfs::tests:: exited 101 with 9 passed / 1 failed / 0 ignored / 0 skipped.
  • cargo test -p xcl --lib vfs_hooks::tests:: exited 0 with 11 passed / 0 failed / 0 ignored / 0 skipped.
  • cargo test -p xcl --lib vfs::tests::truncate_existing_validation_errors -- --exact exited 101 with 0 passed / 1 failed / 0 ignored / 0 skipped. This reran the same failure.
  • The focused log contained zero lines starting with case-sensitive SKIPPED .

Observed behavior

  • The new directory regression test passed. For an original directory absent from the overlay, CREATE_ALWAYS matched native CreateFileW with ERROR_ACCESS_DENIED (5) without flags and ERROR_FILE_EXISTS (80) with FILE_FLAG_BACKUP_SEMANTICS. Both cases left the overlay absent and the original directory visible with its contents intact.
  • The existing original-file replacement test passed. The existing TRUNCATE_EXISTING validation test read Win32 error 127 where it expected 5, both in the suite and in isolation. No base-commit comparison was run.

Not tested

  • Full GPU workspace suite and game smoke runs.

AI use

Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr644-focused.log and published.

**@⁠JJAutoCompare** on GitHub · 2026-11-25 06:30 UTC · [original](https://github.com/xcl-dev/xcl/pull/644#issuecomment-7154858929) ### Empirical test report (e176775e) **Hardware / environment** - Commit `e176775e13d92e41ed86afa418f21a5907586c35` (PR #644), detached HEAD. - Windows build 10.0.26200.9974, AMD Ryzen 7 3800X 8-Core Processor, Rust 1.100.0 (0ef1bc386, x86_64-pc-windows-msvc), DXC 1.9.2609.5 (01b62ad47). - Unoptimized test profile. Focused CPU runs used `XCL_ADAPTER=NONE_CPU_ONLY` and `RUST_TEST_NOCAPTURE=1`. All commands ran outside `Invoke-ArcTest.ps1`, without holding the Arc GPU mutex. **Commands and results** - `cargo test --workspace --no-run` exited 0. Workspace test binaries compiled and zero tests ran. - `cargo test -p xcl --lib vfs::tests::` exited 101 with 9 passed / 1 failed / 0 ignored / 0 skipped. - `cargo test -p xcl --lib vfs_hooks::tests::` exited 0 with 11 passed / 0 failed / 0 ignored / 0 skipped. - `cargo test -p xcl --lib vfs::tests::truncate_existing_validation_errors -- --exact` exited 101 with 0 passed / 1 failed / 0 ignored / 0 skipped. This reran the same failure. - The focused log contained zero lines starting with case-sensitive `SKIPPED `. **Observed behavior** - The new directory regression test passed. For an original directory absent from the overlay, `CREATE_ALWAYS` matched native `CreateFileW` with `ERROR_ACCESS_DENIED` (5) without flags and `ERROR_FILE_EXISTS` (80) with `FILE_FLAG_BACKUP_SEMANTICS`. Both cases left the overlay absent and the original directory visible with its contents intact. - The existing original-file replacement test passed. The existing `TRUNCATE_EXISTING` validation test read Win32 error 127 where it expected 5, both in the suite and in isolation. No base-commit comparison was run. **Not tested** - Full GPU workspace suite and game smoke runs. **AI use** Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr644-focused.log and published.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 12:31 UTC · original

Verification on RTX 3060 Ti (Windows 11): merge conflict with current main — needs a rebase before it can be tested.

**@⁠DavidM1911** on GitHub · 2026-11-25 12:31 UTC · [original](https://github.com/xcl-dev/xcl/pull/644#issuecomment-7162495186) Verification on RTX 3060 Ti (Windows 11): **merge conflict with current `main`** — needs a rebase before it can be tested.
Author
Owner

@⁠fladit123 on GitHub · 2026-11-25 19:29 UTC · original

Thanks @⁠DavidM1911 for checking!

I've confirmed that the original CREATE_ALWAYS directory issue is still present on current main (06055a7). I also noticed that main now captures GetLastError immediately in truncate_existing_validation_errors, addressing the previously observed error 127 discrepancy.

I'll prepare a clean rebase while preserving the original fix and regression test. Before updating the PR, I want to repeat the workspace validation and resolve the outstanding smoke-test discrepancies.

Thanks again for the independent verification.

**@⁠fladit123** on GitHub · 2026-11-25 19:29 UTC · [original](https://github.com/xcl-dev/xcl/pull/644#issuecomment-7172366127) Thanks @⁠DavidM1911 for checking! I've confirmed that the original CREATE_ALWAYS directory issue is still present on current main (`06055a7`). I also noticed that main now captures GetLastError immediately in truncate_existing_validation_errors, addressing the previously observed error 127 discrepancy. I'll prepare a clean rebase while preserving the original fix and regression test. Before updating the PR, I want to repeat the workspace validation and resolve the outstanding smoke-test discrepancies. Thanks again for the independent verification.
Author
Owner

@⁠fladit123 on GitHub · 2026-11-25 21:30 UTC · original

Rebased onto current main (6d12f58) and resolved the merge conflicts.

The updated candidate (9c1eb16) passed all 23 VFS/VFS hook tests. The full workspace run had one failure, which was reproduced on the unmodified base and matches #2421.

Both local RTX 4060 smoke pairs meet the numerical regression thresholds. Run-to-run variability and zero-present intervals observed on both builds are documented in the updated description.

Ready for another review. Thanks for your patience!

**@⁠fladit123** on GitHub · 2026-11-25 21:30 UTC · [original](https://github.com/xcl-dev/xcl/pull/644#issuecomment-7175168482) Rebased onto current main (`6d12f58`) and resolved the merge conflicts. The updated candidate (`9c1eb16`) passed all 23 VFS/VFS hook tests. The full workspace run had one failure, which was reproduced on the unmodified base and matches #2421. Both local RTX 4060 smoke pairs meet the numerical regression thresholds. Run-to-run variability and zero-present intervals observed on both builds are documented in the updated description. Ready for another review. Thanks for your patience!
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-26 03:00 UTC · original

Re-verification on RTX 3060 Ti (Windows 11), new head merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.

Thanks!

— Devin

**@⁠DavidM1911** on GitHub · 2026-11-26 03:00 UTC · [original](https://github.com/xcl-dev/xcl/pull/644#issuecomment-7181308121) Re-verification on RTX 3060 Ti (Windows 11), new head merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved. Thanks! — Devin
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/644/head:github-bot/gh-644'
git switch 'github-bot/gh-644'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-644'
git switch 'github-bot/gh-644'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-644'
git switch 'github-bot/gh-644'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-644'
git switch 'main'
git merge --squash 'github-bot/gh-644'
git switch 'main'
git merge --ff-only 'github-bot/gh-644'
git switch 'main'
git merge 'github-bot/gh-644'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.