video_out_flip_tests pacing fails on an RTX 5070 Ti: the first flip is released and completes in the same vblank #7581

Closed
opened 2026-10-18 15:37:28 +00:00 by cadenasynyster · 2 comments
cadenasynyster commented 2026-10-18 15:37:28 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by cadenasynyster on 2026-10-18T15:37:28Z.


video_out_flip_tests pacing fails 3 of 3 runs on this machine, on main 9f25d0b and on f3263df:

the next flip is not paced from the vblank this flip was released at

The check in testReleaseVblank (Flip.cpp) needs lastFlipVblank >= 3 && vblankStatus.count >= lastFlipVblank + 3 when the first flip completes: the flip is released early, and its completion then waits at least 3 vblanks for the 100M-iteration busy loop queued ahead of it. With a local printf of both values just before the check (not committed), all three runs print:

pacing: lastFlipVblank=11 vblank=11

So the flip is released at vblank 11 and completes in that same vblank. No vblank passes between release and completion, so the GPU work queued ahead of the flip no longer separates them. aftergpu, which uses the same busy loop, passes on the same build: GPU work landed at 176.6 ms, flip completed at 177.0 ms.

Setup: Windows 11 26200, RTX 5070 Ti (NVIDIA 617.42), Ryzen 7 9800X3D, WinLibs GCC 15.2.0 r7, Release. Run directly as build\tests\video_out_flip_tests.exe pacing with a real window (CI doesn't run it, see #6899). Same result with the desktop at 60 Hz and at 165 Hz, and with Windows HDR on and off.

Correction to my comment on #7246: there I reported pacing passing on main f3263df. Rebuilt from f3263df today, it fails as above. That earlier run used a test binary from the older output folder (build\core\libs\prx\libSceVideoOut), which f3263df no longer builds into, so it was probably an older build of the test.

#6507 reports pacing passing on an RTX 4060 Laptop, Intel UHD and lavapipe, so it may depend on how the timings fall on a given machine. I haven't found where the flip is held.

Not run: Linux, other GPUs, a bisect (both commits I built fail the same way).

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5911190172 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7581). Originally posted by [cadenasynyster](https://github.com/cadenasynyster) on 2026-10-18T15:37:28Z. --- `video_out_flip_tests pacing` fails 3 of 3 runs on this machine, on main 9f25d0b and on f3263df: ``` the next flip is not paced from the vblank this flip was released at ``` The check in `testReleaseVblank` (`Flip.cpp`) needs `lastFlipVblank >= 3 && vblankStatus.count >= lastFlipVblank + 3` when the first flip completes: the flip is released early, and its completion then waits at least 3 vblanks for the 100M-iteration busy loop queued ahead of it. With a local `printf` of both values just before the check (not committed), all three runs print: ``` pacing: lastFlipVblank=11 vblank=11 ``` So the flip is released at vblank 11 and completes in that same vblank. No vblank passes between release and completion, so the GPU work queued ahead of the flip no longer separates them. `aftergpu`, which uses the same busy loop, passes on the same build: `GPU work landed at 176.6 ms, flip completed at 177.0 ms`. Setup: Windows 11 26200, RTX 5070 Ti (NVIDIA 617.42), Ryzen 7 9800X3D, WinLibs GCC 15.2.0 r7, Release. Run directly as `build\tests\video_out_flip_tests.exe pacing` with a real window (CI doesn't run it, see #6899). Same result with the desktop at 60 Hz and at 165 Hz, and with Windows HDR on and off. Correction to my comment on #7246: there I reported `pacing` passing on main f3263df. Rebuilt from f3263df today, it fails as above. That earlier run used a test binary from the older output folder (`build\core\libs\prx\libSceVideoOut`), which f3263df no longer builds into, so it was probably an older build of the test. #6507 reports `pacing` passing on an RTX 4060 Laptop, Intel UHD and lavapipe, so it may depend on how the timings fall on a given machine. I haven't found where the flip is held. Not run: Linux, other GPUs, a bisect (both commits I built fail the same way). AI-assisted: yes
MarcZX10 commented 2026-10-18 15:41:09 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T15:41:09Z.


I think the pacing assertion may be checking the wrong interval. In current Flip.cpp, testReleaseVblank submits one CPU flip, waits for that flip to complete, then asserts that three more vblanks have passed since lastFlipVblank. In VideoOutDriver::processFlip, the flip first waits for lastFlipVblank + (flipRate + 1), then records the current vblankStatus.count as the new lastFlipVblank immediately before presentation. That interval paces a subsequent flip; the source does not require the same flip to wait another interval after its release before completing. So release and completion in one vblank appears consistent with this path. To test the release anchor directly, the fixture could submit a second flip after the first completes and assert that its release vblank is at least flipRate + 1 after the first flip's recorded release. This is a source-based hypothesis; I have not run the RTX 5070 Ti setup.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6251813370 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7581#issuecomment-6251813370). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T15:41:09Z. --- I think the pacing assertion may be checking the wrong interval. In current `Flip.cpp`, `testReleaseVblank` submits one CPU flip, waits for that flip to complete, then asserts that three more vblanks have passed since `lastFlipVblank`. In `VideoOutDriver::processFlip`, the flip first waits for `lastFlipVblank + (flipRate + 1)`, then records the current `vblankStatus.count` as the new `lastFlipVblank` immediately before presentation. That interval paces a subsequent flip; the source does not require the same flip to wait another interval after its release before completing. So release and completion in one vblank appears consistent with this path. To test the release anchor directly, the fixture could submit a second flip after the first completes and assert that its release vblank is at least `flipRate + 1` after the first flip's recorded release. This is a source-based hypothesis; I have not run the RTX 5070 Ti setup.
MarcZX10 commented 2026-10-18 15:46:51 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T15:46:51Z.


Opened #7583 with a test-only correction. It keeps the initial release-vblank sanity check and removes the requirement for three additional vblanks after completion; testPresentation() already checks the interval between consecutive flips. The changed test translation unit passes Linux syntax compilation here, but I could not build/run the VideoOut executable in this container.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6251870913 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7581#issuecomment-6251870913). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T15:46:51Z. --- Opened #7583 with a test-only correction. It keeps the initial release-vblank sanity check and removes the requirement for three additional vblanks after completion; `testPresentation()` already checks the interval between consecutive flips. The changed test translation unit passes Linux syntax compilation here, but I could not build/run the VideoOut executable in this container.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5#7581
No description provided.