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

Open
github-bot wants to merge 1 commit from github-bot/gh-138 into main AGit
Owner

@⁠Andretuta on GitHub · 2026-11-24 02:26 UTC · original
ubiquitarianism:old-pr/9869 → main · +251 −6 · 6 files · 1 commits · draft

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

**@⁠Andretuta** on GitHub · 2026-11-24 02:26 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/138) `ubiquitarianism:old-pr/9869` → `main` · +251 −6 · 6 files · 1 commits · draft > 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)
present_result printed "[rt] d3d12: present failed (VkResult <number>)" for every failed present. A presenter
that fails every frame then writes one line per frame for as long as the title runs, and the line gives only
the number.

The result is now named ("VK_ERROR_OUT_OF_DATE_KHR, VkResult -1000001004"), and a run of the same result in a
row is reported 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, so no kind of failure is hidden.

src/present_failure_log.h has no Vulkan or Windows header; the device file checks its numbers against the real
VkResult values with a static_assert. present_failure_log_test covers the names, single failures, a run of
180,031, a run ending on a reported count, and alternating results. d3d12_present_test's announcement and
docs/d3d12_vulkan.md follow the new wording.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:46:03 +00:00
Author
Owner

@⁠Snooozs on GitHub · 2026-11-24 18:01 UTC · original

Independent check: present_failure_log passes (target rebuilt). I did not run d3d12_present, which opens a window on a PC in use. From reading: the failure still decides the HRESULT exactly as before, the mutex covers only note(), and the counters restart on any different result. One gap: VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT (-1000255000) is in the name table but not in the static_assert that keeps the two in step.

Windows 10 Pro 22H2 (19045), VS 2022 RelWithDebInfo, merged onto main 3aa975421 without conflicts, targets rebuilt, CPU only, no game files. AI-assisted (Claude Code): I read the whole diff and ran this on that machine.

**@⁠Snooozs** on GitHub · 2026-11-24 18:01 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/138#issuecomment-7140037966) Independent check: `present_failure_log` passes (target rebuilt). I did not run `d3d12_present`, which opens a window on a PC in use. From reading: the failure still decides the HRESULT exactly as before, the mutex covers only `note()`, and the counters restart on any different result. One gap: `VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT` (-1000255000) is in the name table but not in the `static_assert` that keeps the two in step. Windows 10 Pro 22H2 (19045), VS 2022 RelWithDebInfo, merged onto `main` 3aa975421 without conflicts, targets rebuilt, CPU only, no game files. AI-assisted (Claude Code): I read the whole diff and ran this on that machine.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

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

Merge

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