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

Closed
x2Tweek wants to merge 3 commits from upstream-pr/1706 into main
x2Tweek commented 2026-11-25 08:49:52 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by x2Tweek on 2026-11-25T08:49:52Z.


Claimed in the coordination issue as: RT-VULKAN-COMPILE-STATUS (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7157517798).

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.

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5488089314 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1706). Originally posted by [x2Tweek](https://github.com/x2Tweek) on 2026-11-25T08:49:52Z. --- Claimed in the coordination issue as: RT-VULKAN-COMPILE-STATUS (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7157517798). ### 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.
kawaii-shakal commented 2026-11-25 09:45:35 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by kawaii-shakal on 2026-11-25T09:45:35Z.

Review: COMMENTED


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).

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6055210363 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1706#pullrequestreview-6055210363). Originally posted by [kawaii-shakal](https://github.com/kawaii-shakal) on 2026-11-25T09:45:35Z. **Review:** COMMENTED --- 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).
x2Tweek commented 2026-11-25 11:49:10 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by x2Tweek on 2026-11-25T11:49:10Z.


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7161539906 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1706#issuecomment-7161539906). Originally posted by [x2Tweek](https://github.com/x2Tweek) on 2026-11-25T11:49:10Z. --- 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 commented 2026-11-26 05:16:39 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by x2Tweek on 2026-11-26T05:16:39Z.


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)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7183341465 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1706#issuecomment-7183341465). Originally posted by [x2Tweek](https://github.com/x2Tweek) on 2026-11-26T05:16:39Z. --- 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)
MoonEyes commented 2026-11-28 18:02:46 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T18:02:46Z.


Hi @x2Tweek, thanks for this pull request. It currently conflicts with main (conflicting file(s): runtime/shims/d3d12_vulkan_device.cpp), so it carries the needs rebase label. CONTRIBUTING.md asks authors to rebase their branch on main; once it merges cleanly the label goes within the hour, and reviews start with the pull requests that do. Could you update the branch when you have a moment? If you no longer plan to continue with it, please say so here.

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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7243486288 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1706#issuecomment-7243486288). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-28T18:02:46Z. --- Hi @x2Tweek, thanks for this pull request. It currently conflicts with `main` (conflicting file(s): `runtime/shims/d3d12_vulkan_device.cpp`), so it carries the `needs rebase` label. CONTRIBUTING.md asks authors to rebase their branch on `main`; once it merges cleanly the label goes within the hour, and reviews start with the pull requests that do. Could you update the branch when you have a moment? If you no longer plan to continue with it, please say so here. AI-assisted (Claude Code, Claude Opus 5.5).
OreoFR commented 2026-11-29 06:14:36 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T06:14:36Z.


TAKEN by OreoFR (Windows, RTX 4070 8 GB): red/green on main + PR, ctest, gta6rt link

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7251735291 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1706#issuecomment-7251735291). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-29T06:14:36Z. --- TAKEN by OreoFR (Windows, RTX 4070 8 GB): red/green on main + PR, ctest, gta6rt link
x2Tweek commented 2026-11-29 06:43:42 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by x2Tweek on 2026-11-29T06:43:42Z.


Thanks for the review @kawaii-shakal. Both suggestions are addressed on the rebased branch:

  1. Name the oldest call — track(std::string_view label, Call) now accepts a label, and the heartbeat prints oldest X s: <label> (runtime/src/compile_status.h:90, 43-45, 17-22). The test verifies the oldest label is reported ("first", not "second").

  2. Test covers more than the formatter — runtime/test/compile_status_test.cpp uses a real CompileStatus with an injectable 5 ms period, nested track calls, and checks that the heartbeat reports 2 in flight with the oldest label identified, not just format_compile_status output.

The branch is rebased on current upstream/main and mergeable. CI: the translator suite and semantic tests pass locally; the one test_int32_to_f64 failure is the same pre-existing spirv-opt crash on main.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7252031885 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1706#issuecomment-7252031885). Originally posted by [x2Tweek](https://github.com/x2Tweek) on 2026-11-29T06:43:42Z. --- Thanks for the review @kawaii-shakal. Both suggestions are addressed on the rebased branch: 1. **Name the oldest call** — `track(std::string_view label, Call)` now accepts a label, and the heartbeat prints `oldest X s: <label>` (runtime/src/compile_status.h:90, 43-45, 17-22). The test verifies the oldest label is reported ("first", not "second"). 2. **Test covers more than the formatter** — `runtime/test/compile_status_test.cpp` uses a real `CompileStatus` with an injectable 5 ms period, nested `track` calls, and checks that the heartbeat reports 2 in flight with the oldest label identified, not just `format_compile_status` output. The branch is rebased on current upstream/main and mergeable. CI: the translator suite and semantic tests pass locally; the one `test_int32_to_f64` failure is the same pre-existing spirv-opt crash on main. AI-assisted (Claude Code).
OreoFR commented 2026-11-29 07:04:58 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T07:04:58Z.


