[PR #1922] [MERGED] d3d12_xs: LEONIDA_TITLE_HUD shows frame rate, memory and pipeline compiles in the window's title bar (RT-TITLE-HUD) #1930

Closed
opened 2026-11-26 21:19:26 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1922
Author: @kawaii-shakal
Created: 11/25/2026
Status: ✅ Merged
Merged: 11/25/2026
Merged by: @aslan2142

Base: main ← Head: title-bar-hud


📝 Commits (2)

  • e86b3ce d3d12_xs: LEONIDA_TITLE_HUD shows frame rate, memory and pipeline compiles in the window's title bar (RT-TITLE-HUD)
  • 1c5e2dc title HUD: with no frame in an interval, show how long since the last one

📊 Changes

5 files changed (+280 additions, -4 deletions)

View changed files

📝 docs/boot.md (+12 -0)
📝 runtime/CMakeLists.txt (+10 -0)
📝 runtime/shims/d3d12_xs_device.cpp (+8 -4)
➕ runtime/shims/title_hud.h (+173 -0)
➕ runtime/test/title_hud_test.cpp (+77 -0)

📄 Description

Claimed in the coordination issue as RT-TITLE-HUD: https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7167379777

Problem

During a boot, a tester can't tell whether the game is slow because of frame time, because of memory pressure, or because pipelines are being compiled in the frame. The log has the numbers, but only every LEONIDA_MEM_PROBE seconds and scattered over hundreds of thousands of lines.

Change

With LEONIDA_TITLE_HUD=1, the title bar of the window the title presents in shows, updated twice a second:

Leonida | 2 fps 500.0 ms (worst 10532) | RAM 28.1 GB (ws 6.5) | VRAM 9.2/14.9 GB +0.9 shared | PSO 20g 926c, compiling 2.4 s | 4:39
  • Frames: fps and the average and worst frame time, counted from successful PresentX calls.
  • Memory: the process's private bytes and working set (GetProcessMemoryInfo).
  • GPU memory: local usage against its budget, plus non-local usage (IDXGIAdapter3::QueryVideoMemoryInfo). The adapter is the hardware one with the most dedicated memory, taken from the host's own dxgi.dll.
  • Pipelines: graphics and compute pipelines created, and the seconds spent in vkCreate*Pipelines in the last interval. Several compiler threads can push this above the interval. It needs LEONIDA_MEM_PROBE, which counts them; without it the field reads PSO -.
  • Uptime: the time since the first present.

The text is set from a thread of its own with SendMessageTimeout(SMTO_ABORTIFHUNG), so a busy or hung window thread never holds a present. runtime/shims/title_hud.h implements it, and it is wired into d3d12_xs_device.cpp's PresentX state. docs/boot.md documents the variable. It is off by default.

Tested (Windows 11 Pro 26300, RTX 5070 Ti, VS 2026 RelWithDebInfo)

  • CTest title_hud: a real window owned by the test's main thread gets the HUD text from the HUD thread. ~60 Hz presents give a plausible frame rate (35 fps under Sleep(16) here). A window that stops pumping does not hang the HUD's shutdown, and a HUD destroyed at once returns at once.
  • Real boot: the line above is from a 1.0.2.1 retail boot during the story load with LEONIDA_MEM_PROBE=10, while library compute pipelines were being compiled in the frame.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1922 **Author:** [@kawaii-shakal](https://github.com/kawaii-shakal) **Created:** 11/25/2026 **Status:** ✅ Merged **Merged:** 11/25/2026 **Merged by:** [@aslan2142](https://github.com/aslan2142) **Base:** `main` ← **Head:** `title-bar-hud` --- ### 📝 Commits (2) - [`e86b3ce`](https://github.com/ubiquitarianism/leonida/commit/e86b3ceaa8d9359df5baaee7e5246d219fb88dbb) d3d12_xs: LEONIDA_TITLE_HUD shows frame rate, memory and pipeline compiles in the window's title bar (RT-TITLE-HUD) - [`1c5e2dc`](https://github.com/ubiquitarianism/leonida/commit/1c5e2dcab1921e171b9bb507ce7aeba52ae136db) title HUD: with no frame in an interval, show how long since the last one ### 📊 Changes **5 files changed** (+280 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `docs/boot.md` (+12 -0) 📝 `runtime/CMakeLists.txt` (+10 -0) 📝 `runtime/shims/d3d12_xs_device.cpp` (+8 -4) ➕ `runtime/shims/title_hud.h` (+173 -0) ➕ `runtime/test/title_hud_test.cpp` (+77 -0) </details> ### 📄 Description Claimed in the coordination issue as RT-TITLE-HUD: https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7167379777 ### Problem During a boot, a tester can't tell whether the game is slow because of frame time, because of memory pressure, or because pipelines are being compiled in the frame. The log has the numbers, but only every `LEONIDA_MEM_PROBE` seconds and scattered over hundreds of thousands of lines. ### Change With `LEONIDA_TITLE_HUD=1`, the title bar of the window the title presents in shows, updated twice a second: ``` Leonida | 2 fps 500.0 ms (worst 10532) | RAM 28.1 GB (ws 6.5) | VRAM 9.2/14.9 GB +0.9 shared | PSO 20g 926c, compiling 2.4 s | 4:39 ``` - **Frames:** fps and the average and worst frame time, counted from successful PresentX calls. - **Memory:** the process's private bytes and working set (`GetProcessMemoryInfo`). - **GPU memory:** local usage against its budget, plus non-local usage (`IDXGIAdapter3::QueryVideoMemoryInfo`). The adapter is the hardware one with the most dedicated memory, taken from the host's own `dxgi.dll`. - **Pipelines:** graphics and compute pipelines created, and the seconds spent in `vkCreate*Pipelines` in the last interval. Several compiler threads can push this above the interval. It needs `LEONIDA_MEM_PROBE`, which counts them; without it the field reads `PSO -`. - **Uptime:** the time since the first present. The text is set from a thread of its own with `SendMessageTimeout(SMTO_ABORTIFHUNG)`, so a busy or hung window thread never holds a present. `runtime/shims/title_hud.h` implements it, and it is wired into `d3d12_xs_device.cpp`'s PresentX state. `docs/boot.md` documents the variable. It is off by default. ### Tested (Windows 11 Pro 26300, RTX 5070 Ti, VS 2026 RelWithDebInfo) - **CTest `title_hud`:** a real window owned by the test's main thread gets the HUD text from the HUD thread. ~60 Hz presents give a plausible frame rate (35 fps under `Sleep(16)` here). A window that stops pumping does not hang the HUD's shutdown, and a HUD destroyed at once returns at once. - **Real boot:** the line above is from a 1.0.2.1 retail boot during the story load with `LEONIDA_MEM_PROBE=10`, while library compute pipelines were being compiled in the frame. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 21:19:26 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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.

Dependencies

No dependencies set

Reference
starred/leonida#1930
No description provided.