[PR #138] d3d12: a failed present is named, and a run of the same failure is logged at its 1st, 10th, 100th, ... #190

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

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/138
Author: @Andretuta
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: old-pr/9869


📝 Commits (1)

  • 360abb2 d3d12: a failed present is named and a run of the same failure is logged at its 1st, 10th, 100th, ...

📊 Changes

6 files changed (+251 additions, -6 deletions)

View changed files

📝 docs/d3d12_vulkan.md (+6 -3)
📝 runtime/CMakeLists.txt (+7 -0)
📝 runtime/shims/d3d12_vulkan_device.cpp (+25 -1)
➕ runtime/src/present_failure_log.h (+92 -0)
📝 runtime/test/d3d12_present_test.cpp (+2 -2)
➕ runtime/test/present_failure_log_test.cpp (+119 -0)

📄 Description

Carried over from old PR 9869 by Amitoxx in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/9869, exactly that PR's last commit. All carried-over PRs are listed in #17.
Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it.
Amitoxx: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one.


Original description (mentions and #N references are disabled; the numbers refer to the old repository):

Claim: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7116754041

What and why

present_result printed [rt] d3d12: present failed (VkResult <number>) for every failed present. A presenter that fails every frame writes one line per frame for as long as the title runs. Measured on a retail run (AMD RX 6750 XT, Windows 11, driver 32.0.21045.16010, an integration stack): every present returned VK_ERROR_OUT_OF_DATE_KHR and the log got 180,031 identical lines in 15 minutes.

The result is now named, and a run of the same result in a row is logged at its 1st, 10th, 100th, ... failure, with a closing line giving the whole length when the run ends. A different result always starts a new run and gets its own line.

Changes

  • runtime/src/present_failure_log.h (new): names and the run counter; no Vulkan or Windows header.
  • runtime/shims/d3d12_vulkan_device.cpp: present_result uses it; a static_assert checks the numbers against the real VkResult values.
  • runtime/test/present_failure_log_test.cpp (new) and its CMake entry.
  • runtime/test/d3d12_present_test.cpp, docs/d3d12_vulkan.md: the wording of the announced lines.

Tested

Windows 11, VS 2022 17.9 (MSVC 14.39.33519), Ninja RelWithDebInfo, AMD RX 6750 XT (driver 32.0.21045.16010):

  • present_failure_log, d3d12_present, xbox_present, dxgi_swapchain: 4/4 pass, all four rebuilt with the change.
  • d3d12_present_test prints the three injected failures in the new form.
  • python -I scripts/check_no_game_data.py on the six files: clean.

Not covered: these ran on dde82f27e plus this commit (cherry-picked without conflict), because main at 2d53a8055 did not compile here: acphal.cpp static_asserts on the SHAPE context sizes, and create_console_descriptor_heap in d3d12_xs_device.cpp and d3d12_vulkan_device.cpp. The same lines are still in 73ddc61cd, which this branch is rebased on. The MSVC 14.39 fix of #7146 was applied locally to build and is not part of this PR. No Wine, no NVIDIA or Intel run.

No game files. AI-assisted (Claude Code).

🤖 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/138 **Author:** [@Andretuta](https://github.com/Andretuta) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `old-pr/9869` --- ### 📝 Commits (1) - [`360abb2`](https://github.com/ubiquitarianism/leonida/commit/360abb21f3451e6ccc134ae198a8fc78f40c52a1) d3d12: a failed present is named and a run of the same failure is logged at its 1st, 10th, 100th, ... ### 📊 Changes **6 files changed** (+251 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `docs/d3d12_vulkan.md` (+6 -3) 📝 `runtime/CMakeLists.txt` (+7 -0) 📝 `runtime/shims/d3d12_vulkan_device.cpp` (+25 -1) ➕ `runtime/src/present_failure_log.h` (+92 -0) 📝 `runtime/test/d3d12_present_test.cpp` (+2 -2) ➕ `runtime/test/present_failure_log_test.cpp` (+119 -0) </details> ### 📄 Description > Carried over from **old PR 9869** by `Amitoxx` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/9869`, exactly that PR's last commit. All carried-over PRs are listed in #17. > Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it. > `Amitoxx`: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one. --- Original description (mentions and `#N` references are disabled; the numbers refer to the old repository): Claim: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7116754041 ## What and why `present_result` printed `[rt] d3d12: present failed (VkResult <number>)` for every failed present. A presenter that fails every frame writes one line per frame for as long as the title runs. Measured on a retail run (AMD RX 6750 XT, Windows 11, driver 32.0.21045.16010, an integration stack): every present returned VK_ERROR_OUT_OF_DATE_KHR and the log got 180,031 identical lines in 15 minutes. The result is now named, and a run of the same result in a row is logged at its 1st, 10th, 100th, ... failure, with a closing line giving the whole length when the run ends. A different result always starts a new run and gets its own line. ## Changes - `runtime/src/present_failure_log.h` (new): names and the run counter; no Vulkan or Windows header. - `runtime/shims/d3d12_vulkan_device.cpp`: `present_result` uses it; a static_assert checks the numbers against the real VkResult values. - `runtime/test/present_failure_log_test.cpp` (new) and its CMake entry. - `runtime/test/d3d12_present_test.cpp`, `docs/d3d12_vulkan.md`: the wording of the announced lines. ## Tested Windows 11, VS 2022 17.9 (MSVC 14.39.33519), Ninja RelWithDebInfo, AMD RX 6750 XT (driver 32.0.21045.16010): - `present_failure_log`, `d3d12_present`, `xbox_present`, `dxgi_swapchain`: 4/4 pass, all four rebuilt with the change. - `d3d12_present_test` prints the three injected failures in the new form. - `python -I scripts/check_no_game_data.py` on the six files: clean. Not covered: these ran on `dde82f27e` plus this commit (cherry-picked without conflict), because `main` at `2d53a8055` did not compile here: `acphal.cpp` static_asserts on the SHAPE context sizes, and `create_console_descriptor_heap` in `d3d12_xs_device.cpp` and `d3d12_vulkan_device.cpp`. The same lines are still in `73ddc61cd`, which this branch is rebased on. The MSVC 14.39 fix of `#7146` was applied locally to build and is not part of this PR. No Wine, no NVIDIA or Intel run. No game files. AI-assisted (Claude Code). 🤖 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#190
No description provided.