Repository navigation
runtime: LEONIDA_SKIP_ASSERTS steps over guest asserts without a trace (OLD-9961, RT-526) - #1395
Diegobecker07 wants to merge 1 commit into
Conversation
…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>
440c173 to
bd2170a
Compare
|
Rebased onto current main (0d80bc5); the
Re-verified on Windows 11 Pro (26300), MSVC 19.44, NVIDIA RTX 5070 Ti (driver 621.24): full runtime build, ctest 441/441, including Main's CI for this push is waiting for workflow approval (first-time contributor). AI-assisted. |
|
Hi @Diegobecker07, thanks for this pull request. It currently conflicts with AI-assisted (Claude Code, Claude Opus 5.5). |
Claimed in the coordination issue as: OLD-9961 (#14 (comment))
Carries over the assert half of #228 (old upstream PR 9961 by slipperysquid, RT-526), rebased on current
main, with the author kept. #228's other half, caller logging for forwarded device slots, is left out: #1390 carries old PR 9990 (#260), which does the same with a smaller change. With both in, #228 can be closed.What and why
LEONIDA_SKIP_ASSERTS=Nis a retail-boot diagnostic, off unless set.--initand--runinstall a vectored exception handler (runtime/src/assert_skip.h) before any image code runs. It steps over up to Nint3(0xCC) at addresses in no host module, and logs each one:[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;It needs no
--traceand no debugger. With a trace open, each skip is also anint3_skippedevent.LEONIDA_SKIP_INT3stays as it is (trace only, no limit, one log per address).tools/int3_cause.pyonmainalready namesLEONIDA_SKIP_ASSERTSamong the switches that report an assert's address, butmain's runtime did not have it.Compared with #228's commit:
set_caller_describer/device_slot_first_callerind3d12_xs_device.*, its call inmain.cpp,check_slot_callersinxs_proxy_mock_test.cpp, the caller paragraph indocs/d3d12_command_objects.md, and the caller bullet indocs/boot.md;main.cpp:main's CPU-emulation handler is installed first, then this one.The commit message says the same.
Tested
scripts\build_runtime.ps1(MSVC 19.44, VS 2022 Build Tools, CMake 3.31.6 + Ninja, Vulkan SDK 1.4.363.0): builds.ctest -R "assert_skip|int3_skip|skip_asserts|run_tiny_game|xs_proxy_mock|pe_loader|loader": 25/25 passed, among them the newassert_skipandrun_tiny_game_skip_asserts.LEONIDA_D3D12=vulkan, overlay outside the package):mainbefore d3d12_xs: the title's XMem hooks, console render-target sizes and resource leases, again (RT-XMEM-LEASE) #375, the same handler (runtime: LEONIDA_SKIP_ASSERTS and caller logging for forwarded device slots (RT-526) #228 merged locally on4a50cafc7) stepped over the render-target budgetint3withLEONIDA_SKIP_ASSERTS=5:int3 at game_scarlett_master.exe+0x… stepped over (1 of 5). The run then went on toXboxBvhBuilder.dll's first compute pipeline.mainwith this branch, the handler is installed (LEONIDA_SKIP_ASSERTS=5: up to 5 int3 in guest code are stepped over). No guestint3is reached any more, and the run ends as onmain.GPUs tested: NVIDIA GeForce RTX 5070 Ti, driver 621.24, Vulkan 1.4.357, Windows 11 Pro 26300
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)