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

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

@⁠thegalaxydev on GitHub · 2026-11-25 23:20 UTC · original
thegalaxydev:rt-present-dump-slow → main · +69 −5 · 4 files · 1 commits · draft

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).
**@⁠thegalaxydev** on GitHub · 2026-11-25 23:20 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2146) `thegalaxydev:rt-present-dump-slow` → `main` · +69 −5 · 4 files · 1 commits · draft RT-PRESENT-DUMP-SLOW, claimed in [#1608](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/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).
A world start shows thousands of loading-screen presents a few milliseconds apart and then frames seconds apart, at a
present number that differs from run to run (1,930 and 2,634 measured), so no N of LEONIDA_PRESENT_DUMP=DIR,N keeps the
slow frames without the thousands before them. With LEONIDA_PRESENT_DUMP_SLOW_MS=<ms> a present that comes at least
that long after the one before it is dumped too, whatever N is. A present's two questions (copy the image, save it)
share one answer. vk_present_dump_test gains --slow and checks the parser before it asks for a device.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:20:05 +00:00
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/2146/head:github-bot/gh-2146'
git switch 'github-bot/gh-2146'

Merge

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