runtime: report in-flight Vulkan pipeline builds on request (RT-VULKAN-COMPILE-STATUS) #1706

Open
github-bot wants to merge 2 commits from github-bot/gh-1706 into main AGit
Owner

@⁠x2Tweek on GitHub · 2026-11-25 08:49 UTC · original
x2Tweek:compile-status → main · +153 −4 · 5 files · 2 commits · open

Claimed in the coordination issue as: RT-VULKAN-COMPILE-STATUS (#1608).

What and why

Set LEONIDA_COMPILE_STATUS=1 to report active graphics and compute PSO driver calls to stderr every ten seconds while work is in flight. Each heartbeat shows the active count, oldest call age and number of finished calls for that device. The total is not known in advance because the title requests pipelines at runtime.

Tested

  • Windows MSVC RelWithDebInfo runtime build passed. CTest registered 405 tests: 391 passed, 11 skipped, two disabled and one failed.
  • The new formatting test passed. A synthetic call blocked for 11 seconds emitted the expected heartbeat with the option enabled and emitted no heartbeat with it disabled.
  • The sole CTest failure, d3d12_geometry_views, returned VK_ERROR_DEVICE_LOST. A separate build of the same test on the base commit 3f81d46ac reproduced the same error on the same machine.
  • Five CTest registration tests, the game-data check and git diff --check passed. All verification used synthetic fixtures.

GPUs tested: NVIDIA GeForce RTX 5090, Windows driver 32.0.16.2124, Windows 11 build 26300.

AI-assisted: yes.

**@⁠x2Tweek** on GitHub · 2026-11-25 08:49 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1706) `x2Tweek:compile-status` → `main` · +153 −4 · 5 files · 2 commits · open Claimed in the coordination issue as: RT-VULKAN-COMPILE-STATUS (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608). ### What and why Set LEONIDA_COMPILE_STATUS=1 to report active graphics and compute PSO driver calls to stderr every ten seconds while work is in flight. Each heartbeat shows the active count, oldest call age and number of finished calls for that device. The total is not known in advance because the title requests pipelines at runtime. ### Tested - Windows MSVC RelWithDebInfo runtime build passed. CTest registered 405 tests: 391 passed, 11 skipped, two disabled and one failed. - The new formatting test passed. A synthetic call blocked for 11 seconds emitted the expected heartbeat with the option enabled and emitted no heartbeat with it disabled. - The sole CTest failure, d3d12_geometry_views, returned VK_ERROR_DEVICE_LOST. A separate build of the same test on the base commit 3f81d46ac reproduced the same error on the same machine. - Five CTest registration tests, the game-data check and git diff --check passed. All verification used synthetic fixtures. GPUs tested: NVIDIA GeForce RTX 5090, Windows driver 32.0.16.2124, Windows 11 build 26300. AI-assisted: yes.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:01:44 +00:00
Author
Owner

@⁠kawaii-shakal on GitHub · 2026-11-25 09:45 UTC · original · reviewed

Review (read-only, not run). Small and safe: off by default, the reporter thread stops before the mutex is destroyed (member order), and track costs nothing when disabled. Two suggestions to make it answer the question it was built for (#1608's watchdog finding: which inline compile is the title waiting on):

  1. Name the oldest call. "3 in flight (oldest 130 s)" tells that something is stuck, not what. PipelineState knows the program name (stage.entry->name) at both call sites; passing a std::string_view label into track and printing the oldest one's label would make the heartbeat directly actionable.
  2. The test covers only the formatter. A test that runs track around a call blocked for just over one period (with the period injectable, so it doesn't take 10 s) and checks the count and age would cover the part that can break.

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

**@⁠kawaii-shakal** on GitHub · 2026-11-25 09:45 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1706#pullrequestreview-6055210363) · **reviewed** Review (read-only, not run). Small and safe: off by default, the reporter thread stops before the mutex is destroyed (member order), and `track` costs nothing when disabled. Two suggestions to make it answer the question it was built for (#1608's watchdog finding: which inline compile is the title waiting on): 1. **Name the oldest call.** "3 in flight (oldest 130 s)" tells that something is stuck, not what. `PipelineState` knows the program name (`stage.entry->name`) at both call sites; passing a `std::string_view` label into `track` and printing the oldest one's label would make the heartbeat directly actionable. 2. **The test covers only the formatter.** A test that runs `track` around a call blocked for just over one period (with the period injectable, so it doesn't take 10 s) and checks the count and age would cover the part that can break. AI-assisted review (Claude Code, Claude Opus 5.5).
Author
Owner

@⁠x2Tweek on GitHub · 2026-11-25 11:49 UTC · original

The heartbeat now names the oldest in-flight shader. It uses the compute program name for compute pipelines and the vertex or mesh program name for graphics pipelines. The live reporter test keeps two synthetic calls active across a short reporting interval and checks that the heartbeat names the earlier call and includes the completed-call count. The Windows runtime target built with MSVC and the reporter passed 30 consecutive CTest runs. AI-assisted: yes.

**@⁠x2Tweek** on GitHub · 2026-11-25 11:49 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1706#issuecomment-7161539906) The heartbeat now names the oldest in-flight shader. It uses the compute program name for compute pipelines and the vertex or mesh program name for graphics pipelines. The live reporter test keeps two synthetic calls active across a short reporting interval and checks that the heartbeat names the earlier call and includes the completed-call count. The Windows runtime target built with MSVC and the reporter passed 30 consecutive CTest runs. AI-assisted: yes.
Author
Owner

@⁠x2Tweek on GitHub · 2026-11-26 05:16 UTC · original

Thanks for the review @⁠kawaii-shakal. Both suggestions addressed:

  1. Name the oldest call — track() now takes a std::string_view label, and the heartbeat prints the oldest in-flight call's label: 3 in flight (oldest 130 s: cs_shadow_fill), 312 finished. Applied to both compute (build_compute) and graphics (create_graphics) pipeline builds.

  2. Blocked-call test — runtime/test/compile_status_test.cpp now runs nested track calls with a 5 ms reporting period and asserts the heartbeat identifies the oldest of two concurrent calls, plus a formatter check.

Rebased on current upstream/main (a73a57e13) and force-pushed to x2Tweek/leonida-continued:compile-status. CI should re-run on the new head.

AI-assisted: yes (Claude Code)

**@⁠x2Tweek** on GitHub · 2026-11-26 05:16 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1706#issuecomment-7183341465) Thanks for the review @⁠kawaii-shakal. Both suggestions addressed: 1. **Name the oldest call** — `track()` now takes a `std::string_view label`, and the heartbeat prints the oldest in-flight call's label: `3 in flight (oldest 130 s: cs_shadow_fill), 312 finished`. Applied to both compute (`build_compute`) and graphics (`create_graphics`) pipeline builds. 2. **Blocked-call test** — `runtime/test/compile_status_test.cpp` now runs nested `track` calls with a 5 ms reporting period and asserts the heartbeat identifies the oldest of two concurrent calls, plus a formatter check. Rebased on current upstream/main (`a73a57e13`) and force-pushed to `x2Tweek/leonida-continued:compile-status`. CI should re-run on the new head. AI-assisted: yes (Claude Code)
This pull request has changes conflicting with the target branch.
  • runtime/shims/d3d12_vulkan_device.cpp
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

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