Repository navigation
gta6rt: LEONIDA_PROBE logs the registers at chosen RVAs of the executable (finds which call of a retail init failed) - #7555
Conversation
…able A diagnostic for the retail boot: with --trace, LEONIDA_PROBE=<rva>[,...] puts a breakpoint at each RVA of the mapped main image. A hit logs the general registers and the return address (a "probe" event and an [probe] line), puts the original byte back, runs the instruction under the trap flag and re-arms the breakpoint. LEONIDA_PROBE_MAX sets how many hits per address are logged (16), LEONIDA_PROBE_MEM=1 adds the qwords at rdi and rsi. A probe after each call of a long init function names the one that failed. probe_test runs it on a synthetic function. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Independent Windows + MSVC review and test of Setup: Windows 11 Pro ( Tests run (synthetic only):
Code findings (
AI-assisted review and test. |
|
Windows + GPU check (host-side probe tool). Hardware: NVIDIA GeForce RTX 5080 + RTX 3070 Ti (driver 621.01) and AMD Radeon 610M iGPU (Ryzen 9 9950X3D, driver 32.0.13018.6). OS: Windows 11. Toolchain: MSVC (VS BuildTools 18) + Ninja, single-config RelWithDebInfo; llvm-mc 21.1.8; SPIRV-Tools. Configured with -DLEONIDA_LLVM_MC and -DLEONIDA_SPIRV_AS/VAL. Tested head bc0471a (base 1ce6eb5). Build: 381/381 targets, 0 errors/warnings. Targeted tests, --repeat until-fail:3 on the RTX 5080: probe (the new test this PR adds) and startup_trace - both pass x3. Full runtime suite, ctest -C RelWithDebInfo -j 6, excluding the 4 windowed present tests: RTX 5080 268 run, 2 failed - d3d12_vulkan_device, d3d12_indirect_dispatch_count. This PR's diff is host-side only (startup_trace.h, main.cpp, probe_test.cpp, CMakeLists.txt, docs) - it touches no GPU / D3D12 device code, so it cannot have introduced these GPU-test failures; they are base-line (the same two are red on current main dde82f2, established earlier this session). Scope note: the change is a host-side register-probe / logging tool with no GPU or present/swapchain code path, so I scoped this check to the NVIDIA full suite plus the new probe test rather than re-running the iGPU and present passes. Net: the new probe test and startup_trace are green x3; the only full-suite failures are base-line GPU tests outside this host-side PR's scope. Synthetic fixtures only, no game files. AI-assisted (opencode); runs on my machine. |
|
Tested
AI-assisted. |
|
Tested
No game files. AI-assisted (Claude Code). |
|
Tested bc0471a (head of this PR) on RTX 5070 Ti (Blackwell, subgroup 32), NVIDIA 621.01, Windows 11, MSVC 14.44 (VS 2022 17.14 Build Tools), CMake 4.5.1 + Ninja, Vulkan headers sdk-1.4.363.0 (fetched), no game copy: pass. I applied the diff to a clone of main at dfe4e4a (clean git apply), built probe_test (new in this PR) and ran it: exit 0, "probe_test: OK", including "the second hit sees the next argument" and "no probe hit reaches the exception log". The test is new, so there is no main to compare against; I did not run the LEONIDA_PROBE option against a real executable, as there is no game copy. AI-assisted (Claude Code): checked by applying the diff to a private clone of main and building and running the tests above. No game data was used. |
Claimed in the coordination issue: #7231 (comment) (new RT diagnostic item).
Depends on: none.
What and why
The retail boot keeps stopping on asserts that fire after a long init function returns false. Finding which call inside it failed has meant reading thousands of instructions or attaching a debugger.
LEONIDA_PROBEdoes it from the command line:LEONIDA_PROBE=<rva>[,<rva>...](hex, as the trace'smodule+RVAprints them), with--trace, puts a breakpoint at each RVA of the mapped main image. It's armed inmain.cppright afterloader.load, before any image code runs. An RVA outside the image is ignored with a line.probeevent (and an[probe]stderr line) with the general registers and the qword atrsp, which is the return address at a function's first instruction. It then puts the original byte back, runs the instruction under the trap flag, and re-arms the breakpoint on the single-step. Execution continues unchanged.LEONIDA_PROBE_MAX=Nlogs N hits per address (default 16).LEONIDA_PROBE_MEM=1also logs the first 8 qwords atrdiandrsi, read withReadProcessMemory, so a bad pointer prints-.docs/boot.mdlists it under "Useful switches". It says that registers and memory can hold game data, so the output stays on the player's machine and only what it shows is reported.Put a probe on the instruction after each call, and the first
raxthat is an error names the call. On my own copy that's how two stops were found (details in the claim comment): the graphics init failing on anE_NOTIMPLfrom the fifthCreateCommandSignature, which #7330 fixes, and the slot-25 size assert on a B5G5R5A1 UAV target and an R32G8X24 depth-stencil + UAV target.Tested
Windows 11, i7-14700K, RTX 4070 SUPER, MSVC 2022 (14.44) RelWithDebInfo, Visual Studio generator, on
main9f53c502e:probe_test(CTestprobe): OK. It probes the second instruction of a synthetic three-instruction function withLEONIDA_PROBE_MAX=2:probeevents are logged, withraxbefore the instruction ran;int3_skip_test: all checks passed.startup_trace_test: 26 checks, 0 failed.python -I scripts/check_no_game_data.py: exit 0.No game data: the PR contains no addresses, offsets or bytes from the executable.
AI-assisted: yes (Claude Code).
🤖 Generated with Claude Code