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

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

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/2037
Author: @alexandersato0830
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: codex/frame-pacer-repeated-token-stats


📝 Commits (1)

  • ac2fff2 Preserve first-present timestamps for repeated frame tokens

📊 Changes

2 files changed (+50 additions, -13 deletions)

View changed files

📝 runtime/src/frame_pacer.h (+18 -13)
📝 runtime/test/frame_pacer_test.cpp (+32 -0)

📄 Description

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.

🔄 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/2037 **Author:** [@alexandersato0830](https://github.com/alexandersato0830) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `codex/frame-pacer-repeated-token-stats` --- ### 📝 Commits (1) - [`ac2fff2`](https://github.com/ubiquitarianism/leonida/commit/ac2fff231a2b035f61bb987eceab00dc8e03f083) Preserve first-present timestamps for repeated frame tokens ### 📊 Changes **2 files changed** (+50 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `runtime/src/frame_pacer.h` (+18 -13) 📝 `runtime/test/frame_pacer_test.cpp` (+32 -0) </details> ### 📄 Description Claimed in the coordination issue as: [FRAME-PACER-REPEATED-TOKEN-STATS](https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7171216222) 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. --- <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#2041
No description provided.