runtime: LEONIDA_THREAD_SNAPSHOT names what every thread waits on at given times (OLD-9926) #1270

Open
github-bot wants to merge 1 commit from github-bot/gh-1270 into main AGit
Owner

@⁠ambroseautomation on GitHub · 2026-11-24 21:07 UTC · original
ambroseautomation:carry/old-9926-thread-snapshot → main · +550 −0 · 4 files · 1 commits · open

Claimed in the coordination issue as: OLD-9926 (#14)

What and why

Carries forward old-pr/9926 (draft #195, original commit author JRamos1993 preserved; indexed in #17), rebased cleanly onto current main (6261ca916).

Adds LEONIDA_THREAD_SNAPSHOT diagnostic thread-wait reporting to gta6rt (runtime/shims/thread_snapshot.h, wired in runtime/src/main.cpp):

  • At configured timestamps, suspends and snapshots live threads, grouping identical stacks and naming both the thread (SetThreadDescription / MS_VC_EXCEPTION) and the kernel object each waiting thread is blocked on (auto-reset/manual-reset events, joined threads, worker-factory pools, etc.) with resolved host symbols.
  • Adds runtime/test/thread_snapshot_test.cpp and registers thread_snapshot in runtime/CMakeLists.txt.

Tested

  • Compiled and ran thread_snapshot_test.exe natively on Windows 11 with MSVC (/std:c++20 /EHsc /W4 /permissive- /utf-8 /O2): all 6 checks PASS, zero compiler warnings.
  • Built runtime/build/gta6rt.exe via .\scripts\build_runtime.ps1 -jobs 8: succeeded cleanly with thread_snapshot.h included in runtime/src/main.cpp.
  • python -I scripts/check_no_game_data.py runtime/CMakeLists.txt runtime/shims/thread_snapshot.h runtime/src/main.cpp runtime/test/thread_snapshot_test.cpp: exit 0 (no game data).

GPUs tested: n/a (CPU/OS runtime diagnostics; built and tested on Windows 11 Pro 64-bit, MSVC VS 18)

AI-assisted: yes

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 — runtime diagnostics)
**@⁠ambroseautomation** on GitHub · 2026-11-24 21:07 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1270) `ambroseautomation:carry/old-9926-thread-snapshot` → `main` · +550 −0 · 4 files · 1 commits · open Claimed in the coordination issue as: OLD-9926 (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14) ### What and why Carries forward `old-pr/9926` (draft #195, original commit author `JRamos1993` preserved; indexed in #17), rebased cleanly onto current `main` (`6261ca916`). Adds `LEONIDA_THREAD_SNAPSHOT` diagnostic thread-wait reporting to `gta6rt` (`runtime/shims/thread_snapshot.h`, wired in `runtime/src/main.cpp`): - At configured timestamps, suspends and snapshots live threads, grouping identical stacks and naming both the thread (`SetThreadDescription` / `MS_VC_EXCEPTION`) and the kernel object each waiting thread is blocked on (auto-reset/manual-reset events, joined threads, worker-factory pools, etc.) with resolved host symbols. - Adds `runtime/test/thread_snapshot_test.cpp` and registers `thread_snapshot` in `runtime/CMakeLists.txt`. ### Tested - Compiled and ran `thread_snapshot_test.exe` natively on Windows 11 with MSVC (`/std:c++20 /EHsc /W4 /permissive- /utf-8 /O2`): all 6 checks PASS, zero compiler warnings. - Built `runtime/build/gta6rt.exe` via `.\scripts\build_runtime.ps1 -jobs 8`: succeeded cleanly with `thread_snapshot.h` included in `runtime/src/main.cpp`. - `python -I scripts/check_no_game_data.py runtime/CMakeLists.txt runtime/shims/thread_snapshot.h runtime/src/main.cpp runtime/test/thread_snapshot_test.cpp`: exit 0 (no game data). GPUs tested: n/a (CPU/OS runtime diagnostics; built and tested on Windows 11 Pro 64-bit, MSVC VS 18) AI-assisted: yes ### 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. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a — runtime diagnostics)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:45:08 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1270/head:github-bot/gh-1270'
git switch 'github-bot/gh-1270'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1270'
git switch 'github-bot/gh-1270'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1270'
git switch 'github-bot/gh-1270'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1270'
git switch 'main'
git merge --squash 'github-bot/gh-1270'
git switch 'main'
git merge --ff-only 'github-bot/gh-1270'
git switch 'main'
git merge 'github-bot/gh-1270'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.