[PR #2146] present: LEONIDA_PRESENT_DUMP_SLOW_MS also dumps every present that comes late (RT-PRESENT-DUMP-SLOW) #2151

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

📋 Pull Request Information

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

Base: main ← Head: rt-present-dump-slow


📝 Commits (1)

  • b633039 present: LEONIDA_PRESENT_DUMP_SLOW_MS also dumps every present that comes late (RT-PRESENT-DUMP-SLOW)

📊 Changes

4 files changed (+69 additions, -5 deletions)

View changed files

📝 runtime/CMakeLists.txt (+3 -1)
📝 runtime/README.md (+1 -0)
📝 runtime/src/present_dump.h (+49 -2)
📝 runtime/test/vk_present_dump_test.cpp (+16 -2)

📄 Description

RT-PRESENT-DUMP-SLOW, claimed in #1608 as RT-PRESENT-DUMP-FROM. The claim named a first frame number; measuring showed that number is not stable (below), so the option is keyed on the gap between presents instead and renamed to say so.

What

LEONIDA_PRESENT_DUMP_SLOW_MS=<ms>: with LEONIDA_PRESENT_DUMP=DIR[,N], a present that comes at least <ms> after the one before it is dumped too, whatever N is.

  • present_dump::parse_slow_gap reads the value: milliseconds over 0; unset or empty is off; anything else is refused with one log line and the dump goes on as before.
  • PresentDump::due(index) measures the gap the first time a present asks and gives both of that present's questions (copy the swapchain image in finish_image, save it after the present) the same answer, so a frame is never copied without being saved or saved without being copied.
  • runtime/README.md has the new row under LEONIDA_PRESENT_DUMP.

Why

At a world start the loading screens are thousands of presents a few milliseconds apart, and the frames after them come seconds apart. DIR,N then either misses the slow frames (large N: of the first 8 world frames of one run, N=50 kept 1) or writes thousands of loading frames first (small N: 713 PNGs, about 10 GB at 2544x1401, before the first world frame of another run). A fixed first frame does not work either: on the same machine and title the world started at present 1,930 in one run and at 2,634 in the next, because the loading screens present faster when a submission costs less. The gap separates the two kinds of frame in every run.

Tested

  • RTX 5060 Ti 16 GB, NVIDIA 610.88, Windows 11 23H2, MSVC via scripts/build_runtime.ps1, on main 1bf5eeafd.
  • vk_present_dump_test gains --slow (vk_present_dump_slow): N=60 and LEONIDA_PRESENT_DUMP_SLOW_MS=1000, three presents with a 1.5 s pause before the third; exactly the first (an Nth one) and the third (a late one) are written and decoded, the second is not. The parser's cases run before the test asks for a device, so they run on a host without one.
  • ctest -R present: 11/11 pass (vk_present_dump, _default, _invalid, _slow, xbox_present, xs_present_lazy, vk_presenter_capture_colour, present_window, xbox_present_readback_size and two more).
  • scripts/check_no_game_data.py on the changed files: clean.
  • Not run: the full suite on this branch, and a game run with the new variable (the earlier frame-number form of the option was used in game runs; this form is tested by the unit test only).

🔄 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/2146 **Author:** [@thegalaxydev](https://github.com/thegalaxydev) **Created:** 11/26/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `rt-present-dump-slow` --- ### 📝 Commits (1) - [`b633039`](https://github.com/ubiquitarianism/leonida/commit/b633039a6dd59fc89a8166ab7f403d97e135cf3f) present: LEONIDA_PRESENT_DUMP_SLOW_MS also dumps every present that comes late (RT-PRESENT-DUMP-SLOW) ### 📊 Changes **4 files changed** (+69 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `runtime/CMakeLists.txt` (+3 -1) 📝 `runtime/README.md` (+1 -0) 📝 `runtime/src/present_dump.h` (+49 -2) 📝 `runtime/test/vk_present_dump_test.cpp` (+16 -2) </details> ### 📄 Description RT-PRESENT-DUMP-SLOW, claimed in [#1608](https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7177310222) as RT-PRESENT-DUMP-FROM. The claim named a first frame number; measuring showed that number is not stable (below), so the option is keyed on the gap between presents instead and renamed to say so. ## What `LEONIDA_PRESENT_DUMP_SLOW_MS=<ms>`: with `LEONIDA_PRESENT_DUMP=DIR[,N]`, a present that comes at least `<ms>` after the one before it is dumped too, whatever `N` is. - `present_dump::parse_slow_gap` reads the value: milliseconds over 0; unset or empty is off; anything else is refused with one log line and the dump goes on as before. - `PresentDump::due(index)` measures the gap the first time a present asks and gives both of that present's questions (copy the swapchain image in `finish_image`, save it after the present) the same answer, so a frame is never copied without being saved or saved without being copied. - `runtime/README.md` has the new row under `LEONIDA_PRESENT_DUMP`. ## Why At a world start the loading screens are thousands of presents a few milliseconds apart, and the frames after them come seconds apart. `DIR,N` then either misses the slow frames (large `N`: of the first 8 world frames of one run, `N=50` kept 1) or writes thousands of loading frames first (small `N`: 713 PNGs, about 10 GB at 2544x1401, before the first world frame of another run). A fixed first frame does not work either: on the same machine and title the world started at present 1,930 in one run and at 2,634 in the next, because the loading screens present faster when a submission costs less. The gap separates the two kinds of frame in every run. ## Tested - RTX 5060 Ti 16 GB, NVIDIA 610.88, Windows 11 23H2, MSVC via `scripts/build_runtime.ps1`, on main 1bf5eeafd. - `vk_present_dump_test` gains `--slow` (`vk_present_dump_slow`): `N=60` and `LEONIDA_PRESENT_DUMP_SLOW_MS=1000`, three presents with a 1.5 s pause before the third; exactly the first (an Nth one) and the third (a late one) are written and decoded, the second is not. The parser's cases run before the test asks for a device, so they run on a host without one. - `ctest -R present`: 11/11 pass (`vk_present_dump`, `_default`, `_invalid`, `_slow`, `xbox_present`, `xs_present_lazy`, `vk_presenter_capture_colour`, `present_window`, `xbox_present_readback_size` and two more). - `scripts/check_no_game_data.py` on the changed files: clean. - Not run: the full suite on this branch, and a game run with the new variable (the earlier frame-number form of the option was used in game runs; this form is tested by the unit test only). --- <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#2151
No description provided.