RT-HANG-DUMP-THREAD-STACKS: port the LEONIDA_HANG_DUMP thread-stack-dump knob to main #2120

Closed
tengotengo wants to merge 1 commit from upstream-pr/2120 into main
tengotengo commented 2026-11-25 21:31:44 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by tengotengo on 2026-11-25T21:31:44Z.


Claimed in the coordination issue as: RT-HANG-DUMP-THREAD-STACKS (comment 7174559848 on #1608)

The boot prototype (a66c1422e line, public in this repo) has a LEONIDA_HANG_DUMP= env knob that dumps every thread's stack into the run. It is absent on post-#984 main: launch-3's LEONIDA_HANG_DUMP=30 was a silent no-op (grep-verified), so every defused-watchdog stall had to be diagnosed with eu-stack from the host instead.

This PR ports the minimal unit from the public boot-prototype commit d0c45aacc (code: DadaCap) into runtime/shims/startup_trace.h — a single file, +62 lines: the includes (tlhelp32.h, , ), the log_thread_stack/log_thread_stack_guarded/dump_thread_stacks/start_hang_dump block, and the one-line open() hook. Env-gated, off by default, stdlib-only. The doc-comment hunk of d0c45aacc does not apply to current main (header drift) and is dropped; the code is complete without it.

Verified: compiles clean in the cross build on current main (gta6rt + gta6rt_tls_host, RelWithDebInfo, xwin). A live run (RTX 5060 Ti / Proton 11 SLR, post-#1558/#1723 main) is starting with the knob set — I'll report the fired dump as a follow-up.

No game data. AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5499518663 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2120). Originally posted by [tengotengo](https://github.com/tengotengo) on 2026-11-25T21:31:44Z. --- Claimed in the coordination issue as: RT-HANG-DUMP-THREAD-STACKS (comment 7174559848 on #1608) The boot prototype (a66c1422e line, public in this repo) has a LEONIDA_HANG_DUMP=<seconds> env knob that dumps every thread's stack <seconds> into the run. It is absent on post-#984 main: launch-3's LEONIDA_HANG_DUMP=30 was a silent no-op (grep-verified), so every defused-watchdog stall had to be diagnosed with eu-stack from the host instead. This PR ports the minimal unit from the public boot-prototype commit d0c45aacc (code: DadaCap) into runtime/shims/startup_trace.h — a single file, +62 lines: the includes (tlhelp32.h, <thread>, <vector>), the log_thread_stack/log_thread_stack_guarded/dump_thread_stacks/start_hang_dump block, and the one-line open() hook. Env-gated, off by default, stdlib-only. The doc-comment hunk of d0c45aacc does not apply to current main (header drift) and is dropped; the code is complete without it. Verified: compiles clean in the cross build on current main (gta6rt + gta6rt_tls_host, RelWithDebInfo, xwin). A live run (RTX 5060 Ti / Proton 11 SLR, post-#1558/#1723 main) is starting with the knob set — I'll report the fired dump as a follow-up. No game data. AI-assisted.
tengotengo commented 2026-11-25 23:41:31 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by tengotengo on 2026-11-25T23:41:31Z.


The knob fires on post-#984 main: launch-4 run-1 (b9320a118 + this commit, RTX 5060 Ti / Proton 11 SLR) with LEONIDA_HANG_DUMP=1200 logged 91 thread_stack trace events at exactly t=1200.201583 s (trace 155 → 246 events), one per TID, with guest frames — that dump pinned the storm's character (38 threads parked in the 0x2215eca supervisor frame; one deep worker stack; a wine XInput1_4.dll thread) and is what makes the input dead-end finding above diagnosable. No game data. AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7177915434 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/2120#issuecomment-7177915434). Originally posted by [tengotengo](https://github.com/tengotengo) on 2026-11-25T23:41:31Z. --- The knob fires on post-#984 main: launch-4 run-1 (b9320a118 + this commit, RTX 5060 Ti / Proton 11 SLR) with LEONIDA_HANG_DUMP=1200 logged 91 thread_stack trace events at exactly t=1200.201583 s (trace 155 → 246 events), one per TID, with guest frames — that dump pinned the storm's character (38 threads parked in the 0x2215eca supervisor frame; one deep worker stack; a wine XInput1_4.dll thread) and is what makes the input dead-end finding above diagnosable. No game data. AI-assisted.
aslan2142 commented 2026-12-01 12:21:11 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T12:21:11Z.


Marking Ready for Review since no WIP/blocker reason for draft status is specified on this PR, so it can enter normal CI and review.

(AI-assisted triage.)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7311008925 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2120#issuecomment-7311008925). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T12:21:11Z. --- Marking Ready for Review since no WIP/blocker reason for draft status is specified on this PR, so it can enter normal CI and review. *(AI-assisted triage.)*
aslan2142 commented 2026-12-01 16:42:11 +00:00 (Migrated from github.com)

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


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:7318065985 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2120#issuecomment-7318065985). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T16:42:11Z. --- 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!2120
No description provided.