[PR #1198] present: look up retained frame tokens by age #1230

Open
opened 2026-11-26 20:20:32 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1198
Author: @Kadamitas
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: perf/retained-frame-token-lookup


📝 Commits (1)

  • 7b61143 present: look up retained frame tokens by age

📊 Changes

1 file changed (+35 additions, -37 deletions)

View changed files

📝 runtime/src/frame_pacer.h (+35 -37)

📄 Description

Claimed in the coordination issue as direct lookup of retained FramePacer records.

What and why

Several FramePacer operations scan the same retained history to find one frame token. Tokens in that history are consecutive, so their age identifies a record directly. Use one bounded lookup for statistics, submission timing and retirement, preserving missing and expired token behavior and the existing lock.

Tested

  • Both existing upstream frame-pacer test paths passed before and after.
  • An independent boundary check verified null and expired tokens, the 64-record limit, and wraparound.
  • MSVC /O2 on Windows, five runs per version with two million presents and 250,000 statistics queries per run. Median CPU time fell from 95.3 to 41.3 ns per token. This measures the frame-pacer bookkeeping in isolation.

GPUs tested: N/A. The frame-pacer fixture uses a simulated clock.

AI-assisted: yes.

Checklist

  • Based on current main (6293c1c4f).
  • 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/1198 **Author:** [@Kadamitas](https://github.com/Kadamitas) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `perf/retained-frame-token-lookup` --- ### 📝 Commits (1) - [`7b61143`](https://github.com/ubiquitarianism/leonida/commit/7b61143e6e9f16a86f8daeade8546c0f3daa15b4) present: look up retained frame tokens by age ### 📊 Changes **1 file changed** (+35 additions, -37 deletions) <details> <summary>View changed files</summary> 📝 `runtime/src/frame_pacer.h` (+35 -37) </details> ### 📄 Description Claimed in the coordination issue as [direct lookup of retained FramePacer records](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7142953830). ### What and why Several FramePacer operations scan the same retained history to find one frame token. Tokens in that history are consecutive, so their age identifies a record directly. Use one bounded lookup for statistics, submission timing and retirement, preserving missing and expired token behavior and the existing lock. ### Tested - Both existing upstream frame-pacer test paths passed before and after. - An independent boundary check verified null and expired tokens, the 64-record limit, and wraparound. - MSVC /O2 on Windows, five runs per version with two million presents and 250,000 statistics queries per run. Median CPU time fell from 95.3 to 41.3 ns per token. This measures the frame-pacer bookkeeping in isolation. GPUs tested: N/A. The frame-pacer fixture uses a simulated clock. AI-assisted: yes. ### Checklist - [x] Based on current `main` (`6293c1c4f`). - [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#1230
No description provided.