mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:35:53 +01:00
[PR #1237] frame_pacer: cancel a wait that spans suspend and re-registration #1269
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1269
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1237
Author: @titoreinaldo
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:contrib/r2-pacer📝 Commits (1)
9a5ba38frame_pacer: cancel waits that span suspend and re-registration📊 Changes
2 files changed (+43 additions, -1 deletions)
View changed files
📝
runtime/src/frame_pacer.h(+5 -1)📝
runtime/test/frame_pacer_test.cpp(+38 -0)📄 Description
Claimed in the coordination issue as: RT-PACER-SUSPEND-EPOCH
Claim in #14
What and why
A wait could enter before suspend, wake after resume and re-registration, then consume the first tick of the new registration. A pre-suspend origin wait could even issue the resumed frame’s token. The pacer now records each suspend under its existing mutex. When a waiter regains the lock it can tell that its registration ended, even if the new one is already armed.
The regression drives that ordering through the existing injected clock. It checks origin, vblank and flip events, verifies the old wait returns
invalid_statewithout changing the caller’s token, and verifies a fresh wait can still take the first resumed tick. This concerns the project’s modeled pacing contract. #1042 touches the same header for a different wakeup case. The two commits merge cleanly.Tested
frame_pacer_testfirst. It passed. Adding the new ordering against the pre-fix header failed at the expected old-wait assertion.ctest --test-dir <build> -R frame_pacer --repeat until-fail:10 --output-on-failure.58be9cdf, 6,168 translator tests in 470 files had zero failing files. Verified a clean merge withmainat705ea091and the head of #1042.GPUs tested: CPU-only frame pacing, Windows 11 Pro 26H2 build 26300.9974, LLVM-MinGW 23.1.6.
AI-assisted: yes, OpenAI Codex. Synthetic clock and inputs.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.