Tests: pin VFS overlay / whiteout / open-decision contracts #2415

Open
amazedturnip wants to merge 1 commit from upstream-pr/2425 into main
amazedturnip commented 2026-11-25 18:31:56 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by amazedturnip on 2026-11-25T18:31:56Z.


Adds 8 integration tests (crates/xcl/tests/vfs_overlay_contract.rs) pinning the VFS overlay/whiteout/open-decision contract through the public API: copy-on-write content, persistent whiteouts across Vfs::new, create_dir/remove_dir error cases, needs_merge/has_whiteouts_under, mangled GAME:-prefix classify, stage_write/commit_write/prepare_write(keep_content=true), and read_path_rel precedence. No production code changed.

What is in it

  • crates/xcl/tests/vfs_overlay_contract.rs: 8 integration tests pinning the VFS overlay/whiteout/open-decision contract through the public API.
  • open_decision/CREATE_ALWAYS, OPEN_EXISTING (copy-on-write) and TRUNCATE_EXISTING: never writes the original folder; overlay paths and copied content pinned.
  • delete_file whiteout persistence: original stays, is_whiteout true, read_path_rel None, Fail(ERROR_FILE_NOT_FOUND), persists across Vfs::new on the same data folder; delete of missing file errors ERROR_FILE_NOT_FOUND.
  • create_dir on an existing original fails ERROR_ALREADY_EXISTS; create_dir on a missing dir writes overlay; needs_merge / has_whiteouts_under consistency.
  • remove_dir with un-whited-out child errors ERROR_DIR_NOT_EMPTY; all-whited-out dir is allowed and records a whiteout; original stays.
  • Invariant: mangled absolute path with GAME: prefix classifies to Game{rel:...}; own_folder paths pass through untouched.
  • read_path_rel whiteout/overlay precedence; real_path_for_read pass-through for unmapped console path.
  • stage_write path (no placeholder file) + commit_write + prepare_write(keep_content=true) copy original.

Tested

  • Hardware / OS / Rust: AMD Ryzen 7 9800X3D 8-Core Processor, Windows 11 Pro 10.0.26100 (Build 26100), rustc 1.94.1 (e408947bf 2026-03-25), stable-x86_64-pc-windows-msvc, debug build
  • AMD (AMD Radeon(TM) Graphics (driver 32.0.21043.19003, DXC 1.9.2609, native wave64), XCL_ADAPTER=radeon): cargo test --workspace -- --test-threads=1 — 1266 passed, 2 failed, 26 ignored (SKIPPED GPU tests: 1 (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), 1 (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), 1 (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), 1 (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), 1 (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), 1 (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), 1 (cannot disable the driver cache (Windows Developer Mode is required): The application requested an operation that depends on an SDK component that is missing or mismatched. (0x887A002D)); pre-existing upstream/main failures excluded: gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1, gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier)
  • Verification / negative control: New additive test file — verified deterministic (8 passed each run, 3 consecutive runs); no existing behavior was changed, so no fix had to be verified against an observed failure.

Not tested

  • Full retail runtime run (test/script-only PR; no runtime code modified)
  • NVIDIA wave32 GPU (not run in this pass; verified on AMD Radeon native wave64)

AI use

  • Local AI (thinkingmachines_inkling-2-mini) assisted with diagnosis, implementation, tests, review, and description; all tests executed locally on AMD Radeon (native wave64).
