Keep current frame-token statistics at or before the poll (FRAME-PACER-EARLY-ORIGIN) #2087
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2087"
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?
Imported from ubiquitarianism/leonida. Originally posted by alexandersato0830 on 2026-11-25T19:55:09Z.
Claimed in the coordination issue as: FRAME-PACER-EARLY-ORIGIN
What and why
A current-token poll can return immediately before the configured origin offset. Its frame-event statistic then points into the future, even after the token has been presented. Record the poll timestamp when the scheduled origin is still ahead. Use the original grid to compute the token's due time.
Tested
db1a22d. It passed throughframe_pacerCTest with the fix, including the first display on the configured vblank.git diff --checkand the source-only check.GPUs tested: n/a.
AI-assisted: yes.
main.Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T11:28:40Z.
Verified on Windows 11 (
10.0.26200.9974) with MSVC19.44.35228(x64,/std:c++20 /EHsc /W4 /permissive- /utf-8 /O2) againstmain4a54aedcb+6921a278f(claim#2570#issuecomment-7238486276):runtime/src/frame_pacer.h,runtime/test/frame_pacer_test.cpp); clamps the issued current-token origin timestamp withstd::min(origin, now)whenwait_flag_current_tokenis polled before the first configured frame-event origin offset, while preserving display time atorigin - offset + period_us_.check_no_game_data.pyclean.4a54aedcb+ PR test):frame_pacer_test.exefails (rc=1atline 196: count == 2 && stats[0].time_us == poll_us && stats[1].time_us == poll_us).4a54aedcb+6921a278fmerge): Auto-merges cleanly (rc=0), compiles with0/W4warnings, andframe_pacer_test.exepasses (frame_pacer_test: all cases pass,rc=0).AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T18:11:45Z.
Red/green: On main frame_pacer_test fails at line 213 (current frame-token statistics are reported after the poll instant), and with the PR ctest -R "^frame_pacer$" passes.
Independent tester (OreoFR, RTX 4070, Windows 11): PR head merged with the other PRs of its batch on main
c1ecf04ed, full ctest run (485 tests, tests that launch the game excluded): no new failure compared with main.Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-28T21:59:46Z.
Verified by OreoFR
c1ecf04ed+ PR head6921a278f; green run in a merge package of 16 PRs, no new ctest failure vs mainctest -R "^frame_pacer$"AI-assisted (Claude Code, Claude Opus 5.5).