Skip to content

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

Open
amazedturnip wants to merge 1 commit into
xcl-dev:mainfrom
amazedturnip:xcl/tests-vfs-overlay-whiteout-and-open-decision-con-004259
Open

amazedturnip wants to merge 1 commit into
xcl-dev:mainfrom
amazedturnip:xcl/tests-vfs-overlay-whiteout-and-open-decision-con-004259

Conversation

@amazedturnip

Copy link
Copy Markdown
Contributor

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

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).

@amazedturnip
amazedturnip force-pushed the xcl/tests-vfs-overlay-whiteout-and-open-decision-con-004259 branch from 9a4d0e8 to d55ed48 Compare November 25, 2026 19:05
@fromthemoonx

Copy link
Copy Markdown

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

Copy link
Copy Markdown
Contributor

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

Thanks!

@throny throny added the off-goal Does not bear on the current goal (world loading); waits until it is reached label Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

off-goal Does not bear on the current goal (world loading); waits until it is reached

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants