Skip to content

fs: report a missing source before preparing a console copy destination - #8770

Closed
LukeOsland1 wants to merge 4 commits into
ProjectLeonida:mainfrom
LukeOsland1:codex/fs-copy-source-error
Closed

LukeOsland1 wants to merge 4 commits into
ProjectLeonida:mainfrom
LukeOsland1:codex/fs-copy-source-error

Conversation

@LukeOsland1

@LukeOsland1 LukeOsland1 commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

RT-853

Depends on: #7947

Coordination claim · original finding.

A title copying a missing source into GAME: could receive the destination's error, or leave an empty overlay directory behind. On Windows, CopyFileW reports ERROR_FILE_NOT_FOUND for this source whether the target is an existing file with fail-if-exists, a directory, a path under a missing parent, or a new file under an existing parent.

Check the resolved source for a missing file or directory before preparing a console destination. A missing leaf under an overlay-only source parent reports ERROR_FILE_NOT_FOUND. A missing source parent reports ERROR_PATH_NOT_FOUND.

On parent fc6b0f4 the first regression run had 19 failures: 18 wrong error results across the copy variants and one unexpected overlay parent. On c1ecb61 the Windows file_system_test passed all 546 checks, including the two additional source-parent cases. The test goes through CopyFileA/W, CopyFileExA/W, and both CopyFile2 routes, and checks the package contents and overlay afterward.

AI-assisted with Codex. Synthetic temporary files on Windows, CPU only.

@smowlyy

smowlyy commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Verified head c1ecb614f merged onto main (867d922f0) on native Windows 11 (10.0.26300.9974, MSVC 19.44, RelWithDebInfo):

  • python -I scripts/check_no_game_data.py on all 3 changed files: clean (exit 0)
  • cmake --build runtime/build --target file_system_test --parallel: built cleanly
  • ctest --test-dir runtime/build -R '^file_system$' --output-on-failure -V: 1/1 passed (546 check(s), 0 failure(s))

AI-assisted.

@comtek21516

Copy link
Copy Markdown

Tested c1ecb614f on main at 867d922f0, in one tree with #8422, #8669, #8670, #8690, #8784 (six clean merges): pass.

For this change. file_system passes natively. Under Wine file_system fails on main already, on six MAXIMUM_ALLOWED checks (#5617). In this tree it reports 570 check(s), 6 failure(s) against 446 check(s), 6 failure(s) on main: the 124 checks that this PR and the other file_system_test.cpp change in the tree add all pass under Wine too.

Setup. Built with MSVC 14.52 (Visual Studio 18), Windows SDK 10.0.26100, Vulkan SDK 1.4.363.1, Ninja RelWithDebInfo on Windows Server 2025 (no Vulkan driver there), then the same binaries run through scripts/run_wine_tests.py under wine-11.0 (WineHQ stable, xvfb-run) on a Quadro RTX 4000 (Turing), NVIDIA 615.71.09, Ubuntu 22.04.5.

passed failed skipped
native Windows, this tree 147 4 124
Wine on the GPU machine, main 867d922f0 210 12 54
Wine on the GPU machine, this tree 210 12 54

Under Wine the tree is test by test the same as main. The four native failures are gameinput_host, d3d12_sparse_queue_family, vk_bindless_ps_tex and vk_bindless_ps_imgatomic, which fail the same way on main on that machine (#7452). The 12 under Wine are the same 12 as on main (host comparisons Wine cannot answer, and d3d12_xdxr_rt, d3d12_indirect_rt, d3d12_indirect_dispatch_count).

Because the six were built together, there is no per-PR negative control in this run: a regression would have shown as a difference from main, and there is none. No game files used. AI-assisted (Claude Code).

@kristofbarany

Copy link
Copy Markdown

Tested c1ecb61 merged onto main 5d74c27 (clean merge) on NVIDIA GeForce RTX 4070, driver 621.24, native Windows 11 Pro 26300, MSVC 14.44.35207, Ninja RelWithDebInfo: pass.

No game data used. AI-assisted (Claude Code).

@icecreammule277-dot

Copy link
Copy Markdown
Contributor

Test run of this head (c1ecb614f), merged onto main 6312c057f. Windows 11 Pro for Workstations 26300, MSVC 19.52. Synthetic temporary files, CPU only, no GPU and no game files.

One structural thing to know first: this PR is stacked, and cannot land on its own. gh pr view 7947 is OPEN, git merge-base --is-ancestor pr7947 pr8770 is true, and git log pr7947..pr8770 is exactly one commit (c1ecb614f). So merging #8770 into main drags #7947 (fc6b0f4af) in with it. Either #7947 lands first, or this needs rebasing onto main — until then a reviewer who checks out this branch is reviewing #7947's shim too, which is why I tested the stack.

With the stack (main + #7947 fc6b0f4af + #8770 c1ecb614f):

runtime\build\file_system_test.exe
546 check(s), 0 failure(s)          exit 0

Negative control — the parent shim with these tests kept (runtime/shims/file_system.cpp reverted to fc6b0f4af, one TU rebuilt, nothing else changed):

546 check(s), 21 failure(s)         exit 1

and the 21 are all the change's stated claims, nothing incidental:

FAIL reports the missing source before destination errors    x18
     = 6 entry points (CopyFileA/W, CopyFileExA/W, CopyFile2 x2 routes) x 3 destination shapes
FAIL a missing leaf in an overlay-only folder reports FILE_NOT_FOUND
FAIL a missing source folder reports PATH_NOT_FOUND
FAIL missing-source copies preserve the package and create no overlay parent

The body says the parent run had 19 failures; I get 21. That is consistent rather than contradictory: 19 + the two source-parent cases the body says were added after that run, both of which also fail on the parent here. Either way the copy-variant failures are the 18 the body predicted, and the remaining three are the source-side lookups.

The import table is untouched, so this changes no binding on the retail executable: gta6rt --dry-run reports shim=63 host=432 module=72 unimplemented=20 for game_scarlett_master.exe both at main 6312c057f and on this stack.

Not a nit from this PR, but the build warns, and I would rather name it than leave it ambiguous: file_system_test.cpp(1297): warning C4456: declaration of 'h' hides previous local declaration (the outer h at :1206). The identical construct — const HANDLE h = create_w(reserved, ...) inside that loop over reserved GAME: paths — is already in main (file_system_test.cpp around line 1171), so it is pre-existing and this PR does not add it.

No game data involved. Tested c1ecb614f (on #7947 fc6b0f4af) on Windows (CPU-only): pass — 546/546, with the parent control at 21 failures. AI-assisted (OpenCode).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants