startup trace: a null transfer names its caller only when the call is proven (OLD-7189, carries #41) #1828

Closed
potatoe0100 wants to merge 4 commits from upstream-pr/1828 into main
potatoe0100 commented 2026-11-25 12:45:34 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by potatoe0100 on 2026-11-25T12:45:34Z.


Claimed in the coordination issue as: OLD-7189 (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7162808978)

What and why

Carries forward old-pr/7189 (draft #41) by @rafaelpssz, rebased on main 0d80bc5df with the author's three commits unchanged in content. An access violation at a null-page address is a fetch fault with nothing to unwind from, so the startup trace now names who got there: null_call_from when the instruction before the top-of-stack frame is an indirect call whose operand, with the fault's registers, is the faulting address, otherwise null_transfer_return (a tail jump). registry skips the module lookup below 0x10000, so a fault at 0 is 0x0 under Wine too. This helps world-start debugging, where null calls show up in the trace.

Rebase notes:

  • runtime/shims/startup_trace.h conflicted with main's register dump (regs), the tls_index0 event and dump_transient_pool. Kept all of main's, put the null-transfer handling after regs (on the same CONTEXT copy, so regs still shows the registers at the fault), and renumbered the example events in the header comment.
  • One extra commit of mine on top: startup_trace_test looked for null transfers with "at":"0x0" anywhere in the line, and main's runs entries also carry "at":"0x0", so the read fault inside the image matched as a fifth null transfer. It now matches "at":"0x0","access".

Supersedes draft #41 (its branch can be deleted once this lands).

Tested

VS 2022 (MSVC 19.44) RelWithDebInfo + Ninja, Vulkan SDK 1.4.363.0.

  • startup_trace_test: 43 checks, 0 failed (9 failed before the test fix above, all from the extra match).
  • Full ctest -j 6: 415 tests, all pass. xmem, xmem_* and xs_proxy_mock failed once while three other builds ran at the same time and pass 3 of 3 on their own.

GPUs tested: NVIDIA GeForce RTX 4060, driver 621.14, Windows 11 Pro 26H2 (build 26300)

AI-assisted: yes (Claude Code), by a non-developer tester.

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator change)

🤖 Generated with Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5491585280 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1828). Originally posted by [potatoe0100](https://github.com/potatoe0100) on 2026-11-25T12:45:34Z. --- Claimed in the coordination issue as: OLD-7189 (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7162808978) ### What and why Carries forward `old-pr/7189` (draft #41) by @rafaelpssz, rebased on `main` `0d80bc5df` with the author's three commits unchanged in content. An access violation at a null-page address is a fetch fault with nothing to unwind from, so the startup trace now names who got there: `null_call_from` when the instruction before the top-of-stack frame is an indirect call whose operand, with the fault's registers, is the faulting address, otherwise `null_transfer_return` (a tail jump). `registry` skips the module lookup below 0x10000, so a fault at 0 is `0x0` under Wine too. This helps world-start debugging, where null calls show up in the trace. Rebase notes: - `runtime/shims/startup_trace.h` conflicted with `main`'s register dump (`regs`), the `tls_index0` event and `dump_transient_pool`. Kept all of `main`'s, put the null-transfer handling after `regs` (on the same `CONTEXT` copy, so `regs` still shows the registers at the fault), and renumbered the example events in the header comment. - One extra commit of mine on top: `startup_trace_test` looked for null transfers with `"at":"0x0"` anywhere in the line, and `main`'s `runs` entries also carry `"at":"0x0"`, so the read fault inside the image matched as a fifth null transfer. It now matches `"at":"0x0","access"`. Supersedes draft #41 (its branch can be deleted once this lands). ### Tested VS 2022 (MSVC 19.44) RelWithDebInfo + Ninja, Vulkan SDK 1.4.363.0. - `startup_trace_test`: 43 checks, 0 failed (9 failed before the test fix above, all from the extra match). - Full `ctest -j 6`: 415 tests, all pass. `xmem`, `xmem_*` and `xs_proxy_mock` failed once while three other builds ran at the same time and pass 3 of 3 on their own. GPUs tested: NVIDIA GeForce RTX 4060, driver 621.14, Windows 11 Pro 26H2 (build 26300) AI-assisted: yes (Claude Code), by a non-developer tester. ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator change) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MoonEyes commented 2026-11-28 02:55:44 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T02:55:44Z.


Hi @potatoe0100, thanks for this pull request. It currently conflicts with main (conflicting file(s): runtime/shims/startup_trace.h), so it carries the needs rebase label. CONTRIBUTING.md asks authors to rebase their branch on main; once it merges cleanly the label goes within the hour, and reviews start with the pull requests that do. Could you update the branch when you have a moment? If you no longer plan to continue with it, please say so here.

AI-assisted (Claude Code, Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7232683891 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1828#issuecomment-7232683891). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-28T02:55:44Z. --- Hi @potatoe0100, thanks for this pull request. It currently conflicts with `main` (conflicting file(s): `runtime/shims/startup_trace.h`), so it carries the `needs rebase` label. CONTRIBUTING.md asks authors to rebase their branch on `main`; once it merges cleanly the label goes within the hour, and reviews start with the pull requests that do. Could you update the branch when you have a moment? If you no longer plan to continue with it, please say so here. AI-assisted (Claude Code, Claude Opus 5.5).
aslan2142 commented 2026-12-01 16:38:05 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T16:38:05Z.


Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (d3d12/) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, d3d12/, or general docs), please feel free to reopen it.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7317933158 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1828#issuecomment-7317933158). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T16:38:05Z. --- Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (`d3d12/`) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, `d3d12/`, or general docs), please feel free to reopen it.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!1828
No description provided.