<!-- greyfinch-sync:ivall/xcl:issue:5496949842 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2425). Originally posted by [amazedturnip](https://github.com/amazedturnip) on 2026-11-25T18:31:56Z. --- Adds 8 integration tests (crates/xcl/tests/vfs_overlay_contract.rs) pinning the VFS overlay/whiteout/open-decision contract through the public API: copy-on-write content, persistent whiteouts across Vfs::new, create_dir/remove_dir error cases, needs_merge/has_whiteouts_under, mangled GAME:-prefix classify, stage_write/commit_write/prepare_write(keep_content=true), and read_path_rel precedence. No production code changed. **What is in it** - crates/xcl/tests/vfs_overlay_contract.rs: 8 integration tests pinning the VFS overlay/whiteout/open-decision contract through the public API. - open_decision/CREATE_ALWAYS, OPEN_EXISTING (copy-on-write) and TRUNCATE_EXISTING: never writes the original folder; overlay paths and copied content pinned. - delete_file whiteout persistence: original stays, is_whiteout true, read_path_rel None, Fail(ERROR_FILE_NOT_FOUND), persists across Vfs::new on the same data folder; delete of missing file errors ERROR_FILE_NOT_FOUND. - create_dir on an existing original fails ERROR_ALREADY_EXISTS; create_dir on a missing dir writes overlay; needs_merge / has_whiteouts_under consistency. - remove_dir with un-whited-out child errors ERROR_DIR_NOT_EMPTY; all-whited-out dir is allowed and records a whiteout; original stays. - Invariant: mangled absolute path with GAME: prefix classifies to Game{rel:...}; own_folder paths pass through untouched. - read_path_rel whiteout/overlay precedence; real_path_for_read pass-through for unmapped console path. - stage_write path (no placeholder file) + commit_write + prepare_write(keep_content=true) copy original. **Tested** - Hardware / OS / Rust: AMD Ryzen 7 9800X3D 8-Core Processor, Windows 11 Pro 10.0.26100 (Build 26100), rustc 1.94.1 (e408947bf 2026-03-25), stable-x86_64-pc-windows-msvc, debug build - AMD (`AMD Radeon(TM) Graphics (driver 32.0.21043.19003, DXC 1.9.2609, native wave64)`, `XCL_ADAPTER=radeon`): `cargo test --workspace -- --test-threads=1` — 1266 passed, 2 failed, 26 ignored (SKIPPED GPU tests: 1 (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), 1 (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), 1 (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), 1 (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), 1 (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), 1 (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), 1 (cannot disable the driver cache (Windows Developer Mode is required): The application requested an operation that depends on an SDK component that is missing or mismatched. (0x887A002D)); pre-existing upstream/main failures excluded: gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1, gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier) - Verification / negative control: New additive test file — verified deterministic (8 passed each run, 3 consecutive runs); no existing behavior was changed, so no fix had to be verified against an observed failure. **Not tested** - Full retail runtime run (test/script-only PR; no runtime code modified) - NVIDIA wave32 GPU (not run in this pass; verified on AMD Radeon native wave64) **AI use** - Local AI (thinkingmachines_inkling-2-mini) assisted with diagnosis, implementation, tests, review, and description; all tests executed locally on AMD Radeon (native wave64).
fromthemoonx commented 2026-11-25 20:08:31 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by fromthemoonx on 2026-11-25T19:13:06Z.


Passes on NVIDIA (wave32); each of three deliberate breaks in vfs.rs is caught by the new tests, and also by the existing vfs::tests.

Tested: the head d55ed48 (its tree is identical to the one I ran: 9a4d0e8 merged onto main 2898511), and 9a4d0e8 itself. RTX 3060 12 GB (driver 610.88, wave32), Ryzen 7 5700X, Windows 11 Pro 26300, Rust 1.100.0 MSVC, debug.

result
cargo test --workspace --no-fail-fast -- --test-threads=4, d55ed48's tree 1371 passed, 0 failed, 46 ignored; 25 SKIPPED lines (no wave64, refused per-lane forms)
same at 9a4d0e8 (before the rebase) 1354 passed, 1 failed, 46 ignored: a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier, from the old base, fixed on main by c828d8c (#2420); not this PR
cargo test -p xcl --test vfs_overlay_contract, 3 runs 8 passed, 3 of 3

Deliberate breaks in crates/xcl/src/vfs.rs (scratch, on 9a4d0e8; the file is unchanged in d55ed48):

  • persist_whiteouts writes nothing: delete_file_records_persistent_whiteout fails; vfs::tests also fails 3 (delete_is_a_persistent_whiteout, directories, recreating_removed_directory_does_not_resurrect_original_children).
  • check_original_dir_empty always Ok: remove_dir_with_unwhited_child_errors_dir_not_empty fails; vfs::tests also fails 3 (remove_dir_checks_both_layers_before_removing_overlay, directories, remove_dir_rejects_visible_subdirectories).
  • prepare_write ignores keep_content: stage_and_commit_write_keep_overlay_content and open_decision_never_writes_the_original_folder fail; vfs::tests::reads_never_touch_and_writes_copy_on_write also fails.

So the new tests work, but for these three behaviours the inline tests in vfs.rs already catch the same breaks.

Not tested: a release build, a title.

AI use: Claude Code (Claude Opus 5.5) ran the tests and the scratch breaks, and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7171982333 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2425#issuecomment-7171982333). Originally posted by [fromthemoonx](https://github.com/fromthemoonx) on 2026-11-25T19:13:06Z. --- **Passes on NVIDIA (wave32); each of three deliberate breaks in `vfs.rs` is caught by the new tests, and also by the existing `vfs::tests`.** **Tested:** the head `d55ed48` (its tree is identical to the one I ran: `9a4d0e8` merged onto `main` `2898511`), and `9a4d0e8` itself. RTX 3060 12 GB (driver 610.88, wave32), Ryzen 7 5700X, Windows 11 Pro 26300, Rust 1.100.0 MSVC, debug. | | result | |---|---| | `cargo test --workspace --no-fail-fast -- --test-threads=4`, `d55ed48`'s tree | 1371 passed, 0 failed, 46 ignored; 25 `SKIPPED` lines (`no wave64`, refused per-lane forms) | | same at `9a4d0e8` (before the rebase) | 1354 passed, 1 failed, 46 ignored: `a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier`, from the old base, fixed on `main` by c828d8c (#2420); not this PR | | `cargo test -p xcl --test vfs_overlay_contract`, 3 runs | 8 passed, 3 of 3 | Deliberate breaks in `crates/xcl/src/vfs.rs` (scratch, on `9a4d0e8`; the file is unchanged in `d55ed48`): - `persist_whiteouts` writes nothing: `delete_file_records_persistent_whiteout` fails; `vfs::tests` also fails 3 (`delete_is_a_persistent_whiteout`, `directories`, `recreating_removed_directory_does_not_resurrect_original_children`). - `check_original_dir_empty` always `Ok`: `remove_dir_with_unwhited_child_errors_dir_not_empty` fails; `vfs::tests` also fails 3 (`remove_dir_checks_both_layers_before_removing_overlay`, `directories`, `remove_dir_rejects_visible_subdirectories`). - `prepare_write` ignores `keep_content`: `stage_and_commit_write_keep_overlay_content` and `open_decision_never_writes_the_original_folder` fail; `vfs::tests::reads_never_touch_and_writes_copy_on_write` also fails. So the new tests work, but for these three behaviours the inline tests in `vfs.rs` already catch the same breaks. **Not tested:** a release build, a title. **AI use:** Claude Code (Claude Opus 5.5) ran the tests and the scratch breaks, and wrote this report.
DavidM1911 commented 2026-11-25 20:08:47 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T19:50:06Z.


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

  • cargo test -p xcl --lib: 1038 passed, 1 failed in one parallel run; the failing test passes on a single-threaded rerun (1039/0). Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7172825971 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2425#issuecomment-7172825971). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T19:50:06Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: 1038 passed, 1 failed in one parallel run; the failing test passes on a single-threaded rerun (1039/0). Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun. Thanks!
github-actions[bot] commented 2026-11-30 08:39:41 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-30T08:39:41Z.


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:7273184405 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2425#issuecomment-7273184405). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-30T08:39:41Z. --- 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.
amazedturnip commented 2026-11-30 08:44:14 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by amazedturnip on 2026-11-30T08:44:14Z.


Still merges cleanly onto main (d52ff48c) with passing checks; pin VFS overlay / whiteout / open-decision contracts — waiting on maintainer / post-goal review.

<!-- greyfinch-sync:ivall/xcl:comment:7273279426 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2425#issuecomment-7273279426). Originally posted by [amazedturnip](https://github.com/amazedturnip) on 2026-11-30T08:44:14Z. --- Still merges cleanly onto main (d52ff48c) with passing checks; pin VFS overlay / whiteout / open-decision contracts — waiting on maintainer / post-goal review.
Foniass commented 2026-12-01 08:02:14 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:02:14Z.


Triage (#1607) – head d55ed48

No open or merged PR adds the same tests: #862 also adds a VFS integration test file, but it only covers path classification without touching the file system.
I checked each assertion against vfs.rs on current main (open_decision_for, delete_file, create_dir, remove_dir, needs_merge, stage_write/commit_write, prepare_write) and they still match. The file's own header says it re-pins behaviour that vfs.rs's inline tests already cover, so the description should say what these tests add on top of those.
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:7304791614 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2425#issuecomment-7304791614). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T08:02:14Z. --- **Triage (#1607)** – head d55ed48 No open or merged PR adds the same tests: #862 also adds a VFS integration test file, but it only covers path classification without touching the file system. I checked each assertion against `vfs.rs` on current main (`open_decision_for`, `delete_file`, `create_dir`, `remove_dir`, `needs_merge`, `stage_write`/`commit_write`, `prepare_write`) and they still match. The file's own header says it re-pins behaviour that `vfs.rs`'s inline tests already cover, so the description should say what these tests add on top of those. 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/2425:upstream-pr/2425'
git switch 'upstream-pr/2425'

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