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

Closed
leonida/mandy
alexandersato0830 wants to merge 0 commits from codex/frame-pacer-repeated-token-stats into main

Pull request closed

This pull request cannot be reopened because the branch was deleted.

alexandersato0830 commented 2026-11-25 18:42:36 +00:00

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.
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.
MoonEyes commented 2026-11-28 02:49:03 +00:00

Hi @alexandersato0830, thanks for this pull request. It currently conflicts with main (conflicting file(s): runtime/src/frame_pacer.h), so it carries the needs rebase label. CONTRIBUTING.md asks authors to rebase their branch on main; once it merges cleanly the label goes within the hour, and reviews start with the pull requests that do. Could you update the branch when you have a moment? If you no longer plan to continue with it, please say so here.

AI-assisted (Claude Code, Claude Opus 5.5).

Hi @alexandersato0830, thanks for this pull request. It currently conflicts with `main` (conflicting file(s): `runtime/src/frame_pacer.h`), so it carries the `needs rebase` label. CONTRIBUTING.md asks authors to rebase their branch on `main`; once it merges cleanly the label goes within the hour, and reviews start with the pull requests that do. Could you update the branch when you have a moment? If you no longer plan to continue with it, please say so here. AI-assisted (Claude Code, Claude Opus 5.5).
OreoFR commented 2026-11-28 21:58:36 +00:00

Verified by OreoFR

  • Base: main c1ecf04ed + PR head ac2fff231
  • Test: not run (merge conflict with main)
  • Red on main: not run
  • Green with the PR: not run
  • Verdict: CONFLICT (conflicts with main in runtime/src/frame_pacer.h (get_frame_statistics/present() comment, bounded queue from an earlier PR); non-trivial, needs a rebase)
  • Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11

AI-assisted (Claude Code, Claude Opus 5.5).

**Verified by OreoFR** - Base: main `c1ecf04ed` + PR head `ac2fff231` - Test: not run (merge conflict with main) - Red on main: not run - Green with the PR: not run - Verdict: CONFLICT (conflicts with main in runtime/src/frame_pacer.h (get_frame_statistics/present() comment, bounded queue from an earlier PR); non-trivial, needs a rebase) - Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11 AI-assisted (Claude Code, Claude Opus 5.5).
aslan2142 commented 2026-12-01 16:41:30 +00:00

Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (d3d12/) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, d3d12/, or general docs), please feel free to reopen it.

Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (`d3d12/`) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, `d3d12/`, or general docs), please feel free to reopen it.
Sign in to join this conversation.
No description provided.