mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:25:53 +01:00
[PR #891] [MERGED] runtime: frame pacing drift and latency percentile reporting (BL-6) #929
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#929
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/891
Author: @SweatierKey
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @aslan2142
Base:
main← Head:feat/bl6-frame-pacing-drift📝 Commits (1)
7bb915druntime: frame pacing drift and latency percentile reporting (BL-6)📊 Changes
8 files changed (+320 additions, -4 deletions)
View changed files
📝
docs/boot.md(+5 -2)📝
docs/d3d12_vulkan.md(+8 -0)📝
runtime/shims/xbox_present.cpp(+21 -0)📝
runtime/shims/xbox_present.h(+3 -0)📝
runtime/src/frame_pacer.h(+99 -1)📝
runtime/test/frame_pacer_test.cpp(+108 -0)📝
tests/test_boot_trace.py(+36 -0)📝
tools/boot_trace.py(+40 -1)📄 Description
Claimed in the coordination issue as: BL-6 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7134996146)
What and why
Implements boot lead BL-6 (
docs/boot_leads.md): long-running frame pacing can drift against the target interval, and per-frame percentiles plus origin-to-present latency make that drift visible in run summaries.runtime/src/frame_pacer.h:frame_pacing_window = 1024) recording present-to-present frame intervals and origin-to-present latencies acrosscommit_present_tokenandnote_untokened_present.suspend()so suspended pauses do not pollute frame-time statistics after resume.FramePacer::pacing_summary()returningFramePacingSummary(frames,samples,target_interval_us,mean_us,drift_us = mean_us - target_interval_us, nearest-rankp50_us/p95_us/p99_us, andlatency_samples/latency_p50_us/latency_p95_us/latency_p99_us). Unpaced/uncapped runs keeptarget_interval_us = 0anddrift_us = 0.0while still tracking frame intervals.runtime/shims/xbox_present.h,runtime/shims/xbox_present.cpp:XboxPresentation::pacing_summary()andlog_pacing_summary(), and logs one[rt] present: pacing summary ...line on stderr at teardown whenever at least one frame was presented.tools/boot_trace.py:[rt] present: pacing summary ...from--d3d12stderr logs (including PowerShell's<exe> :prefix), renders the frame-pacing summary line beside the D3D12 counts in text output, and includes the numericframe_pacingdictionary in--jsonand--counts-only.docs/d3d12_vulkan.md,docs/boot.md:Tested
frame_pacer_test.exe,xbox_present_test.exe, andgta6rt.execleanly withclang-cl 23.1.6+ Windows SDK10.0.26100+ninja.frame_pacer_test.exe: PASS (all cases pass), including 6 new fake-clock (ManualFrameClock) test cases covering empty/single-frame edge cases, a 100-frame known distribution (exactp50/p95/p99,mean_us, positivedrift_us, and origin-to-present latencies), negative drift,suspend()/resume()pause exclusion, full 1024-frame ring-buffer wrap-around, and uncapped mode.xbox_present_test.exeon NVIDIA GeForce RTX 5070 Ti: PASS (all cases pass), confirming live[rt] present: pacing summary ...output at teardown (e.g.frames=35 samples=34 target_us=16667 mean_us=18002.1 drift_us=+1335.1 p50_us=16513 p95_us=38025 p99_us=48016 latency_samples=34 latency_p50_us=718 latency_p95_us=21880 latency_p99_us=32067).python3 -I tests/test_boot_trace.py: 33/33 passed (including newtest_frame_pacing_summary_parsed_formatted_and_kept_in_counts_only).python3 -I tests/test_dev_boot_trace.py: 5/5 passed.python3 -I tests/test_text_write_line_endings.py: 3/3 passed;python3 -I scripts/check_no_game_data.pyandpython3 -m compileall -q make_game.py tools tests: passed.GPUs tested: NVIDIA GeForce RTX 5070 Ti, driver 616.92, Windows 11
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (N/A — runtime/tooling lead recorded indocs/d3d12_vulkan.mdanddocs/boot.mdperdocs/boot_leads.md.)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.