Repository navigation
Conversation
This was referenced Nov 24, 2026
The startup trace records a failed guest file open but not a successful one, so a run that stops making progress does not show which files the title had reached. With --trace on, the first 600 successful CreateFileW and CreateFile2 calls are written as file_open events with the path the title passed, the access mask and the caller. They have a budget of their own, apart from the 256 failures. The last error a successful open leaves (ERROR_ALREADY_EXISTS for OPEN_ALWAYS and CREATE_ALWAYS) is kept across the event write. With the trace off nothing changes. Cross-built gta6rt and file_system_test with clang-cl and ran the test under Wine 11.22. file_system_test --trace-opens passed 9 of 9 checks; with the base implementation 3 of the 9 failed (no file_open event). Without the last-error restore the OPEN_ALWAYS check failed. The plain file_system_test has the same 8 failures of 494 checks under Wine with and without the change. AI-assisted (Claude Code). Co-authored-by: Plaaasma <47513553+Plaaasma@users.noreply.github.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Moriz82
force-pushed
the
split/rt-trace-successful-opens
branch
from
November 25, 2026 03:50
873adc1 to
75731cf
Compare
Collaborator
Author
|
Rebased onto main at AI-assisted. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claimed in the coordination issue as: RT-TRACE-SUCCESSFUL-OPENS (claim).
Part of the split of #984 into small pull requests.
Depends on: none
Overlaps: #984 (integration source; there the success events were written without restoring the last error, here it is restored and tested). #41 (caller of a call through a null pointer), #638 (
LEONIDA_SKIP_INT3on title threads) and #994 (unhandled-exception log) add other startup-trace events. None records a successful open.What and why
gta6rt --trace FILEwrites afile_open_failedevent for a guest file open that fails. A run that stops making progress without a failed open leaves nothing in the trace about the files it had reached.With the trace on, a guest
CreateFileWorCreateFile2that succeeds now writes afile_openevent with the path the title passed, the requested access mask and the caller.CreateFileAgoes throughCreateFileWand is recorded as that.OPEN_ALWAYSandCREATE_ALWAYSreportERROR_ALREADY_EXISTSthrough the last error of a successful open. Writing the event changes the last error, so it is read before the event and put back after it.No new switch or environment variable: the events are written only when
--traceis on.docs/boot.mdand the event table inruntime/README.mdname the new event and both budgets.Tested
Cross-built on CachyOS Linux 7.3.5 with clang-cl 23.1.5 and the xwin SDK. Ran the Windows tests one at a time under Wine 11.22 (distribution package, a prefix of its own) on a Ryzen 5 5600X with 16 GB RAM.
file_system_test --trace-opensis the new form (CTest namefile_system_open_trace); it has a process of its own because the budgets are per process. Over temporary folders it opens a file before the trace is opened, then with the trace on opens one existing file throughCreateFile2withOPEN_ALWAYS, the same file 601 times throughCreateFileW, and one missing file, and reads the trace back.file_system_test --trace-opensCreateFile2success event, noCreateFileWsuccess events, not 600 events with path, access and caller.CreateFile2event, 599CreateFileWevents, 600 in all withGAME:\existing.txt, the access mask and a caller; all 601 further opens still succeed; 1file_open_failedevent; the file opened before the trace is not in it;OPEN_ALWAYSleavesERROR_ALREADY_EXISTS.file_system_test(trace off)6293c1c4f."Base implementation" is this branch with
runtime/shims/file_system.cppas it is on6293c1c4f.The 8 checks that fail in the plain form with and without the change are Wine differences: a host
ReadFileinto uncommitted pages, sixMAXIMUM_ALLOWEDopens and their overlay writes, and one long-listing wildcard (*.?.). None of them is in code this change touches.Mutation: with the
SetLastErrorafter the event removed,--trace-opensfailed 1 of 9 checks, "OPEN_ALWAYS preserves its success last-error". The restore is needed under Wine and the test sees it.The other test programs that compile
file_system.cppdo not open the startup trace, so the new function returns at its first line there:xgameruntime_test(158 checks),xgameruntime_user_test(42 checks, plain and bothLEONIDA_GAMERTAGforms),xgameruntime_gamesave_test(56),xgameruntime_store_test(27),xgameruntime_offline_test(69, plain andLEONIDA_HDR=1)dstorage_testE_PENDINGinstead of the expected error). Its sources are the base's exceptfile_system.cpp.python3 -I scripts/check_no_game_data.py,tests/test_docs_env_vars.py(4 tests),tests/test_ctest_registration.py(4 tests),git diff --checkcompileall, 520 files oftests/, the content guard)tests/test_imhex_patterns.py, as on the base. None added.Not run: native Windows (the 8 plain-form failures and the
dstorage_teststop are unverified there), Proton, CTest itself (the executables were started directly), theCREATE_ALWAYScase of the last error (onlyOPEN_ALWAYSis tested),CreateFileA, the translator's semantic suite (no Python or translator file changed) and a boot of the title.GPUs tested: none. The fixture uses files and the startup trace only.
AI-assisted: yes (Claude Code).
Checklist
6293c1c4f.🤖 Generated with Claude Code