Repository navigation
Conversation
MoonEyes
left a comment
There was a problem hiding this comment.
LGTM, with one question (not blocking).
Setup: Windows 11 Pro 26300, NVIDIA GeForce RTX 4060, driver 610.88, Vulkan SDK 1.4.363.0, MSVC 19.44.35230.0 (VS 2022), CMake 3.31.6 + Ninja, RelWithDebInfo, -DLEONIDA_REQUIRE_VULKAN=ON. main = b9320a118. Only frame_pacer_test was built and run (ctest -R "^frame_pacer$"). Not run: the whole ctest set, any game boot.
Head a14f74c2b.
- PR head:
frame_pacerPassed (1/1). main:frame_pacerPassed (1/1).- PR merged into
mainlocally (no conflict): Passed (1/1). - Mutant (PR test,
runtime/src/frame_pacer.hofmain): Failed,line 346: displayed_at(second) == new_epoch + new_period. So the new block does catch the old behaviour; the first assertion (the retired frame keeps its timestamp) passes onmaintoo, which is expected.
Question: set_frame_interval now moves the queued flips on every call, not only when the period changes. I measured it with a local probe (not part of the PR): period 16000 us, one frame queued for 32000 us, a second set_frame_interval(16000, 3, 0) at 24000 us. On main the frame is displayed at 32000 us, with this PR at 40000 us. 40000 is the first vblank of the re-based grid, so it is consistent with the PR's rule, but a title that repeats SetFrameIntervalX with an unchanged interval would see queued frames slip. Is that intended, or should an unchanged period leave the queue alone? A test case for it would settle it either way.
AI-assisted: yes (Claude Code built and ran the tests)
…, and rebase frame pacer flips (W14-04, W14-10d) - W14-04 (runtime/shims/dstorage.cpp): - Raise auto-submit threshold from >= half() to strictly > half() (clamped to usable()) and reflect it in Query1::RequestCountUntilAutoSubmit (adapted from Marvisak/VIctory#2074, GPL-3.0). - Hold options::kDestinationPages requests and all subsequent entries (plain reads, Status, Signal, Event) on auto-submit until explicit Submit() so DestinationPageArray can be populated before execution and later entries cannot overtake held paged requests or misattribute errors; force-flush only when the queue is completely full with nothing submitted or in flight so titles cannot deadlock (adapted from Marvisak/VIctory#2617, TheBiemGamer/VIctory-Belobug-AMD@5895cd9b07, GPL-3.0). - Retry DestinationPageArray reads in paged_request() for up to 250 ms with 1 ms sleeps when any page entry reads 0, honoring cancellation and queue close before failing with E_DSTORAGE_ACCESS_VIOLATION (adapted from Marvisak/VIctory#2338, TheBiemGamer/VIctory-Belobug-AMD@c5e2970aa6, uwutaube/VIctory@85a0f763b9, GPL-3.0), while preserving destination_may_alias and host-bounce recovery. - Fix pre-existing C4244 uint64_t->UINT32 narrowing warnings in Stats::snapshot(). - W14-10d (runtime/src/frame_pacer.h): - Retire already-passed pending flips (preserving original display timestamps) and rebase remaining pending flips onto consecutive slots of the new vblank grid in FIFO order when the frame interval or FPS limit changes (adapted from ubiquitarianism/leonida#1992, GPL-3.0). - Tests (runtime/test/dstorage_test.cpp, runtime/test/frame_pacer_test.cpp): - Cover strict > half() auto-submit, kDestinationPages hold and ordering with subsequent Status/Signal/Event/plain reads, full-queue deadlock avoidance, late-filled page == 0 retry/timeout/cancellation, and speedup/slowdown/FPS-limit pending-flip rebasing.
Claimed as RT-FRAME-INTERVAL-PENDING-VBLANK.
In a native fake-clock reproduction, changing from 30 to 60 FPS with one old frame still queued placed the next flip at 83,333 µs. The new vblanks were at 56,667, 73,334 and 90,001 µs. The no-pending control displayed at 73,334 µs. Both cases now display at 73,334 µs.
At the interval change, retire flips whose original time already passed, then assign the remaining flips consecutive slots on the rebased grid in FIFO order. The regression asserts that the first retired timestamp is preserved, two pending frames keep their order, and a new frame gets the next slot. This changes rate transitions. The separate mailbox-overflow behavior in #671 is outside the patch. I ran the same reproduction on that branch and it still produced 83,333 µs.
Tested
frame_pacer_test. The new test fails with the unchanged header and the full suite passes with the patch.fd33a31, whose pacing and test files are identical to the measuredfe15534base.git diff --checkand the source-only policy check passed.GPUs tested: n/a.
AI-assisted: yes.
Checklist
Independent review follow-up
The independent review on an RTX 4060 confirmed the changed-period regression and found that reapplying the same 16,000 µs period moved a frame from 32,000 to 40,000 µs. The follow-up keeps existing flip deadlines on a repeated period while preserving the event epoch update. The new manual-clock check observes the frame at 32,000 µs and the next origin at 40,000 µs. The previous PR head failed the new frame assertion. The native frame-pacer suite passed three runs with the follow-up.
Independent review