Skip to content

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

Open
alexandersato0830 wants to merge 1 commit into
ProjectLeonida:mainfrom
alexandersato0830:codex/frame-pacer-repeated-token-stats
Open

alexandersato0830 wants to merge 1 commit into
ProjectLeonida:mainfrom
alexandersato0830:codex/frame-pacer-repeated-token-stats

Conversation

@alexandersato0830

Copy link
Copy Markdown
Contributor

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.

@github-actions github-actions Bot added the needs rebase Conflicts with the base branch: rebase it on main label Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs rebase Conflicts with the base branch: rebase it on main

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant