[PR #2259] xbox_present_test: a resize round whose present was out of date has no readback (TEST-XBOX-PRESENT-RESIZE-OUT-OF-DATE) #2261

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

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/2259
Author: @CodingRule
Created: 11/26/2026
Status: 🔄 Open

Base: main ← Head: test-xbox-present-resize-out-of-date


📝 Commits (1)

  • 01bf5f1 xbox_present_test: a resize round whose present was out of date has no readback (TEST-XBOX-PRESENT-RESIZE-OUT-OF-DATE)

📊 Changes

1 file changed (+15 additions, -3 deletions)

View changed files

📝 runtime/test/xbox_present_test.cpp (+15 -3)

📄 Description

Claimed in the coordination issue as: TEST-XBOX-PRESENT-RESIZE-OUT-OF-DATE (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7190029861)

What and why

xbox_present is red on main on NVIDIA under Windows: line 1226: present_planes(&one, 1), in the resize loop of runtime/test/xbox_present_test.cpp (section F, 320x240 -> 400x300 -> 200x150 -> 320x240).

What happens there, measured with a temporary print in the test's helper:

  • After SetWindowPos, the first composed present is acquired on the old swapchain and vkQueuePresentKHR returns VK_ERROR_OUT_OF_DATE_KHR. PresentX returns S_OK (its work was submitted) and the frame is not counted as shown, as vulkan_present.h documents.
  • Since 9f98dcc61 the presenter sets captured_ = false before every present ("never expose a stale sample after an unsampled or unshown frame", runtime/src/vulkan_present.h:555), and only a shown frame sets it again. So read_back returns false for that frame: read_back=0 bytes=307200 extent=320x240 want=0x0.
  • The test still said "the frame is still composed and read back" and required the readback in every round.

The presenter's rule is deliberate, so this changes the test, not the runtime: a round whose present was not shown is skipped, and it must not hand out a frame either. Only the first two rounds of a size may go unshown (the next present recreates the swapchain); the last round must be shown and have the new size, which is what the loop checked before.

One file, test only.

Tested

On main a73a57e13, built with scripts\build_runtime.ps1 (MSVC 14.44.35207, RelWithDebInfo):

ctest -R "^xbox_present$"
before failed 3 of 3, line 1226: present_planes(&one, 1)
after passed 5 of 5, xbox_present_test: all cases pass, the resize line prints ok

Full ctest on the same build before the change: 475 of 477 passed; the other failure is d3d12_set_descriptor_heaps (line 353), which #2153 covers. I have not run this on AMD or Intel, where the present after a resize may be reported suboptimal instead; that path is the unchanged one (the frame is shown and read back).

GPUs tested: NVIDIA GeForce RTX 4090, driver 591.86, Vulkan 1.4.325, Windows 11 Pro build 26200

AI-assisted: yes (Claude Code found the failure, wrote the change and ran the tests)

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator change)

🤖 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/2259 **Author:** [@CodingRule](https://github.com/CodingRule) **Created:** 11/26/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `test-xbox-present-resize-out-of-date` --- ### 📝 Commits (1) - [`01bf5f1`](https://github.com/ubiquitarianism/leonida/commit/01bf5f16cc6a5c55bb6afe6ba550828f80daf347) xbox_present_test: a resize round whose present was out of date has no readback (TEST-XBOX-PRESENT-RESIZE-OUT-OF-DATE) ### 📊 Changes **1 file changed** (+15 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `runtime/test/xbox_present_test.cpp` (+15 -3) </details> ### 📄 Description Claimed in the coordination issue as: TEST-XBOX-PRESENT-RESIZE-OUT-OF-DATE (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7190029861) ### What and why `xbox_present` is red on `main` on NVIDIA under Windows: `line 1226: present_planes(&one, 1)`, in the resize loop of `runtime/test/xbox_present_test.cpp` (section F, 320x240 -> 400x300 -> 200x150 -> 320x240). What happens there, measured with a temporary print in the test's helper: - After `SetWindowPos`, the first composed present is acquired on the old swapchain and `vkQueuePresentKHR` returns `VK_ERROR_OUT_OF_DATE_KHR`. `PresentX` returns `S_OK` (its work was submitted) and the frame is not counted as shown, as `vulkan_present.h` documents. - Since `9f98dcc61` the presenter sets `captured_ = false` before every present ("never expose a stale sample after an unsampled or unshown frame", `runtime/src/vulkan_present.h:555`), and only a shown frame sets it again. So `read_back` returns false for that frame: `read_back=0 bytes=307200 extent=320x240 want=0x0`. - The test still said "the frame is still composed and read back" and required the readback in every round. The presenter's rule is deliberate, so this changes the test, not the runtime: a round whose present was not shown is skipped, and it must not hand out a frame either. Only the first two rounds of a size may go unshown (the next present recreates the swapchain); the last round must be shown and have the new size, which is what the loop checked before. One file, test only. ### Tested On `main` `a73a57e13`, built with `scripts\build_runtime.ps1` (MSVC 14.44.35207, RelWithDebInfo): | | `ctest -R "^xbox_present$"` | |---|---| | before | failed 3 of 3, `line 1226: present_planes(&one, 1)` | | after | passed 5 of 5, `xbox_present_test: all cases pass`, the resize line prints `ok` | Full `ctest` on the same build before the change: 475 of 477 passed; the other failure is `d3d12_set_descriptor_heaps` (line 353), which #2153 covers. I have not run this on AMD or Intel, where the present after a resize may be reported suboptimal instead; that path is the unchanged one (the frame is shown and read back). GPUs tested: NVIDIA GeForce RTX 4090, driver 591.86, Vulkan 1.4.325, Windows 11 Pro build 26200 AI-assisted: yes (Claude Code found the failure, wrote the change and ran the tests) ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator change) 🤖 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#2261
No description provided.