Repository navigation
Conversation
|
Updated to e355c10: merged the review fix of #3489 (8b97064, the last error of a delete-on-close open) and added the checks that review asked for at the point where the two changes meet: |
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
2 open issues
What changed in this PR
Aligns the GAME: filesystem shim’s CreateFile semantics with Windows host behavior for “creating” dispositions on package-only names, and formalizes FILE_FLAG_DELETE_ON_CLOSE behavior (including deletion markers) with corresponding documentation and tests.
Changes:
- Update
open_targetto pre-decide outcomes forCREATE_NEW/CREATE_ALWAYS/OPEN_ALWAYSon package-only names (including package directories) and to preserveERROR_ALREADY_EXISTSsemantics. - Treat
FILE_FLAG_DELETE_ON_CLOSEas a write/delete intent, add post-open deletion marker logic that preserves the host’s last-error value. - Add/extend tests and docs to cover the updated behaviors.
| File | Description |
|---|---|
| runtime/test/file_system_test.cpp | Adds regression tests for delete-on-close and creating-disposition semantics on package-only names. |
| runtime/shims/file_system.cpp | Implements the adjusted disposition/last-error behavior and delete-on-close marker handling. |
| docs/runtime_imports.md | Documents the new/clarified semantics for delete-on-close and creating opens on package-only names. |
Review effort: Lite
| h = create_w(L"GAME:\\exists\\fresh.txt", GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, 0, nullptr); | ||
| error = GetLastError(); | ||
| check(h != INVALID_HANDLE_VALUE && error == ERROR_SUCCESS, "CREATE_ALWAYS on a new name reports no error"); | ||
| if (h != INVALID_HANDLE_VALUE) ::CloseHandle(h); |
| An open with `FILE_FLAG_DELETE_ON_CLOSE` is a delete whatever access it asks for (the host adds `DELETE` to it): it | ||
| uses the overlay copy, and a package name gets its marker once the open has succeeded. |
|
Tested
Host check. I ran a small standalone program (not part of the PR) that calls the real
The
The read-only/hidden row only matters if package files keep those attributes on disk, so it's probably fine to leave as is. The rest agrees with the host. For a plain file it's AI-assisted (Claude Code). |
|
Thanks @Parakeet-Wheat, for the host table and for the full run: Verified on this host with the real
Without the flag Fixed in fac9de3, in the shape you suggested. Six new checks failed before it. For a folder only the package has, with the flag:
Left as you suggested: the read-only or hidden file row ( Also in this push: #3489's head is merged (11606ae). Its review asked for Results at fac9de3. AI-assisted (Claude Code). |
|
Updated to b6f90fe: #3489's new head (23bbbd0, which has What conflicted. Only Overlap. None of what landed answers a creating open for a name only the package has, so nothing here was dropped. With the copy-up now going through a staging name, Results at b6f90fe (MSVC 14.51, Windows SDK 10.0.26100.8249, RelWithDebInfo): AI-assisted (Claude Code). |
|
Tested b6f90fe merged onto main aa2988c on an RTX 5090 (driver 616.92), Windows 11, MSVC 19.44, Vulkan SDK 1.4.363, RelWithDebInfo:
AI-assisted (Claude Code). |
|
The new head is 79931b0. It is a merge of the new head of #3489 (e9d8608), which got two review fixes. Both branches changed the two lines after the host open in Test on Windows 11, MSVC 14.51, RelWithDebInfo: Depends on: #3489 AI-assisted (Claude Code). |
|
Tested 79931b0 on Windows 11 (MSVC BuildTools 2022, Ninja, RelWithDebInfo, -j 4; no Vulkan validation layer installed), one GPU at a time, device line confirmed: AMD Radeon RDNA2 iGPU (driver 26.10.1) and NVIDIA RTX 5080 (driver 616.92). Ran AI-assisted. |
|
I merged the updated #3489 head On Windows 11, the RelWithDebInfo build passes. All 217 file-system checks and all six documentation link tests pass. Python compilation passes. Full CTest records 139 passes, 10 skips, one disabled test, and two failures. The same two tests fail on main: AI-assisted. |
|
Tested 135bfd6 on Windows 11 (MSVC BuildTools 2022, Ninja, RelWithDebInfo, -j 4; no Vulkan validation layer installed), one GPU at a time, device line confirmed: AMD Radeon RDNA2 iGPU (driver 26.10.1) and NVIDIA RTX 5080 (driver 616.92). Ran AI-assisted. |
|
Tested Worktree at the PR head (stacked on #3489's Command and result:
|
|
Tested 135bfd6 merged with main 3faac55 on Windows (MSVC 14.51, RelWithDebInfo) and with main 98fa503 on Linux (Python 3.12.16): pass. ctest file_system 1/1 (it does not use the GPU; the result is the same with the NVIDIA and the Intel selection). Negative control with main's runtime/shims/file_system.cpp: file_system fails. Linux: the four tests/test_docs_*.py 4/4 ok. |
|
Rebased on main 561b65a through #3489 at 8719779. New head: 0584593. All 318 file system checks and all six documentation link tests pass on Windows 11. Python compilation passes. Full CTest: 233 pass, 3 fail, 11 skip, 1 disabled. The same three tests fail on main: d3d12_indirect_dispatch_count, d3d12_present, and xbox_present. AI-assisted. |
135bfd6 to
0584593
Compare
|
Tested on NVIDIA GeForce RTX 5080, driver 621.24, Windows 11: fail Checked out
|
|
Follow-up: earlier fail comment was a false negative (bad exit-code capture). Retested. Tested on NVIDIA GeForce RTX 5080, driver 621.24, Windows 11: pass Head |
shayderrr
left a comment
There was a problem hiding this comment.
Review
Reviewed change in PR #3532: gta6rt: a creating GAME: open answers for a name only the package has.
Scope: docs/runtime_imports.md, runtime/shims/file_system.cpp, runtime/test/file_system_test.cpp
Diff: +417 / -13 across 3 file(s).
The change stays inside the stated scope and the touched files line up with the description. No unrelated production paths are pulled in, and the stated behavior is directly exercised by the diff. I'm approving this one.
Reviewed by shayderrr via automated batch review.
|
Tested 0584593 on NVIDIA RTX 4070 SUPER (driver 616.92), Windows 11 26200, MSVC 14.44, Vulkan SDK 1.4.363, RelWithDebInfo: pass, no regression against main 561b65a.
|
0584593 to
c591e18
Compare
|
AI-assisted. I rebased the two commits from this PR onto #3489 at The Windows RelWithDebInfo build passed. All 492 file-system checks and seven documentation link tests passed. Python compileall passed. Full CTest had 246 passes, 11 skips, one disabled test and three failures. The same three tests failed on unchanged main: |
|
Tested
AI-assisted (Claude Code). |
|
Summary: gta6rt: a creating GAME: open answers for a name only the package has touches Why merge: Addresses a concrete failure mode with a focused change and regression coverage. The patch stays inside the affected code path, so it is low risk and prevents bad output or failures in real use. Verdict: Approve |
…package file FILE_FLAG_DELETE_ON_CLOSE deletes the file whatever access the open asks for: the host adds DELETE to it. The shim chose between the package and the overlay from the access mask and the disposition only, so a read-only open with the flag went to the package path, and closing the handle removed the file from the game folder. Such an open now counts as a write and uses the overlay copy. When it succeeds on a name the package has, the name gets the marker DeleteFile leaves, so after the close the title sees the file gone and the package still holds it. CreateFile2 reads the flag from its extended parameters. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
mark_deleted_on_close read the last error only after its own file queries, which had already replaced it: OPEN_ALWAYS with FILE_FLAG_DELETE_ON_CLOSE on a package file returned a handle with ERROR_PATH_NOT_FOUND as the last error instead of ERROR_ALREADY_EXISTS, and a new name could keep a stale value instead of 0. The value is now taken right after the host's open and put back after the marker. Found in review by @kacper-serewis. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… the title sees CREATE_NEW goes to the overlay, where a file only the package has is not there to refuse it. With FILE_FLAG_DELETE_ON_CLOSE the open made a new overlay file, and the marker written for the flag hid the package file after the close: a file the open should never have got was deleted from the title's view. The host fails such an open with ERROR_FILE_EXISTS, and so does open_target now. A name a deletion marker has freed is not in the view and can still be created. Found in review by @kacper-serewis. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…allocates create_file_w and create_file2 read GetLastError() as the first statement after the host's open and pass it to opened_delete_on_close. Before, the helper read it, after the std::wstring for its parameter was built; an allocator that changes the last error would replace ERROR_ALREADY_EXISTS. No such change was seen with the host's allocator. file_system_test replaces operator new so two checks can make every allocation set the last error; they fail without the change. The CreateFile2 checks of the delete-on-close block run only when the function is registered, and one check reports a missing registration. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A creating open goes to the overlay, where a name only the package has does not exist yet, so the host answered as for a new name: CREATE_NEW returned a handle to an empty overlay file that reads then preferred over the package file, CREATE_ALWAYS left no ERROR_ALREADY_EXISTS, and a package folder's name could be created as a file. open_target now decides these from the title's view of the name before the host is called: ERROR_FILE_EXISTS for CREATE_NEW on a file, ERROR_ALREADY_EXISTS as the last error after CREATE_ALWAYS replaces one, and ERROR_ACCESS_DENIED for a folder's name, the host's answers for a name that exists. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…older as the host does FILE_FLAG_BACKUP_SEMANTICS is how a folder is opened. With it the host fails CREATE_NEW and CREATE_ALWAYS on a folder's name with ERROR_FILE_EXISTS and lets OPEN_ALWAYS open the folder, reporting ERROR_ALREADY_EXISTS; the shim answered ERROR_ACCESS_DENIED for all three when only the package had the folder. OPEN_ALWAYS now goes to the package folder when it asks for no write access, as OPEN_EXISTING does, and otherwise to a mirror of the folder in the overlay, as SetFileAttributes makes one, so the package is not written. Measured on the host and reported by @Parakeet-Wheat. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Rebased the two commits in this PR onto #3489 at The Windows RelWithDebInfo build passes. All 504 file-system checks pass. Python compilation passes. Full CTest has 255 passes, 11 skips, one disabled test and four failures. The same four tests fail on main and #3489: AI-assisted. |
c591e18 to
2971208
Compare


Claim: #3381 (comment) (a new RT item, no ID yet)
Depends on: #3489
This branch is built on #3489 because both change
create_file_wandcreate_file2; until that one is merged the diff here shows its commit too. The commit of this pull request is the second one, "a creating GAME: open answers for a name only the package has".What and why
A creating open (
CREATE_NEW,CREATE_ALWAYS,OPEN_ALWAYS) of aGAME:path goes to the overlay. A name only the package has does not exist there yet, so the host answered as for a new name:CREATE_NEW, a fileERROR_FILE_EXISTSERROR_FILE_EXISTSCREATE_ALWAYS, a fileERROR_ALREADY_EXISTSERROR_ALREADY_EXISTSOPEN_ALWAYS, a fileERROR_ALREADY_EXISTSERROR_ACCESS_DENIEDERROR_ACCESS_DENIEDThe
CREATE_NEWcase is the one that loses something: the empty overlay file is what reads prefer from then on, so the package file's contents are hidden from the title. The same happened throughCreateFile2.The host column was measured here with the real
CreateFileWon scratch files (handle andGetLastErrorfor each row, and 0 for a name that does not exist).The change
open_target(runtime/shims/file_system.cpp) looks at the title's view of the name before the host is called, for the three creating dispositions only: a package folder fails withERROR_ACCESS_DENIED,CREATE_NEWon a package file fails withERROR_FILE_EXISTS, andCREATE_ALWAYSon one is remembered socreate_file_w/create_file2setERROR_ALREADY_EXISTSafter a successful open. A name the overlay already has, a name the title deleted, and a new name go to the host as before. Three sentences indocs/runtime_imports.md.Reproduction (no game files)
The new block in
runtime/test/file_system_test.cppmakes files and a folder in the test's own stand-in package folder under%TEMP%and opens them through the shim. Without the fix (on #3489's head;mainf847748 behaves the same for these opens):With it:
164 check(s), 0 failure(s). The block also checks thatCREATE_ALWAYSon a new name reports no error and thatCREATE_NEWstill makes a name the title deleted.Tests run
Windows 11, Visual Studio 18 (MSVC 14.51), Windows SDK 10.0.26100.8249, CMake 4.4.3 + Ninja, RelWithDebInfo, Vulkan headers from
-DLEONIDA_VULKAN_HEADERS_FETCH=ON; no glslangValidator, llvm-mc or SDL3, so the tests that need them were not built.cmake --build <build>: no warnings in the changed files.file_system_test: 164 checks, 0 failures.ctest -C RelWithDebInfo --output-on-failure: 122 tests, 120 passed, 2 failed (d3d12_present,xbox_present), 8 skipped, 1 disabled. Those two fail on this machine on unchangedmainas well, on the swapchain-extent check (d3d12_present_test.cpp:386,xbox_present_test.cpp:402), and vary from run to run (one of them passed in another run); the machine runs a tiling window manager that resizes new windows, which is the likely cause, not confirmed. Neither touches the file shim.python -I tests/test_docs_links.py: OK.python -m compileall -q make_game.py tools tests: exit 0.GPU: the change and its test use none. The full
ctestrun used an NVIDIA GeForce RTX 4090, driver 32.0.16.2101 (an AMD Radeon integrated GPU, driver 32.0.21043.5001, is also present).#3485 and #3511 (RT-218,
G:\/T:\) and #3063 (copy-up staging) change other parts offile_system.cppand do not change these answers; whichever lands later will need a rebase aroundopen_target.AI-assisted (Claude Code).
🤖 Generated with Claude Code