Skip to content

Rate-limit TUI frames from their actual emission time - #39057

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/8c9a5ac0bf858b2ad87838f6d7c67c9470fdfc61
Aug 17, 2026
Merged

Rate-limit TUI frames from their actual emission time#39057
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/8c9a5ac0bf858b2ad87838f6d7c67c9470fdfc61

Conversation

@copyberry

@copyberry copyberry Bot commented Aug 17, 2026

Copy link
Copy Markdown

Rate-limit TUI frames from their actual emission time

Why

Recording a late frame's requested deadline as its emission time can leave the
rate limiter with a stale timestamp, allowing the next frame to be emitted
immediately in a redraw burst.

What changed

Record the current time when the frame scheduler sends a draw notification so
the 120 FPS limit is measured from the actual emission.

Testing

Add a paused-time regression test that submits an overdue draw and verifies the
next frame waits for MIN_FRAME_INTERVAL.

## Why

Recording a late frame's requested deadline as its emission time can leave the
rate limiter with a stale timestamp, allowing the next frame to be emitted
immediately in a redraw burst.

## What changed

Record the current time when the frame scheduler sends a draw notification so
the 120 FPS limit is measured from the actual emission.

## Testing

Add a paused-time regression test that submits an overdue draw and verifies the
next frame waits for `MIN_FRAME_INTERVAL`.

GitOrigin-RevId: 8c9a5ac0bf858b2ad87838f6d7c67c9470fdfc61
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/8c9a5ac0bf858b2ad87838f6d7c67c9470fdfc61 branch from 2c95a56 to 796325f Compare August 17, 2026 19:35
@copyberry
copyberry Bot merged commit 796325f into main Aug 17, 2026
28 of 32 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/8c9a5ac0bf858b2ad87838f6d7c67c9470fdfc61 branch August 17, 2026 19:36
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant