Repository navigation
Conversation
… slots (RT-526) Two diagnostics for the retail boot (RT-5 follow-ups), both off the hot path and with no behaviour change unless asked for: - LEONIDA_SKIP_ASSERTS=N (src/assert_skip.h, installed by main.cpp before any image code runs under --init/--run): a vectored handler, added last, steps over up to N int3 (0xCC) at addresses in no host module and logs each one as module+RVA (and as an int3_skipped trace event when --trace is open). After N it says so once and the next int3 ends the run as before. An int3 in a host module, a breakpoint with no 0xCC at its address, or a RIP that is neither at nor one past the 0xCC is passed on. Needs no --trace and no debugger. - The first call of every device slot the Xbox device proxy's generic thunk takes by number (PC pass-through, the routed Xbox slots, the refused tail) logs its caller: the thunk's return address, described by set_caller_describer (gta6rt registers rt::shims::module_offset), else the bare address. device_slot_first_caller is the test helper. Tests (synthetic, no game files): assert_skip_test (int3 in a VirtualAlloc'd page, the limit, a host-module int3, a two-byte int 3, value parsing), run_tiny_game_skip_asserts (two int3 in the mapped stand-in game, stepped over end to end), and xs_proxy_mock_test's check_slot_callers (stderr captured). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 24, 2026
This was referenced Nov 24, 2026
|
Carried over in two parts, so the two RT-526 drafts no longer overlap:
Once #1395 and #1390 are reviewed, this draft can be closed in their favour. |
Diegobecker07
pushed a commit
to Diegobecker07/leonida
that referenced
this pull request
Nov 25, 2026
…e (RT-526) A diagnostic for the retail boot (RT-5 follow-ups), off the hot path and with no behaviour change unless asked for: LEONIDA_SKIP_ASSERTS=N (src/assert_skip.h, installed by main.cpp before any image code runs under --init/--run): a vectored handler, added last, steps over up to N int3 (0xCC) at addresses in no host module and logs each one as module+RVA (and as an int3_skipped trace event when --trace is open). After N it says so once and the next int3 ends the run as before. An int3 in a host module, a breakpoint with no 0xCC at its address, or a RIP that is neither at nor one past the 0xCC is passed on. Needs no --trace and no debugger. Tests (synthetic, no game files): assert_skip_test (int3 in a VirtualAlloc'd page, the limit, a host-module int3, a two-byte int 3, value parsing) and run_tiny_game_skip_asserts (two int3 in the mapped stand-in game, stepped over end to end). Carried over from old upstream PR 9961 (ProjectLeonida#228) without its caller logging for forwarded device slots, which the carry-over of old PR 9990 (ProjectLeonida#1390) brings instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
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.
Original description (mentions and
#Nreferences are disabled; the numbers refer to the old repository):Claimed in the coordination issue as: RT-526 (two RT-5 boot diagnostics)
Depends on: none
What and why
Two retail-boot diagnostics, as RT-526 specifies. Neither changes anything unless asked for.
LEONIDA_SKIP_ASSERTS=N(runtime/src/assert_skip.h, installed bymain.cppunder--init/--runbefore the first TLS callback). Without a debugger, a guest assert'sint3is an unhandledEXCEPTION_BREAKPOINTand the run ends there. This adds a vectored handler, registered last so every other handler sees the breakpoint first. It steps over up to Nint3(byte0xCC) at addresses in no host module, which means the Loader's mapped images and code a title wrote itself. Each one gets a log line:[rt] LEONIDA_SKIP_ASSERTS: int3 at game.exe+0x1234 stepped over (1 of 3)After N it says so once, and the next
int3ends the run as before. It passes on:int3in a host module (gta6rt, its shims, system DLLs);0xCCat its reported address;0xCCnor one byte past it.On x64 Windows, and measured here under Wine 10.0 (the test checks it), RIP is the
0xCC's own address, and the handler moves it one byte on. No--traceis needed. With a trace open, each skip is also anint3_skippedevent with askipcount, and the trace's own handler records the breakpoint and its stack first.0or unset installs nothing.0.LEONIDA_SKIP_INT3(trace-only, no limit, one log per address) stays as it is. The docs say how the two differ.Caller of each forwarded device slot. The first call of every device slot taken by the proxy's generic thunk now names its caller:
device slot 25 (GetResourceAllocationInfo) first call from game.exe+0x1234. Those are the PC slots passed through by number, the routed Xbox slots 48/73/78/79/80, and the refused tail. The caller is_ReturnAddress()in the thunk, described through a newset_caller_describer, which gta6rt points atrt::shims::module_offset. With no describer, the bare address is logged. Slots with handlers of their own keep their current line. Until now, finding a slot's call site took a debugger.Docs:
runtime/README.md(new "Guest asserts" section, the trace table row),docs/boot.md(useful switches) anddocs/d3d12_command_objects.md§5.2.tools/boot_trace.py's label forint3_skippednow names both switches.Tested
All tests are synthetic. No game files, no game data.
Cross-build: Linux, clang-cl 21 / lld-link 21 against an xwin
/winsysrootsplat (MSVC 14.44, SDK 10.0.26100),runtime/cmake/clang-cl-xwin.cmake, Ninja, RelWithDebInfo. Tests ran under Wine 10.0 (Ubuntu 10.0~repack-12ubuntu1) through ctest's crosscompiling emulator.assert_skip(new) passed. It covers value parsing; int3 in aVirtualAlloc'd page no host module owns; a limit of 2, where the third is passed on; a host-module__debugbreakpassed on; a two-byteint 3(CD 03) passed on; and RIP at the0xCCunder Wine.int3_skip(existing) passed.run_tiny_game_skip_asserts(new) passed.gta6rt --run tiny_game -- hello 42 int3runs withLEONIDA_SKIP_ASSERTS=2: two int3 in the mapped stand-in game are stepped over (tiny_game.exe+0x…), and the game reaches its normal exit 0.xs_proxy_mockwith the newcheck_slot_callerspassed, stderr captured. Checks:Current upstream
main(e56d979) does not build gta6rt,xs_proxy_mock_testordevice_proxy_test, without this change too:shims/d3d12_xs_device.cppcallsrt::d3d12::create_console_descriptor_heapwith no declaration in scope. Its definition is in the Vulkan layer, which these targets don't link.shims/acphal.cpp'sSHAPE_XMA_CONTEXT/SHAPE_PCM_CONTEXTsizestatic_asserts fail.So on that base,
main.cppand the new test objects were compiled andassert_skip/int3_skipwere run.xs_proxy_mockwas run with a local, uncommitted declaration and stub forcreate_console_descriptor_heap: the new check passes, and the existingcheck_console_command_listthen fails at its slot-14 heap creation on that stub (not this change; the new check runs before it). The whole change was also built on the previousmain(867d922), where everything links. There, gta6rt,xs_proxy_mock(all 6 tests),assert_skip,int3_skip,run_tiny_game_skip_assertsand the 18 gta6rt/loader/tiny_game tests all passed.Linux portable subset:
cmake -S runtime -B runtime/build/linux && cmake --build runtime/build/linux --parallel && ctest --test-dir runtime/build/linux --output-on-failure. 70/70 passed (2 skipped as usual:shader_library_corpus,vk_sync_validation).python -I tests/test_boot_trace.pyandpython -I tests/test_docs_links.pypass.python -I tests/test_docs_env_vars.py:LEONIDA_SKIP_ASSERTSis documented. The test still fails on upstreammainforLEONIDA_RNG_SEED(runtime/shims/bcrypt_rng.cpp), which no document names. That predates this change.python -I scripts/check_no_game_data.pyon every changed file: clean.Not run: native Windows/MSVC, and
device_proxy_test(WARP, needsd3d12.dll). No GPU is involved.AI-assisted: yes (Claude Code)
Checklist
docs/design.md, with how it was confirmed. (n/a: no translator change)🤖 Generated with Claude Code