Preserve first-present timestamps for repeated frame tokens (FRAME-PACER-REPEATED-TOKEN-STATS) #2037

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

@⁠alexandersato0830 on GitHub · 2026-11-25 18:42 UTC · original
alexandersato0830:codex/frame-pacer-repeated-token-stats → main · +50 −13 · 2 files · 1 commits · open

Claimed in the coordination issue as: FRAME-PACER-REPEATED-TOKEN-STATS

Depends on: #1198 (overlapping FramePacer record lookup). This fix is based on main. The two changes can land in either order, with the later one resolving the overlap.

What and why

PresentX accepts repeat tokens so a repeat does not stall presentation. Repeating a token after its first frame displayed currently overwrites present_us while leaving the first frame's display_us. GetFrameStatisticsX can then report a display before the present.

Keep the first present and its display together in the token record. Repeat frames still enter the pacing queue and count toward the frame summary. Reuse the lookup already performed for timing samples.

Tested

  • The fake-clock regression fails on 73cc1a2ba after the second present overwrites the first timestamp. It checks both timestamps before and after the repeat retires, then checks an uncapped repeat.
  • Built frame_pacer_test with MSVC 19.51 on Windows 11 and ran the CMake frame_pacer test in RelWithDebInfo. All cases passed.
  • git diff --check and the source-only check passed.

GPUs tested: n/a (fake clock, CPU-only)

AI-assisted: yes (Codex)

Checklist

  • Based on current main.
  • One topic.
  • No game data, keys or decryption.
**@⁠alexandersato0830** on GitHub · 2026-11-25 18:42 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2037) `alexandersato0830:codex/frame-pacer-repeated-token-stats` → `main` · +50 −13 · 2 files · 1 commits · open Claimed in the coordination issue as: [FRAME-PACER-REPEATED-TOKEN-STATS](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608) Depends on: #1198 (overlapping FramePacer record lookup). This fix is based on `main`. The two changes can land in either order, with the later one resolving the overlap. ### What and why PresentX accepts repeat tokens so a repeat does not stall presentation. Repeating a token after its first frame displayed currently overwrites `present_us` while leaving the first frame's `display_us`. `GetFrameStatisticsX` can then report a display before the present. Keep the first present and its display together in the token record. Repeat frames still enter the pacing queue and count toward the frame summary. Reuse the lookup already performed for timing samples. ### Tested - The fake-clock regression fails on `73cc1a2ba` after the second present overwrites the first timestamp. It checks both timestamps before and after the repeat retires, then checks an uncapped repeat. - Built `frame_pacer_test` with MSVC 19.51 on Windows 11 and ran the CMake `frame_pacer` test in RelWithDebInfo. All cases passed. - `git diff --check` and the source-only check passed. GPUs tested: n/a (fake clock, CPU-only) AI-assisted: yes (Codex) ### Checklist - [x] Based on current `main`. - [x] One topic. - [x] No game data, keys or decryption.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:15:44 +00:00
This pull request has changes conflicting with the target branch.
  • runtime/src/frame_pacer.h
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

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