runtime: LEONIDA_DEV_OVERLAY shows what the runtime is doing over the title's window (RT-DEV-OVERLAY) #2137

Manually merged
github merged 1 commit from gh-pr/2137/head into gh-pr/2137/base 2026-11-26 10:19:28 +00:00
Owner

@⁠Snooozs on GitHub · 2026-11-25 22:31 UTC · original
Snooozs:dev-overlay → main · +491 −2 · 9 files · 1 commits · merged 2026-11-25 23:02 UTC

Claimed in the coordination issue as: RT-DEV-OVERLAY (#1608)

What and why

LEONIDA_DEV_OVERLAY=1 (off by default, Windows) draws what the runtime is doing in a small click-through window over the top left corner of the title's window, while that window is in front:

  • frames and submissions a second;
  • where a submission's CPU time goes (descriptors, textures, copies, replay);
  • the phase that is running right now, and for how long once it passes a second;
  • pipeline builds: how many are done, how many are in flight, the last one started;
  • indirect draws emitted and skipped;
  • cores in use, the process's working set, free RAM.

LEONIDA_TITLE_HUD (#1922) stays as it is: frame times, memory and compile time in the title bar. The overlay is for the boots that look frozen. It has its own thread, window and GDI text, so it keeps counting while the title presents nothing for seconds (a pipeline build, a submission that waits), and its "now" line says which of them it is. It is in no captured frame and changes nothing the GPU does. If you would rather have these lines in title_hud.h, I move them.

  • src/dev_overlay.h: the window and the text (the text is a pure function).
  • src/dev_status.h: pipeline builds in flight. Two atomic operations and a short name copy per build, next to the existing pipeline_profile::DriverCall.
  • src/submit_phases.h: each Scope also counts its thread into its phase, and back into the outer phase when it ends. Counted per phase because queues submit from several threads: one "current phase" value goes stale when two scopes overlap and end in the order they began. Always on, a few relaxed atomics per scope.

Tested

  • New dev_overlay_test (no window, GPU or game file, portable): the text, the counter differences, nested scopes, two threads whose scopes overlap, the builds in flight. Two mutants of submit_phases.h (the outer phase not entered again; the phase not left) fail it.
  • gta6rt, dev_overlay_test and title_hud_test build with Visual Studio 2022 (RelWithDebInfo); both tests pass. Full ctest was not run.
  • In the game: I have used the overlay in my local boots (RTX 5060 Ti) on another base, where it named the state of a boot that looked hung. This cut on main, with the per-phase counts and the other two header changes, has not been booted with the game yet.

GPUs tested: n/a for the test; the local boots ran on an NVIDIA RTX 5060 Ti 16 GB, driver 621.01, Windows 10 19045.

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

Checklist

  • Based on current main and merges cleanly (checked against d3b67a704).
  • 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.
  • No new translator rule.

🤖 Generated with Claude Code

**@⁠Snooozs** on GitHub · 2026-11-25 22:31 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2137) `Snooozs:dev-overlay` → `main` · +491 −2 · 9 files · 1 commits · merged 2026-11-25 23:02 UTC Claimed in the coordination issue as: RT-DEV-OVERLAY (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608) ### What and why `LEONIDA_DEV_OVERLAY=1` (off by default, Windows) draws what the runtime is doing in a small click-through window over the top left corner of the title's window, while that window is in front: - frames and submissions a second; - where a submission's CPU time goes (descriptors, textures, copies, replay); - the phase that is running right now, and for how long once it passes a second; - pipeline builds: how many are done, how many are in flight, the last one started; - indirect draws emitted and skipped; - cores in use, the process's working set, free RAM. `LEONIDA_TITLE_HUD` (#1922) stays as it is: frame times, memory and compile time in the title bar. The overlay is for the boots that look frozen. It has its own thread, window and GDI text, so it keeps counting while the title presents nothing for seconds (a pipeline build, a submission that waits), and its "now" line says which of them it is. It is in no captured frame and changes nothing the GPU does. If you would rather have these lines in `title_hud.h`, I move them. - `src/dev_overlay.h`: the window and the text (the text is a pure function). - `src/dev_status.h`: pipeline builds in flight. Two atomic operations and a short name copy per build, next to the existing `pipeline_profile::DriverCall`. - `src/submit_phases.h`: each `Scope` also counts its thread into its phase, and back into the outer phase when it ends. Counted per phase because queues submit from several threads: one "current phase" value goes stale when two scopes overlap and end in the order they began. Always on, a few relaxed atomics per scope. ### Tested - New `dev_overlay_test` (no window, GPU or game file, portable): the text, the counter differences, nested scopes, two threads whose scopes overlap, the builds in flight. Two mutants of `submit_phases.h` (the outer phase not entered again; the phase not left) fail it. - `gta6rt`, `dev_overlay_test` and `title_hud_test` build with Visual Studio 2022 (RelWithDebInfo); both tests pass. Full ctest was not run. - In the game: I have used the overlay in my local boots (RTX 5060 Ti) on another base, where it named the state of a boot that looked hung. This cut on `main`, with the per-phase counts and the other two header changes, has not been booted with the game yet. GPUs tested: n/a for the test; the local boots ran on an NVIDIA RTX 5060 Ti 16 GB, driver 621.01, Windows 10 19045. AI-assisted: yes (Claude Code, Claude Opus 5.5). ### Checklist - [x] Based on current `main` and merges cleanly (checked against d3b67a704). - [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] No new translator rule. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A click-through window of its own with its own thread: frame and submission rate, a submission's CPU time by phase, the
phase running now, pipeline builds in flight, indirect draws, cores and memory. Off by default. submit_phases keeps
per-phase counts of the threads inside a phase, so overlapping submissions of several queues leave none behind.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:19:26 +00:00
github manually merged commit f6cb4aedfc into gh-pr/2137/base 2026-11-26 10:19:28 +00:00
Author
Owner

@⁠aslan2142 on GitHub · 2026-11-25 23:02 UTC · original

Merged, thanks! A good view for the boots that look frozen.

  • Reviewed: off by default (LEONIDA_DEV_OVERLAY=1). The always-on part is a few relaxed atomics per submission phase and per pipeline build, and nested scopes stay balanced. The overlay has its own thread and click-through window, and shows only over the title while it is in front.
  • One note, no change needed: active_since is stored just after the count goes from 0 to 1, so the "now" line can show a stale time for one refresh.
  • Follow-up: the real VRAM and private-memory figures under Wine from #2128 will be added to the overlay.
  • Tested: the full Windows suite under Wine on llvmpipe and the gfx1036 iGPU (RADV), merged onto main 5fab93967: no test went from pass to fail, and dev_overlay passes on both. The CI and ctest registration tests pass.
  • Checked on main a0723a9e9 + f6cb4aedf: it merges cleanly; the semantic suite passes (493 files, 6,318 tests, 0 files failed); the 15 docs and writer tests pass; check_no_game_data.py is clean on the 9 changed files.

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

**@⁠aslan2142** on GitHub · 2026-11-25 23:02 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2137#issuecomment-7177079722) Merged, thanks! A good view for the boots that look frozen. - **Reviewed:** off by default (`LEONIDA_DEV_OVERLAY=1`). The always-on part is a few relaxed atomics per submission phase and per pipeline build, and nested scopes stay balanced. The overlay has its own thread and click-through window, and shows only over the title while it is in front. - **One note, no change needed:** `active_since` is stored just after the count goes from 0 to 1, so the "now" line can show a stale time for one refresh. - **Follow-up:** the real VRAM and private-memory figures under Wine from #2128 will be added to the overlay. - **Tested:** the full Windows suite under Wine on llvmpipe and the gfx1036 iGPU (RADV), merged onto `main` `5fab93967`: no test went from pass to fail, and `dev_overlay` passes on both. The CI and ctest registration tests pass. - **Checked on `main` `a0723a9e9` + `f6cb4aedf`:** it merges cleanly; the semantic suite passes (493 files, 6,318 tests, 0 files failed); the 15 docs and writer tests pass; `check_no_game_data.py` is clean on the 9 changed files. AI-assisted (Claude Code, Claude Opus 5.5).
This discussion has been locked. Commenting is limited to contributors.
No description provided.