Verified by OreoFR — FAILS (does not compile)

  • Base: main ef3299584 + this PR (head 42de952fd) merged with --no-ff (no conflict; the head is already based on ef3299584)
  • Red (main + only this PR's tests): no behavioural red. compile_status_test needs the new src/compile_status.h.
  • Green (merge): the runtime does not build. shims/d3d12_vulkan_device.cpp(11970) and (11987): error C2065: 'device_': undeclared identifier. build_compute_pipeline(DeviceState& device, ...) is a free function whose parameter is device, so the two device_.compile_status.track(...) calls there should be device.compile_status.track(...). The PR head alone gives the same error at the same lines, so it is not a merge artefact. As a result neither ctest nor the gta6rt link could run. Built alone, compile_status_test passes.
  • gta6rt.exe: not linked (gta6rt_d3d12_com does not compile; LEONIDA_CARGO=OFF, LEONIDA_XMA2_DECODER_LIB empty)
  • Diff read: apart from the compile error, the reporter is sound. reporter_ is the last member, so it stops and joins before the map and mutex go away. track costs nothing when the switch is off, and the graphics label lookup only runs when the switch or the profile is on.
  • Other runs: none before this one (kawaii-shakal's review was read-only).
  • Machine: Windows 11, Intel Core Ultra 7 155H, RTX 4070 Laptop 8 GB, NVIDIA 621.40, Python 3.12.10, MSVC 19.44

AI-assisted (Claude Code, Claude Opus 5.5), run for OreoFR.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7252248962 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1706#issuecomment-7252248962). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-29T07:04:58Z. --- **Verified by OreoFR** — FAILS (does not compile) - Base: main ef3299584 + this PR (head 42de952fd) merged with --no-ff (no conflict; the head is already based on ef3299584) - Red (main + only this PR's tests): no behavioural red. `compile_status_test` needs the new `src/compile_status.h`. - Green (merge): the runtime does not build. `shims/d3d12_vulkan_device.cpp(11970)` and `(11987)`: `error C2065: 'device_': undeclared identifier`. `build_compute_pipeline(DeviceState& device, ...)` is a free function whose parameter is `device`, so the two `device_.compile_status.track(...)` calls there should be `device.compile_status.track(...)`. The PR head alone gives the same error at the same lines, so it is not a merge artefact. As a result neither ctest nor the gta6rt link could run. Built alone, `compile_status_test` passes. - gta6rt.exe: not linked (gta6rt_d3d12_com does not compile; `LEONIDA_CARGO=OFF`, `LEONIDA_XMA2_DECODER_LIB` empty) - Diff read: apart from the compile error, the reporter is sound. `reporter_` is the last member, so it stops and joins before the map and mutex go away. `track` costs nothing when the switch is off, and the graphics label lookup only runs when the switch or the profile is on. - Other runs: none before this one (kawaii-shakal's review was read-only). - Machine: Windows 11, Intel Core Ultra 7 155H, RTX 4070 Laptop 8 GB, NVIDIA 621.40, Python 3.12.10, MSVC 19.44 AI-assisted (Claude Code, Claude Opus 5.5), run for OreoFR.
x2Tweek commented 2026-11-29 07:49:10 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by x2Tweek on 2026-11-29T07:49:10Z.


Fixed the compile bug OreoFR reported: device_.compile_status.track(...) in build_compute_pipeline() should be device.compile_status.track(...) since the function parameter is device, not device_. This caused error C2065: 'device_' undeclared identifier at runtime/shims/d3d12_vulkan_device.cpp:11970 and :11987, preventing the runtime from building.

Push: x2tweek/compile-status head is now 6e31f2812 (on top of 42de952fd).

Co-Authored-By: Claude Code [email protected]

🤖 Generated with Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7252710912 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1706#issuecomment-7252710912). Originally posted by [x2Tweek](https://github.com/x2Tweek) on 2026-11-29T07:49:10Z. --- Fixed the compile bug OreoFR reported: `device_.compile_status.track(...)` in `build_compute_pipeline()` should be `device.compile_status.track(...)` since the function parameter is `device`, not `device_`. This caused `error C2065: 'device_' undeclared identifier` at `runtime/shims/d3d12_vulkan_device.cpp:11970` and `:11987`, preventing the runtime from building. Push: `x2tweek/compile-status` head is now `6e31f2812` (on top of `42de952fd`). Co-Authored-By: Claude Code <[email protected]> 🤖 Generated with [Claude Code](https://claude.com/claude-code)

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!1706
No description provided.