Skip to content

Measure release-build present intervals to diagnose menu frame pacing - #2645

Open
maxence468 wants to merge 1 commit into
Marvisak:mainfrom
maxence468:gpu/present-intervals
Open

maxence468 wants to merge 1 commit into
Marvisak:mainfrom
maxence468:gpu/present-intervals

Conversation

@maxence468

Copy link
Copy Markdown

The README tracks pacing drift on one menu screen in release builds. Average FPS can hide alternating short and long intervals. This samples the wall-clock interval between host DXGI Present returns and reports the sample count, median, p95 and maximum at the existing five-second log cadence. It reuses the sample buffer across reports and preserves the interval spanning two reports.

To collect a comparison, hold on a stable menu screen for 30 seconds in release, then repeat on the affected screen. Compare the host present intervals lines. At 30 fps the nominal interval is 33.33 ms. These timings describe application submissions and do not measure monitor scanout.

Added a unit test for empty, single-sample and uneven windows. Checked the percentile rank against the nearest-rank definition for sample counts 1 through 1000 and ran git diff --check. Rust and game data were unavailable locally. The change instruments the issue and leaves the pacing algorithm intact.

@kotekompotek

Copy link
Copy Markdown

Reviewed: interval sampling on Present returns with median/p95/max is the right metric for the pacing drift. Two minor notes: present_intervals_us grows unbounded over a session (fine for a diagnostic run, worth a cap if it ever prints per-refresh); n - 1 - n/20 gives p95 = max for n < 20, acceptable during warmup. CI green.

Copy link
Copy Markdown
Owner

Automated triage for the maintainers.

This PR no longer merges cleanly into main (f3578e3). The conflict is in crates/victory-gpu/src/host.rs. It will be reviewed once it is rebased onto current main.


Generated by Claude Code

@Kajanos

Kajanos commented Nov 26, 2026

Copy link
Copy Markdown

Tested on Windows 11 Home build 26300, RTX 5080, driver 621.40, rustc 1.98.1, interactive desktop session. PR head f247480, tested on its own base 13f91ca. It does not merge onto current main 63bcca4 (conflict in crates/victory-gpu/src/host.rs, which #2110 and #1997 have since changed), so it was not tested merged.

  • cargo test --locked -p victory-gpu: 194 passed, 2 failed. The same two tests also fail on 13f91ca without this PR (descriptor::host::tests::dynamic_slots_are_held_until_released, memory::tests::lists_share_a_table_and_copies_keep_their_views, both from the view heap being below HEAP_VIEWS, which main has since fixed). No new failures.
  • The new present_interval_tests::summarizes_sparse_and_uneven_frames passes in debug and --release.

Not run: the retail title (no dump, so no real present-interval readings), clippy, other crates, the PR merged onto current main.

AI-assisted (Claude Code)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants