d3d12_xs: the first call of a forwarded device slot names its caller (RT-526) #260

Closed
github-bot wants to merge 2 commits from github-bot/gh-260 into main AGit
Owner

@⁠Andretuta on GitHub · 2026-11-24 02:54 UTC · original
ubiquitarianism:old-pr/9990 → main · +54 −3 · 4 files · 2 commits · closed without merging

Carried over from old PR 9990 by Amzi-01 in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/9990, exactly that PR's last commit. All carried-over PRs are listed in #17.
Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it.
Amzi-01: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one.


Original description (mentions and #N references are disabled; the numbers refer to the old repository):

RT-526 asked for two retail-boot diagnostics. One is already on main: stepping over the title's asserts is LEONIDA_SKIP_INT3 (runtime/shims/startup_trace.h, docs/boot.md). This PR adds the other one.

What: the first call of every Xbox device slot the proxy forwards by number (the generic branch of proxy_slot) now logs the title code that made it, as module+offset:

[rt] d3d12_xs: device slot N (name) first call from <module>+0x<offset>

device_slot_first_caller(slot) returns the same text ("" before a call). The caller is _ReturnAddress() of proxy_slot, the vtable entry the title calls, and rt::shims::module_offset names it. Slots with a handler of their own log as before. Until now, finding a new Xbox-only slot in the executable needed a debugger.

Tested:

  • gta6rt builds (MSVC 14.44, Release). Main doesn't build on MSVC right now; #9809 / #9815 fix that. I built with those three fixes applied locally and didn't commit them.
  • Own 1.0.2.1 copy, RTX 3060, LEONIDA_D3D12=vulkan, on top of #7503 so the boot reaches the device slots (main stops earlier, at DStorageGetFactory). 9 slots logged a caller, every one inside the title's executable. Slot 25's caller is the same title frame as the first title frame of the access violation that follows it, so the offsets are right. No offsets are posted here, per the project's rule.
  • No unit test: xs_proxy_mock_test and device_proxy_test don't build on main today. Both miss the Vulkan include path for gfx10_descriptors.h, and the mock test also misses create_console_descriptor_heap. That's a separate fix.

Counts only, no game data. AI-assisted.

🤖 Generated with Claude Code

**@⁠Andretuta** on GitHub · 2026-11-24 02:54 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/260) `ubiquitarianism:old-pr/9990` → `main` · +54 −3 · 4 files · 2 commits · closed without merging > Carried over from **old PR 9990** by `Amzi-01` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/9990`, exactly that PR's last commit. All carried-over PRs are listed in #17. > Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it. > `Amzi-01`: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one. --- Original description (mentions and `#N` references are disabled; the numbers refer to the old repository): RT-526 asked for two retail-boot diagnostics. One is already on main: stepping over the title's asserts is `LEONIDA_SKIP_INT3` (runtime/shims/startup_trace.h, docs/boot.md). This PR adds the other one. **What:** the first call of every Xbox device slot the proxy forwards by number (the generic branch of `proxy_slot`) now logs the title code that made it, as module+offset: ``` [rt] d3d12_xs: device slot N (name) first call from <module>+0x<offset> ``` `device_slot_first_caller(slot)` returns the same text ("" before a call). The caller is `_ReturnAddress()` of `proxy_slot`, the vtable entry the title calls, and `rt::shims::module_offset` names it. Slots with a handler of their own log as before. Until now, finding a new Xbox-only slot in the executable needed a debugger. **Tested:** - gta6rt builds (MSVC 14.44, Release). Main doesn't build on MSVC right now; `#9809` / `#9815` fix that. I built with those three fixes applied locally and didn't commit them. - Own 1.0.2.1 copy, RTX 3060, `LEONIDA_D3D12=vulkan`, on top of `#7503` so the boot reaches the device slots (main stops earlier, at DStorageGetFactory). 9 slots logged a caller, every one inside the title's executable. Slot 25's caller is the same title frame as the first title frame of the access violation that follows it, so the offsets are right. No offsets are posted here, per the project's rule. - No unit test: `xs_proxy_mock_test` and `device_proxy_test` don't build on main today. Both miss the Vulkan include path for `gfx10_descriptors.h`, and the mock test also misses `create_console_descriptor_heap`. That's a separate fix. Counts only, no game data. AI-assisted. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The first call of every Xbox device slot the proxy forwards by number now
logs the title code that made it as module+offset, and
device_slot_first_caller(slot) returns the same text. Finding a new
Xbox-only slot in the executable no longer needs a debugger.

AI-assisted.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- The proxy no longer calls rt::shims::module_offset itself: gta6rt sets it
  with set_device_slot_caller_formatter; with none set the address is shown
  in hex, so xs_proxy_mock_test links d3d12_xs_device.cpp alone as before.
- reset_device_proxy_stats() clears the stored caller with the first-call
  flag; xs_proxy_mock_test checks call -> caller -> reset -> empty -> call.
- The accessor comment says which slots it covers and that it is a
  diagnostic observation (flag set before the caller is stored).

AI-assisted.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:50:52 +00:00
Author
Owner

@⁠Diegobecker07 on GitHub · 2026-11-24 23:10 UTC · original

Carried over as #1390 (OLD-9990): both commits are kept with their author, rebased on current main (two add/add conflicts in runtime/shims/d3d12_xs_device.cpp, main's side kept and this PR's added), built and run on Windows with an RTX 5070 Ti. #228's LEONIDA_SKIP_ASSERTS half is carried over separately without its own caller logging, so the two RT-526 drafts no longer overlap. Once #1390 is reviewed, this draft can be closed in its favour.

**@⁠Diegobecker07** on GitHub · 2026-11-24 23:10 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/260#issuecomment-7147104353) Carried over as #1390 (OLD-9990): both commits are kept with their author, rebased on current `main` (two add/add conflicts in `runtime/shims/d3d12_xs_device.cpp`, `main`'s side kept and this PR's added), built and run on Windows with an RTX 5070 Ti. #228's `LEONIDA_SKIP_ASSERTS` half is carried over separately without its own caller logging, so the two RT-526 drafts no longer overlap. Once #1390 is reviewed, this draft can be closed in its favour.
github-bot closed this pull request 2026-11-27 04:04:14 +00:00
Author
Owner

@⁠Andretuta on GitHub · 2026-11-27 04:01 UTC · original

Closing carried-over draft: carried over in #1390 (OLD-9990).

**@⁠Andretuta** on GitHub · 2026-11-27 04:01 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/260#issuecomment-7209462602) Closing carried-over draft: carried over in #1390 (OLD-9990).

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.