Skip to content

GPU: synchronize frame interval resets with tick reservations - #2479

Draft
VlREX wants to merge 3 commits into
Marvisak:mainfrom
VlREX:fix/frame-interval-clock-lock
Draft

VlREX wants to merge 3 commits into
Marvisak:mainfrom
VlREX:fix/frame-interval-clock-lock

Conversation

@VlREX

@VlREX VlREX commented Nov 25, 2026

Copy link
Copy Markdown

set_interval reads the last reserved ticks before acquiring CLOCK. A concurrent next_tick can reserve another tick in between, leaving the new interval anchored to an older tick and potentially adding an interval to the next wait for that event kind.

Hold the same CLOCK lock around the LAST scan and the clock replacement. This keeps interval resets ordered with the reservations introduced in #174.

Verified that the patch is one commit on upstream main and only changes frame.rs. Rust tests were not run locally. No title data was used.

@Bj0rnis

Bj0rnis commented Nov 25, 2026

Copy link
Copy Markdown

Independent Windows 11 hardware + WARP verification of #2479 at b5e0caab (clean git merge-tree with origin/main 940d32f6, Rust 1.98.1 MSVC):

Not tested: live game workload / frame pacing soak test.

AI-assisted test run and summary.

@catminou4 catminou4 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Synchronize frame interval resets with tick reservations. Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1.

@VlREX

VlREX commented Nov 25, 2026

Copy link
Copy Markdown
Author

Native AMD / Windows 10 validation

CPU: AMD Ryzen 5 3600X
GPU: Radeon RX 5700 XT
Driver: 32.0.21045.29003
OS: Windows 10 Pro 19045
Rust: 1.98.1

  • Workspace check: PASS
  • Frame tests: 2/2 PASS
  • Eight-thread tick reservation test: PASS
  • Clippy (-D warnings): PASS
  • GitHub CI: PASS

Tested commit: 30a5f1d

Full GPU suite and live gameplay frame pacing
were not tested in this run.

AI-assisted development (ChatGPT).
Native verification using VIREX Test Studio 1.2.1.

@andrewpozdnakov7-jpg

Copy link
Copy Markdown
Contributor

I combined this PR at 30a5f1d with the virtual clock from #2877 at 8616219 on current main 63bcca4. Tested branch at edb4bb0. Both exact PR heads and their Git authors are preserved.

In a two-thread synthetic check, I paused the interval reset just before it acquired the clock mutex, reserved tick 1, then let the reset finish. The next reservation requested tick 2. With #2877 alone it waited 14 ms after switching to a 7 ms interval. With this PR's locking applied to Pacer it waited 7 ms. The combined code samples the new start time and the latest reserved tick while holding the same lock.

The eight-thread test now uses the virtual clock and checks that eight simultaneous reservations get ticks 1 through 8, a zero-timeout poll takes none, and the first tick after the reset uses the new interval. All three frame tests passed in 30 separate processes. On WARP 1.0.22 with Agility 1.620.2, the full GPU diagnostics suite had 247 passed and one ignored with the D3D12 debug layer off and on. Strict GPU Clippy in both configurations and the asset policy passed.

Please retain the original Git authors if carrying either change separately. If folding the integration changes into another commit, please add Co-authored-by: andrewpozdnakov7-jpg <andrewpozdnakov7-jpg@users.noreply.github.com>. AI-assisted with OpenAI Codex.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants