Skip to content

fix(agc): stop flips raising the end-of-pipe event on queues with release interrupts (#7137 on the PS4 branch) - #5

Closed
savvaniss wants to merge 4 commits into
Get-fix:ps4/limbo-gpufrom
savvaniss:fix/ps4-flip-latch
Closed

savvaniss wants to merge 4 commits into
Get-fix:ps4/limbo-gpufrom
savvaniss:fix/ps4-flip-latch

Conversation

@savvaniss

Copy link
Copy Markdown

What

On boykopovar#6977's branch every flip raises the graphics end-of-pipe event, as main did since boykopovar#4215. boykopovar#7137, merged into main on 18 Oct, after boykopovar#6977's head 93eeee014, stops that on a queue whose title raises its own release interrupts. This brings its four commits to the PS4 branch, with their authorship kept. One conflict: boykopovar#6977 rewrote Eq/src/Event.cpp for PS4 events (a registration carries a queue and an ident). boykopovar#7137 only makes AgcDriverDeliverEopInterrupt return whether it delivered the event, so that change is applied to boykopovar#6977's version of the function.

Why the PS4 branch needs it: the Unity player in Boggle and Trivial Pursuit Live! (CUSA03312) ends every frame with an EVENT_WRITE_EOP that requests an interrupt. It then calls sceKernelWaitEqueue for one event, without reading the label, before it builds the next frame.

  • With the flip's extra event, one event was still pending after each wait, so the title got one more frame ahead of the queue with every flip.
  • The 16-flip queue stopped it 15 to 16 submissions ahead of the queue worker (measured with a label written at the end of each submission).
  • The title has two command buffers, and their descriptor tables are rewritten every second frame. So the worker read tables written up to 15 frames later.
  • When a scene changed its layout, a draw found a T# where its V# should be, or the reverse. These were the intermittent "buffer descriptor uses an unsupported type" and "runtime image descriptor is invalid" stops.

shadPS4 also raises a separate flip interrupt for a PS4 flip, not the end-of-pipe one.

boykopovar#7978 removes the flip event on main altogether. When boykopovar#6977 is rebased onto a main with boykopovar#7978 or boykopovar#7137, this PR can be dropped.

Tested

Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release, on boykopovar#6977's head 93eeee014.

  • agc_driver (now with fix(agc): suppress the flip end-of-pipe event on queues that raise release interrupts boykopovar/AnyPS5#7137's latch cases), agc_driver_readonly_resummarize, agc_driver_present_mode, agc_driver_worker_failure_log and agc_driver_flip_compute pass on both GPUs, as their 93eeee014 versions do there.
  • Validation layer: the same five tests on 93eeee014 and on this branch, on both GPUs, with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation. The VUID- lines are the same on both: two VUID-vkDestroyDevice-device-05137 on the RX 9070 XT and none on the UHD 770. Neither log contains was not found but was requested by env var VK_INSTANCE_LAYERS, and each log's Selected GPU line names the GPU of its run.
  • CUSA03312, with fix(agc): PS4 display, textures and GCN instructions for CUSA03312 #1, feat(np): answer and declare the PS4 NP, trophy and GNM imports of CUSA03312 #2 and local changes for later stops (GCN multisampled color targets, forced sRGB decoding, depth bias on float targets), which will follow as their own PRs:
    • Boggle gets one end-of-pipe event per frame instead of two (2684 events for 2683 submissions). The queue worker stays within two submissions of the title (it was 15 to 16 behind). The title screen runs at 59.94 fps without the descriptor stop. The next stop is a texture read of a multisampled color target.
    • Trivial Pursuit Live! now runs without APS5_SYNC_DRAWS and APS5_SYNC_FLIP. Its menus run at 59.9 fps through Play Now, Configuration and Select Character, where it used to stop on the same descriptor errors. It starts a game: the game-show stage renders at about 10 fps.
  • tools/check_conventions.py --base 93eeee014 passes.

Checklist

🤖 Generated with Claude Code

A queue that delivered an end-of-pipe interrupt from its own release stopped
delivering the flip's event for the rest of the run, so a title that raises a
release interrupt once and then waits on the flip event never saw it again.

Count the flips a queue has taken since its last delivered release interrupt:
four consecutive flips keep the latch, a fifth clears it and raises the event,
so the queue recovers within five flips. Gran Turismo 7 (PPSA01317) pairs two
flips with one release interrupt per frame, which stays under the limit, and a
title that flips without further release interrupts recovers.

Extend agc_driver_eop_interrupts: a latched queue still delivers its own
releases, flips keep reaching the video output while their event is suppressed,
an event returns once the latch clears, and a release followed by two flips
raises none.
@Get-fix

Get-fix commented Oct 21, 2026

Copy link
Copy Markdown
Owner

Thanks @Lberonio. boykopovar#6977 is now a draft integration branch, and its own work is split into boykopovar#9429 to boykopovar#9433 (details). The maintainers asked that the branch not land anything without its own review, so could you open this upstream against main, on top of boykopovar#9431, with Depends on? Once it's open, I'll merge it into ps4/limbo-gpu, list it as a member and run Limbo with it. ps4/limbo-gpu now moves to the split branches, so this pull request may show conflicts here.

AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

@savvaniss

Copy link
Copy Markdown
Author

boykopovar#7137 is on main, and boykopovar#9431 is built on a main that has it, so this port isn't needed any more. Closing.

@savvaniss savvaniss closed this Oct 22, 2026
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.

3 participants