[PR #2116] d3d12_xs: a stall snapshot of what list writes, gates and held work w… #2123

Open
opened 2026-11-26 21:20:07 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/2116
Author: @tiguan26
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: rt-list-values-stall-snapshot


📝 Commits (3)

  • bdb84f6 d3d12_xs: a stall snapshot of what list writes, gates and held work wait for (RT-LIST-VALUES-STALL-SNAPSHOT)
  • 1b7a4e9 Merge remote-tracking branch 'upstream/main' into rt-list-values-stall-snapshot
  • 2b06d7a d3d12_xs: the 10 s list-value line says what recorded and submitted count

📊 Changes

10 files changed (+541 additions, -11 deletions)

View changed files

📝 docs/d3d12_xs_console_abi.md (+9 -0)
📝 runtime/CMakeLists.txt (+8 -0)
📝 runtime/shims/d3d12_xs_device.cpp (+5 -1)
📝 runtime/shims/d3d12_xs_device.h (+5 -1)
📝 runtime/shims/d3d12_xs_list_values.h (+138 -6)
➕ runtime/src/held_work_report.h (+53 -0)
📝 runtime/src/queue_holds.h (+57 -0)
📝 runtime/src/vulkan_backend.h (+108 -2)
➕ runtime/test/queue_holds_report_test.cpp (+122 -0)
📝 runtime/test/xs_proxy_mock_test.cpp (+36 -1)

📄 Description

Claim: RT-LIST-VALUES-STALL-SNAPSHOT (#1608). AI-assisted (Claude).

What and why

The boot now stalls after the story load. @OreoFR (#1723, Windows, RTX 4070 Laptop) and @Snooozs (#1608, Windows 10, RTX 5060 Ti, six runs) both report the list-value counters freezing for minutes with a fixed number of writes "recorded" but not landed (107 and 113), nothing submitted, the pump and releaser idle, and the title polling fence mirrors that never move. Today's log can't say what the stall is waiting for. This adds a one-time snapshot that says, and changes nothing else.

  • Stall snapshot (d3d12_xs_list_values.h). When the 10 s summary has not changed three times in a row while recorded writes have not all landed, the pump logs once, and again only after the counters move:

    • each submitted write group still waiting: the written fence value it needs, and how far the fence got;
    • each closed gate: address, comparison, reference, what memory holds now, and how long its time has run;
    • from the Vulkan layer, the CPU waits on fences that are not satisfied (SetEventOnCompletion and the layer's callbacks), per fence: the lowest value waited for, the counter now, and the highest Signal submitted;
    • for each queue that holds work (QueueHolds), what its oldest held operation waits for, with the same three numbers.

    A wait with no Signal of that value submitted names the fence the stall is stuck on.

  • writes_submitted counter. writes_recorded is counted once per recording (record_value_op), so "recorded minus landed" also counts writes in lists the title recorded and never executed. The new counter is bumped when a list's writes go to the queue, and is printed in the summary line (N writes recorded, N submitted, N landed). If submitted equals landed in a stalled run, the 113 are unexecuted lists and not writes in flight.

  • Pump wake. With nothing in flight the pump waited INFINITE, so a title that stopped submitting got no summary at all. It now looks every 10 s.

  • Plumbing. src/held_work_report.h is a small registry. Each QueueHolds registers itself, and VulkanContext adds its CPU-wait lines through QueueHolds::set_describe_extra. Holder::describe_held is virtual with an empty default, so other holders are unaffected. Locks are only tried (1 s for a running release, 0.5 s per queue's state lock) and the report says so when one doesn't come free: a report must not hang on the thing that is stuck. held_at is now set on every held operation (it was only set under LEONIDA_GPU_LATENCY).

Documented in docs/d3d12_xs_console_abi.md §5.5.

Tested

No GPU work and no game files. Built on Linux as the Windows runtime (clang-cl 19, lld-link, xwin SDK 10.0.26100, full build including gta6rt) and run under Wine 11.22 with llvmpipe:

  • xs_proxy_mock_test: PASS. New step 9: a write group whose queue has not reached its written value and a closed 64-bit gate; the snapshot names written fence 6, completed 5 (the queue has not run that far) and the gate's address, comparison, reference and memory. Step 1 also checks writes_submitted.
  • New portable queue_holds_report_test: held operations named with fence, value and highest Signal submitted; extra lines first and removable; two instances; nothing reported after destruction. Passes under Wine, and natively with clang 19 under ThreadSanitizer and AddressSanitizer/UBSan.
  • ctest -R "fence|queue|xs_proxy|present|holds|replay_texture|list_value": 47/47 passed, including d3d12_fence_timing (held CPU signals) and vk_presenter_sync. Two skipped, as on main (they need a second queue family).
  • scripts/check_no_game_data.py on the changed files: clean.

@Snooozs offered to run this in the stalled state. The snapshot comes out on its own about 30 s after the counters stop.

🤖 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/2116 **Author:** [@tiguan26](https://github.com/tiguan26) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `rt-list-values-stall-snapshot` --- ### 📝 Commits (3) - [`bdb84f6`](https://github.com/ubiquitarianism/leonida/commit/bdb84f639dca40b4df7482f7eb16fd6e4032cd76) d3d12_xs: a stall snapshot of what list writes, gates and held work wait for (RT-LIST-VALUES-STALL-SNAPSHOT) - [`1b7a4e9`](https://github.com/ubiquitarianism/leonida/commit/1b7a4e94901c9c9093608c60b44b4c9feb47e2ac) Merge remote-tracking branch 'upstream/main' into rt-list-values-stall-snapshot - [`2b06d7a`](https://github.com/ubiquitarianism/leonida/commit/2b06d7a0f0cfd7e8c1b58559e6931c2e0e3a7de6) d3d12_xs: the 10 s list-value line says what recorded and submitted count ### 📊 Changes **10 files changed** (+541 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `docs/d3d12_xs_console_abi.md` (+9 -0) 📝 `runtime/CMakeLists.txt` (+8 -0) 📝 `runtime/shims/d3d12_xs_device.cpp` (+5 -1) 📝 `runtime/shims/d3d12_xs_device.h` (+5 -1) 📝 `runtime/shims/d3d12_xs_list_values.h` (+138 -6) ➕ `runtime/src/held_work_report.h` (+53 -0) 📝 `runtime/src/queue_holds.h` (+57 -0) 📝 `runtime/src/vulkan_backend.h` (+108 -2) ➕ `runtime/test/queue_holds_report_test.cpp` (+122 -0) 📝 `runtime/test/xs_proxy_mock_test.cpp` (+36 -1) </details> ### 📄 Description Claim: RT-LIST-VALUES-STALL-SNAPSHOT (#1608). AI-assisted (Claude). ## What and why The boot now stalls after the story load. @OreoFR (#1723, Windows, RTX 4070 Laptop) and @Snooozs (#1608, Windows 10, RTX 5060 Ti, six runs) both report the list-value counters freezing for minutes with a fixed number of writes "recorded" but not landed (107 and 113), nothing submitted, the pump and releaser idle, and the title polling fence mirrors that never move. Today's log can't say what the stall is waiting for. This adds a one-time snapshot that says, and changes nothing else. - **Stall snapshot** (`d3d12_xs_list_values.h`). When the 10 s summary has not changed three times in a row while recorded writes have not all landed, the pump logs once, and again only after the counters move: - each submitted write group still waiting: the `written` fence value it needs, and how far the fence got; - each closed gate: address, comparison, reference, what memory holds now, and how long its time has run; - from the Vulkan layer, the **CPU waits on fences that are not satisfied** (SetEventOnCompletion and the layer's callbacks), per fence: the lowest value waited for, the counter now, and the highest Signal submitted; - for each queue that **holds work** (QueueHolds), what its oldest held operation waits for, with the same three numbers. A wait with no Signal of that value submitted names the fence the stall is stuck on. - **`writes_submitted` counter.** `writes_recorded` is counted once per *recording* (`record_value_op`), so "recorded minus landed" also counts writes in lists the title recorded and never executed. The new counter is bumped when a list's writes go to the queue, and is printed in the summary line (`N writes recorded, N submitted, N landed`). If submitted equals landed in a stalled run, the 113 are unexecuted lists and not writes in flight. - **Pump wake.** With nothing in flight the pump waited `INFINITE`, so a title that stopped submitting got no summary at all. It now looks every 10 s. - **Plumbing.** `src/held_work_report.h` is a small registry. Each `QueueHolds` registers itself, and `VulkanContext` adds its CPU-wait lines through `QueueHolds::set_describe_extra`. `Holder::describe_held` is virtual with an empty default, so other holders are unaffected. Locks are only tried (1 s for a running release, 0.5 s per queue's state lock) and the report says so when one doesn't come free: a report must not hang on the thing that is stuck. `held_at` is now set on every held operation (it was only set under `LEONIDA_GPU_LATENCY`). Documented in `docs/d3d12_xs_console_abi.md` §5.5. ## Tested No GPU work and no game files. Built on Linux as the Windows runtime (clang-cl 19, lld-link, xwin SDK 10.0.26100, full build including `gta6rt`) and run under Wine 11.22 with llvmpipe: - `xs_proxy_mock_test`: PASS. New step 9: a write group whose queue has not reached its `written` value and a closed 64-bit gate; the snapshot names `written fence 6, completed 5 (the queue has not run that far)` and the gate's address, comparison, reference and memory. Step 1 also checks `writes_submitted`. - New portable `queue_holds_report_test`: held operations named with fence, value and highest Signal submitted; extra lines first and removable; two instances; nothing reported after destruction. Passes under Wine, and natively with clang 19 under ThreadSanitizer and AddressSanitizer/UBSan. - `ctest -R "fence|queue|xs_proxy|present|holds|replay_texture|list_value"`: 47/47 passed, including `d3d12_fence_timing` (held CPU signals) and `vk_presenter_sync`. Two skipped, as on main (they need a second queue family). - `scripts/check_no_game_data.py` on the changed files: clean. @Snooozs offered to run this in the stalled state. The snapshot comes out on its own about 30 s after the counters stop. 🤖 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>
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#2123
No description provided.