fix(agc): avoid duplicate GT7 EOP flip events #6963

Closed
MarcZX10 wants to merge 3 commits from upstream-pr/6963 into main
MarcZX10 commented 2026-10-16 21:24:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T21:24:04Z.


What

  • Track whether a queue-0 guest EOP was actually delivered, then suppress exactly the next synthetic flip EOP. A later flip without a preceding guest EOP still raises its event.
  • Keep the suppression marker at packet execution time so inline and deferred deliveries follow the same packet order. The focused regression covers guest-EOP then flip, flip then guest-EOP, and the following bare flip.
  • This addresses the PPSA01317 / GT7 null-dereference report in #6350. The reporter's RADV runtime A/B supports the duplicate-event diagnosis; this PR adds the implementation and focused regression.

Tested

  • Linux, GCC 12.2 Release: agc_driver_tests built successfully; focused CTest agc_driver_guest_eop_flip_suppression passed (1/1).
  • This host lacks the emulator's required CPU extensions, and GCC 12 needs a template keyword in an unrelated current-main source. For this local run only, I temporarily applied those two workarounds, built and ran the focused test, then restored both files. Neither workaround is included in this PR.
  • python3 tools/check_conventions.py --base upstream/main and git diff --check passed.
  • No GT7 title run or GPU validation was performed.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw; no silent stubs added
  • No notes, investigation files or images added
  • No third-party code added
  • Generic behavior, not specific to one title
  • Depends on: #6616
  • Unblocks: PPSA01317 #6350
  • GPUs tested: n/a (focused event-only regression; no GPU test)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4894440938 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6963). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T21:24:04Z. --- ### What - Track whether a queue-0 guest EOP was actually delivered, then suppress exactly the next synthetic flip EOP. A later flip without a preceding guest EOP still raises its event. - Keep the suppression marker at packet execution time so inline and deferred deliveries follow the same packet order. The focused regression covers guest-EOP then flip, flip then guest-EOP, and the following bare flip. - This addresses the PPSA01317 / GT7 null-dereference report in #6350. The reporter's RADV runtime A/B supports the duplicate-event diagnosis; this PR adds the implementation and focused regression. ### Tested - Linux, GCC 12.2 Release: `agc_driver_tests` built successfully; focused CTest `agc_driver_guest_eop_flip_suppression` passed (1/1). - This host lacks the emulator's required CPU extensions, and GCC 12 needs a `template` keyword in an unrelated current-main source. For this local run only, I temporarily applied those two workarounds, built and ran the focused test, then restored both files. Neither workaround is included in this PR. - `python3 tools/check_conventions.py --base upstream/main` and `git diff --check` passed. - No GT7 title run or GPU validation was performed. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw; no silent stubs added - [x] No notes, investigation files or images added - [x] No third-party code added - [x] Generic behavior, not specific to one title - [x] Depends on: #6616 - [x] Unblocks: PPSA01317 #6350 - [x] GPUs tested: n/a (focused event-only regression; no GPU test) - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-16 21:33:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-16T21:33:59Z.


Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 1341 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 1368 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 1395 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 2434 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 4448 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 4891 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5021 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5115 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 5371 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5404 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
PR 5426 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5431 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 5480 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Submit.cpp
PR 5481 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 5499 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5609 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
PR 5656 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5925 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 6044 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6146 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6169 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6182 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6185 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6186 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6187 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6188 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 6192 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6209 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6218 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6249 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Submit.cpp
PR 6280 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6292 core/libs/prx/libSceAgcDriver/Eq/src/Event.cpp
core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 6300 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6326 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6373 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6412 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6457 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6479 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6481 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6501 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketMemory.cpp
PR 6539 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
PR 6588 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6611 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6615 core/libs/prx/libSceAgcDriver/Eq/src/Event.cpp
core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 6656 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketMemory.cpp
PR 6682 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6683 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6701 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6718 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6730 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6741 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6743 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6747 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6759 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6788 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6794 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 6804 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
PR 6808 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6820 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6856 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6868 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6887 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6905 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6914 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketMemory.cpp
PR 6937 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6941 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
PR 6946 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 6947 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 6948 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketMemory.cpp
PR 6959 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6960 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketMemory.cpp
PR 6965 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6973 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6977 core/libs/prx/libSceAgcDriver/Eq/include/Event.hpp
core/libs/prx/libSceAgcDriver/Eq/src/Event.cpp
PR 6982 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6987 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6989 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6995 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7002 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7008 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Submit.cpp
PR 7048 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7082 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7085 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7201 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7223 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7275 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
PR 7307 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 7310 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7332 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7340 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 7369 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
PR 7395 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7427 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7446 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
PR 7457 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7464 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketMemory.cpp
PR 7505 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7508 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7514 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7570 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7604 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7610 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7615 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7627 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7629 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7642 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 7644 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
PR 7647 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7677 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7683 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 7705 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7800 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7803 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7817 core/libs/prx/libSceAgcDriver/CMakeLists.txt
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6225128757 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6963#issuecomment-6225128757). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-16T21:33:59Z. --- <!-- pr-overlap --> Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap. | Pull request | Shared files not compared | |---|---| | [PR 1341](https://www.github.com/boykopovar/AnyPS5/pull/1341) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 1368](https://www.github.com/boykopovar/AnyPS5/pull/1368) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 1395](https://www.github.com/boykopovar/AnyPS5/pull/1395) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 2434](https://www.github.com/boykopovar/AnyPS5/pull/2434) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 4448](https://www.github.com/boykopovar/AnyPS5/pull/4448) | `core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp` | | [PR 4891](https://www.github.com/boykopovar/AnyPS5/pull/4891) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5021](https://www.github.com/boykopovar/AnyPS5/pull/5021) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5115](https://www.github.com/boykopovar/AnyPS5/pull/5115) | `core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp` | | [PR 5371](https://www.github.com/boykopovar/AnyPS5/pull/5371) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5404](https://www.github.com/boykopovar/AnyPS5/pull/5404) | `core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp` | | [PR 5426](https://www.github.com/boykopovar/AnyPS5/pull/5426) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5431](https://www.github.com/boykopovar/AnyPS5/pull/5431) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp` | | [PR 5480](https://www.github.com/boykopovar/AnyPS5/pull/5480) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Submit.cpp` | | [PR 5481](https://www.github.com/boykopovar/AnyPS5/pull/5481) | `core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp` | | [PR 5499](https://www.github.com/boykopovar/AnyPS5/pull/5499) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5609](https://www.github.com/boykopovar/AnyPS5/pull/5609) | `core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp` | | [PR 5656](https://www.github.com/boykopovar/AnyPS5/pull/5656) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5925](https://www.github.com/boykopovar/AnyPS5/pull/5925) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp` | | [PR 6044](https://www.github.com/boykopovar/AnyPS5/pull/6044) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6146](https://www.github.com/boykopovar/AnyPS5/pull/6146) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6169](https://www.github.com/boykopovar/AnyPS5/pull/6169) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6182](https://www.github.com/boykopovar/AnyPS5/pull/6182) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6185](https://www.github.com/boykopovar/AnyPS5/pull/6185) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6186](https://www.github.com/boykopovar/AnyPS5/pull/6186) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6187](https://www.github.com/boykopovar/AnyPS5/pull/6187) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6188](https://www.github.com/boykopovar/AnyPS5/pull/6188) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp` | | [PR 6192](https://www.github.com/boykopovar/AnyPS5/pull/6192) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6209](https://www.github.com/boykopovar/AnyPS5/pull/6209) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6218](https://www.github.com/boykopovar/AnyPS5/pull/6218) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6249](https://www.github.com/boykopovar/AnyPS5/pull/6249) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Submit.cpp` | | [PR 6280](https://www.github.com/boykopovar/AnyPS5/pull/6280) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6292](https://www.github.com/boykopovar/AnyPS5/pull/6292) | `core/libs/prx/libSceAgcDriver/Eq/src/Event.cpp`<br>`core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp` | | [PR 6300](https://www.github.com/boykopovar/AnyPS5/pull/6300) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6326](https://www.github.com/boykopovar/AnyPS5/pull/6326) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6373](https://www.github.com/boykopovar/AnyPS5/pull/6373) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6412](https://www.github.com/boykopovar/AnyPS5/pull/6412) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6457](https://www.github.com/boykopovar/AnyPS5/pull/6457) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6479](https://www.github.com/boykopovar/AnyPS5/pull/6479) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6481](https://www.github.com/boykopovar/AnyPS5/pull/6481) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6501](https://www.github.com/boykopovar/AnyPS5/pull/6501) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketMemory.cpp` | | [PR 6539](https://www.github.com/boykopovar/AnyPS5/pull/6539) | `core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp` | | [PR 6588](https://www.github.com/boykopovar/AnyPS5/pull/6588) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6611](https://www.github.com/boykopovar/AnyPS5/pull/6611) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6615](https://www.github.com/boykopovar/AnyPS5/pull/6615) | `core/libs/prx/libSceAgcDriver/Eq/src/Event.cpp`<br>`core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp` | | [PR 6656](https://www.github.com/boykopovar/AnyPS5/pull/6656) | `core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketMemory.cpp` | | [PR 6682](https://www.github.com/boykopovar/AnyPS5/pull/6682) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6683](https://www.github.com/boykopovar/AnyPS5/pull/6683) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6701](https://www.github.com/boykopovar/AnyPS5/pull/6701) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6718](https://www.github.com/boykopovar/AnyPS5/pull/6718) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6730](https://www.github.com/boykopovar/AnyPS5/pull/6730) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6741](https://www.github.com/boykopovar/AnyPS5/pull/6741) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6743](https://www.github.com/boykopovar/AnyPS5/pull/6743) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6747](https://www.github.com/boykopovar/AnyPS5/pull/6747) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6759](https://www.github.com/boykopovar/AnyPS5/pull/6759) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6788](https://www.github.com/boykopovar/AnyPS5/pull/6788) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6794](https://www.github.com/boykopovar/AnyPS5/pull/6794) | `core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp` | | [PR 6804](https://www.github.com/boykopovar/AnyPS5/pull/6804) | `core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp` | | [PR 6808](https://www.github.com/boykopovar/AnyPS5/pull/6808) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6820](https://www.github.com/boykopovar/AnyPS5/pull/6820) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6856](https://www.github.com/boykopovar/AnyPS5/pull/6856) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6868](https://www.github.com/boykopovar/AnyPS5/pull/6868) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6887](https://www.github.com/boykopovar/AnyPS5/pull/6887) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6905](https://www.github.com/boykopovar/AnyPS5/pull/6905) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6914](https://www.github.com/boykopovar/AnyPS5/pull/6914) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketMemory.cpp` | | [PR 6937](https://www.github.com/boykopovar/AnyPS5/pull/6937) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6941](https://www.github.com/boykopovar/AnyPS5/pull/6941) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp` | | [PR 6946](https://www.github.com/boykopovar/AnyPS5/pull/6946) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp` | | [PR 6947](https://www.github.com/boykopovar/AnyPS5/pull/6947) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp` | | [PR 6948](https://www.github.com/boykopovar/AnyPS5/pull/6948) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketMemory.cpp` | | [PR 6959](https://www.github.com/boykopovar/AnyPS5/pull/6959) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6960](https://www.github.com/boykopovar/AnyPS5/pull/6960) | `core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketMemory.cpp` | | [PR 6965](https://www.github.com/boykopovar/AnyPS5/pull/6965) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6973](https://www.github.com/boykopovar/AnyPS5/pull/6973) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6977](https://www.github.com/boykopovar/AnyPS5/pull/6977) | `core/libs/prx/libSceAgcDriver/Eq/include/Event.hpp`<br>`core/libs/prx/libSceAgcDriver/Eq/src/Event.cpp` | | [PR 6982](https://www.github.com/boykopovar/AnyPS5/pull/6982) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6987](https://www.github.com/boykopovar/AnyPS5/pull/6987) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6989](https://www.github.com/boykopovar/AnyPS5/pull/6989) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6995](https://www.github.com/boykopovar/AnyPS5/pull/6995) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7002](https://www.github.com/boykopovar/AnyPS5/pull/7002) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7008](https://www.github.com/boykopovar/AnyPS5/pull/7008) | `core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Submit.cpp` | | [PR 7048](https://www.github.com/boykopovar/AnyPS5/pull/7048) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7082](https://www.github.com/boykopovar/AnyPS5/pull/7082) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7085](https://www.github.com/boykopovar/AnyPS5/pull/7085) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7201](https://www.github.com/boykopovar/AnyPS5/pull/7201) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7223](https://www.github.com/boykopovar/AnyPS5/pull/7223) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7275](https://www.github.com/boykopovar/AnyPS5/pull/7275) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp` | | [PR 7307](https://www.github.com/boykopovar/AnyPS5/pull/7307) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp` | | [PR 7310](https://www.github.com/boykopovar/AnyPS5/pull/7310) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7332](https://www.github.com/boykopovar/AnyPS5/pull/7332) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7340](https://www.github.com/boykopovar/AnyPS5/pull/7340) | `core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp` | | [PR 7369](https://www.github.com/boykopovar/AnyPS5/pull/7369) | `core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp` | | [PR 7395](https://www.github.com/boykopovar/AnyPS5/pull/7395) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7427](https://www.github.com/boykopovar/AnyPS5/pull/7427) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7446](https://www.github.com/boykopovar/AnyPS5/pull/7446) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp` | | [PR 7457](https://www.github.com/boykopovar/AnyPS5/pull/7457) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7464](https://www.github.com/boykopovar/AnyPS5/pull/7464) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketMemory.cpp` | | [PR 7505](https://www.github.com/boykopovar/AnyPS5/pull/7505) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7508](https://www.github.com/boykopovar/AnyPS5/pull/7508) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7514](https://www.github.com/boykopovar/AnyPS5/pull/7514) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7570](https://www.github.com/boykopovar/AnyPS5/pull/7570) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7604](https://www.github.com/boykopovar/AnyPS5/pull/7604) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7610](https://www.github.com/boykopovar/AnyPS5/pull/7610) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7615](https://www.github.com/boykopovar/AnyPS5/pull/7615) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7627](https://www.github.com/boykopovar/AnyPS5/pull/7627) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7629](https://www.github.com/boykopovar/AnyPS5/pull/7629) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7642](https://www.github.com/boykopovar/AnyPS5/pull/7642) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp` | | [PR 7644](https://www.github.com/boykopovar/AnyPS5/pull/7644) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp` | | [PR 7647](https://www.github.com/boykopovar/AnyPS5/pull/7647) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7677](https://www.github.com/boykopovar/AnyPS5/pull/7677) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7683](https://www.github.com/boykopovar/AnyPS5/pull/7683) | `core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp` | | [PR 7705](https://www.github.com/boykopovar/AnyPS5/pull/7705) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7800](https://www.github.com/boykopovar/AnyPS5/pull/7800) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7803](https://www.github.com/boykopovar/AnyPS5/pull/7803) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7817](https://www.github.com/boykopovar/AnyPS5/pull/7817) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` |
Lberonio commented 2026-10-17 08:55:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Lberonio on 2026-10-17T08:55:20Z.


Ran this against the GT7 dump (PPSA01317 01.000.001) with your patch applied to our local tree
(34454bd + #6083, --to-intel, RX 9070 XT / RADV, app.elf from the dump). Your diff applied and
built cleanly. Outcome: the title still takes the #6350 fault, and the trace shows which synthetic
flip event remains.

Result

DELIVER #1  site=lib+0x282e13  ctx=0x1000200000    (guest release, commitLabel)
   consumer r14=0x1000200000   ctx=0x1000200000    -> release ok, g_ctx=0
DELIVER #2  site=lib+0x28489d  ctx=0x0             (synthetic flip, deliverFlipEopInterrupt)
   consumer r14=0x0            ctx=0x0             -> SIGSEGV 0x...574e8f2b = guest 0x1F94F2B

One guest EOP delivered, and a synthetic flip EOP still followed it.

Why the one-shot marker misses GT7

GT7's queue-0 submissions pair two flips with one guest EOP:

sub#1  queue=0 flips=0 guestEop=1
sub#4  queue=0 flips=1 guestEop=0
sub#5  queue=0 flips=1 guestEop=0
sub#6  queue=0 flips=0 guestEop=1
sub#9  queue=0 flips=0 guestEop=1
sub#12 queue=0 flips=1 guestEop=0
sub#13 queue=0 flips=1 guestEop=0
...

(submit-time instrumentation of the same run, 598 submissions). The single pending marker is
consumed by the first flip of the pair; the second flip has nothing pending and delivers. That is 2
events for 1 armed context, exactly as in the unpatched run.

What did hold

Treating guest self-signaling as a per-queue mode — once that queue's guest release has been seen,
suppress the synthetic flip EOP on that queue — ran without the fault:

  • gdb, 80 s: deliveries=353 consumer=353 nulls=0
  • plain run, 45 s: no SIGSEGV; next failure is unrelated (AGC graphics: unsupported primitive type 21, and sceSslEnableVerifyOption not implemented in another run).

Same-session A/B, for the record:

build outcome
unpatched SIGSEGV, ~10-18 s
PR #6963 predicate SIGSEGV, 18 s, guest 0x1F94F2B
per-queue mode no SIGSEGV in 45 s; stops on an unrelated unimplemented path

On the test you want

The currency of the "self-signals once, then flips" title is the sequence you named (guest EOP, then
a later bare flip). I can't exercise that — GT7 is the only title data I have, and it is
guest-EOP-then-two-flips. The three-step case for GT7 is: guest EOP -> flip -> flip, where the
one-shot predicate delivers 2 events and the per-queue mode delivers 1.

Happy to push the mode as a patch on top of this PR (or hand you the diff) if you want to compare
the two, and to run any additional sequence you want replayed against the driver.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6231996930 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6963#issuecomment-6231996930). Originally posted by [Lberonio](https://github.com/Lberonio) on 2026-10-17T08:55:20Z. --- Ran this against the GT7 dump (PPSA01317 01.000.001) with your patch applied to our local tree (`34454bd` + #6083, `--to-intel`, RX 9070 XT / RADV, app.elf from the dump). Your diff applied and built cleanly. Outcome: the title still takes the #6350 fault, and the trace shows which synthetic flip event remains. ## Result ``` DELIVER #1 site=lib+0x282e13 ctx=0x1000200000 (guest release, commitLabel) consumer r14=0x1000200000 ctx=0x1000200000 -> release ok, g_ctx=0 DELIVER #2 site=lib+0x28489d ctx=0x0 (synthetic flip, deliverFlipEopInterrupt) consumer r14=0x0 ctx=0x0 -> SIGSEGV 0x...574e8f2b = guest 0x1F94F2B ``` One guest EOP delivered, and a synthetic flip EOP still followed it. ## Why the one-shot marker misses GT7 GT7's queue-0 submissions pair **two** flips with **one** guest EOP: ``` sub#1 queue=0 flips=0 guestEop=1 sub#4 queue=0 flips=1 guestEop=0 sub#5 queue=0 flips=1 guestEop=0 sub#6 queue=0 flips=0 guestEop=1 sub#9 queue=0 flips=0 guestEop=1 sub#12 queue=0 flips=1 guestEop=0 sub#13 queue=0 flips=1 guestEop=0 ... ``` (submit-time instrumentation of the same run, 598 submissions). The single pending marker is consumed by the first flip of the pair; the second flip has nothing pending and delivers. That is 2 events for 1 armed context, exactly as in the unpatched run. ## What did hold Treating guest self-signaling as a per-queue mode — once that queue's guest release has been seen, suppress the synthetic flip EOP on that queue — ran without the fault: - gdb, 80 s: `deliveries=353 consumer=353 nulls=0` - plain run, 45 s: no SIGSEGV; next failure is unrelated (`AGC graphics: unsupported primitive type 21`, and `sceSslEnableVerifyOption not implemented` in another run). Same-session A/B, for the record: | build | outcome | | --- | --- | | unpatched | SIGSEGV, ~10-18 s | | PR #6963 predicate | SIGSEGV, 18 s, guest 0x1F94F2B | | per-queue mode | no SIGSEGV in 45 s; stops on an unrelated unimplemented path | ## On the test you want The currency of the "self-signals once, then flips" title is the sequence you named (guest EOP, then a later bare flip). I can't exercise that — GT7 is the only title data I have, and it is guest-EOP-then-two-flips. The three-step case for GT7 is: guest EOP -> flip -> flip, where the one-shot predicate delivers 2 events and the per-queue mode delivers 1. Happy to push the mode as a patch on top of this PR (or hand you the diff) if you want to compare the two, and to run any additional sequence you want replayed against the driver.
Rengundom commented 2026-10-17 09:52:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Rengundom on 2026-10-17T09:52:13Z.


Tested this branch (with #6616) on My First Gran Turismo (PPSA24156), Windows 11 Pro 26H2 (build 26300.9550), NVIDIA GeForce RTX 3080, driver 616.92 (Game Ready): it still stops during boot, within the first 10 s.

FATAL: unhandled exception 0xc0000005 on thread 'PGL Event'
  rip app.exe+0x1e60f6b
  read of 0x0000000000000048

The title's PGL Event thread waits on the equeue that holds its graphics end-of-pipe registration. On each graphics event of type 0 or 1 it takes and clears an object pointer it stores before each RELEASE_MEM with INT_SEL, then reads +0x48 of it. With this branch, a flip's event still arrives on at least one frame where no stored object is waiting, so the pointer is null.

The same build with a different rule boots past this point. In that build, a registration whose queue has ever submitted a RELEASE_MEM with INT_SEL never gets the flip's event; queues that never request release interrupts (Minecraft, PPSA17221) still do. I can share that change if it is useful for comparison.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6232495905 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6963#issuecomment-6232495905). Originally posted by [Rengundom](https://github.com/Rengundom) on 2026-10-17T09:52:13Z. --- Tested this branch (with #6616) on My First Gran Turismo (PPSA24156), Windows 11 Pro 26H2 (build 26300.9550), NVIDIA GeForce RTX 3080, driver 616.92 (Game Ready): it still stops during boot, within the first 10 s. ``` FATAL: unhandled exception 0xc0000005 on thread 'PGL Event' rip app.exe+0x1e60f6b read of 0x0000000000000048 ``` The title's `PGL Event` thread waits on the equeue that holds its graphics end-of-pipe registration. On each graphics event of type 0 or 1 it takes and clears an object pointer it stores before each `RELEASE_MEM` with `INT_SEL`, then reads `+0x48` of it. With this branch, a flip's event still arrives on at least one frame where no stored object is waiting, so the pointer is null. The same build with a different rule boots past this point. In that build, a registration whose queue has ever submitted a `RELEASE_MEM` with `INT_SEL` never gets the flip's event; queues that never request release interrupts (Minecraft, PPSA17221) still do. I can share that change if it is useful for comparison.
keravyn-ops commented 2026-10-17 09:59:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by keravyn-ops on 2026-10-17T09:59:28Z.


AMD / Windows run of this PR at 088001427: Radeon 780M (RDNA 3, 0x15bf), AMD driver 25.10.20.01 (32.0.21020.1007), Windows 11 Home 10.0.26100, WinLibs GCC 15.2.0 r7, Release.

Every ctest entry built from the test targets this PR changes passes (5):

  • agc_driver_readonly_resummarize (0.07 s): 295: Read-only resummarize submission passed
  • agc_driver_guest_eop_flip_suppression (0.05 s): 296: AGC EOP interrupt suppression tests passed
  • agc_driver (4.05 s): 308: AGC driver submit tests passed
  • agc_driver_depth_fast_clear_submit (0.40 s): 367: depth fast clear submit tests passed
  • agc_driver_layered_volume_submit (0.41 s): 526: layered volume draws through the driver passed

AI-assisted: yes (runs made on the device above).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6232562091 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6963#issuecomment-6232562091). Originally posted by [keravyn-ops](https://github.com/keravyn-ops) on 2026-10-17T09:59:28Z. --- AMD / Windows run of this PR at 088001427: Radeon 780M (RDNA 3, 0x15bf), AMD driver 25.10.20.01 (32.0.21020.1007), Windows 11 Home 10.0.26100, WinLibs GCC 15.2.0 r7, Release. Every ctest entry built from the test targets this PR changes passes (5): - `agc_driver_readonly_resummarize` (0.07 s): `295: Read-only resummarize submission passed` - `agc_driver_guest_eop_flip_suppression` (0.05 s): `296: AGC EOP interrupt suppression tests passed` - `agc_driver` (4.05 s): `308: AGC driver submit tests passed` - `agc_driver_depth_fast_clear_submit` (0.40 s): `367: depth fast clear submit tests passed` - `agc_driver_layered_volume_submit` (0.41 s): `526: layered volume draws through the driver passed` AI-assisted: yes (runs made on the device above).
Lberonio commented 2026-10-17 10:05:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Lberonio on 2026-10-17T10:05:56Z.


Two more data points, from the title side.

@keravyn-ops' run is test-suite-only (no title boot), and the test that covers this is the one whose
expectation the titles contradict — see the regression-test note below.

@Rengundom's rule ("a registration whose queue has ever submitted a RELEASE_MEM with INT_SEL
never gets the flip's event") reproduces and fixes it here too. I applied it on top of this branch and
ran GT7.

Branch as it stands (GT7 PPSA01317 01.000.001, Linux/RADV, --to-intel)

DELIVER #1  site=lib+0x282e13  ctx=0x1000200000   (guest release)   -> release ok, g_ctx=0
DELIVER #2  site=lib+0x28489d  ctx=0x0            (synthetic flip)  -> consumer r14=0 -> SIGSEGV

GT7's queue-0 submissions pair two flips with one guest release:

sub#1  queue=0 flips=0 guestEop=1
sub#4  queue=0 flips=1 guestEop=0
sub#5  queue=0 flips=1 guestEop=0
sub#6  queue=0 flips=0 guestEop=1
...   (598 instrumented submissions, same pattern throughout)

The one pending marker is consumed by the first flip of the pair; the second flip has nothing pending
and delivers. Two events for one armed context, same as unpatched.

With Rengundom's rule

DELIVER #1..8  site=lib+0x28388a  ctx=0x1000200000, 0x1000800000, ...
AFTER deliveries=118 consumer=118 nulls=0

No SIGSEGV. A plain run stays up 41 s and then stops on an unrelated path
(AGC graphics: unsupported primitive type 21). A/B in the same session, same mount:

build outcome
unpatched SIGSEGV, ~10-18 s
branch as-is SIGSEGV, 18 s, guest 0x1F94F2B
branch + per-queue latch no SIGSEGV, 41 s, then unrelated unsupported primitive type 21

The change I tested, on top of this branch:

 Execution/include/Driver/Driver.hpp
-    std::atomic<bool> guestEopBeforeNextFlip{false};
+    std::mutex eopSelfSignalMutex;
+    std::unordered_set<std::uint32_t> eopSelfSignalQueues;

 Execution/src/Driver/Packets/PacketExecution.cpp
 void Driver::deliverGuestEopInterrupt(std::uint32_t queue) {
-    if (AgcDriverDeliverEopInterrupt(queue) && queue == 0) guestEopBeforeNextFlip.store(true, std::memory_order_release);
+    if (!AgcDriverDeliverEopInterrupt(queue)) return;
+    std::lock_guard<std::mutex> lock(eopSelfSignalMutex);
+    eopSelfSignalQueues.insert(queue);
 }

 void Driver::deliverFlipEopInterrupt(std::uint32_t queue) {
-    if (queue == 0 && guestEopBeforeNextFlip.exchange(false, std::memory_order_acq_rel)) return;
+    {
+        std::lock_guard<std::mutex> lock(eopSelfSignalMutex);
+        if (eopSelfSignalQueues.count(queue) != 0) return;
+    }
     AgcDriverDeliverEopInterrupt(queue);
 }

(<unordered_set> and <mutex> are already included. I used a set instead of an array because queue
ids reach 80/81 on this title and I did not find a hard bound on them.)

The regression test contradicts the titles

With the latch applied, agc_driver_guest_eop_flip_suppression fails at

check(owner->GetTriggeredEvents(events.data(), 2) == 1 && events[0].data == 1,
      "a bare flip after the one-shot suppression did not raise its event");   // tests/Submit.cpp:231

That assertion says a queue which has already delivered its own EOP must still get a later synthetic
flip event. That event is exactly what kills the titles: GT7 and Rengundom's PPSA24156 arm one object
before each RELEASE_MEM/INT_SEL and take-and-clear it on every graphics event of type 0/1, so any
event with nothing armed derefs null. For a queue that asks for release interrupts, the event count
has to match the release count — the synthetic flip EOP is the extra one.

So this is not a silent behavior change; it is the change the titles need, and the test expectation
should invert (guest EOP, flip, flip -> one event total, not two). The "self-signals once, then relies
on flips forever" title the current assertion guards for is hypothetical: none of GT7, PPSA24156 or
the flip-only titles we have (Minecraft PPSA17221) behaves that way.

The latch is a queue-lifetime mode. If you would rather not latch for the queue's lifetime, a
frame-scoped variant may be possible — GT7's two flips look like they belong to one frame — but I
have not tested it, and I do not have frame-boundary evidence to back it.

@MarcZX100 — I can push the latch as a commit on this branch, or open it separately if you would
rather keep #6963's one-shot form for the record, and update the test to the flip/flip sequence.
Say which base you want and I will send it.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6232625646 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6963#issuecomment-6232625646). Originally posted by [Lberonio](https://github.com/Lberonio) on 2026-10-17T10:05:56Z. --- Two more data points, from the title side. @keravyn-ops' run is test-suite-only (no title boot), and the test that covers this is the one whose expectation the titles contradict — see the regression-test note below. @Rengundom's rule ("a registration whose queue has ever submitted a `RELEASE_MEM` with `INT_SEL` never gets the flip's event") reproduces and fixes it here too. I applied it on top of this branch and ran GT7. ## Branch as it stands (GT7 PPSA01317 01.000.001, Linux/RADV, `--to-intel`) ``` DELIVER #1 site=lib+0x282e13 ctx=0x1000200000 (guest release) -> release ok, g_ctx=0 DELIVER #2 site=lib+0x28489d ctx=0x0 (synthetic flip) -> consumer r14=0 -> SIGSEGV ``` GT7's queue-0 submissions pair two flips with one guest release: ``` sub#1 queue=0 flips=0 guestEop=1 sub#4 queue=0 flips=1 guestEop=0 sub#5 queue=0 flips=1 guestEop=0 sub#6 queue=0 flips=0 guestEop=1 ... (598 instrumented submissions, same pattern throughout) ``` The one pending marker is consumed by the first flip of the pair; the second flip has nothing pending and delivers. Two events for one armed context, same as unpatched. ## With Rengundom's rule ``` DELIVER #1..8 site=lib+0x28388a ctx=0x1000200000, 0x1000800000, ... AFTER deliveries=118 consumer=118 nulls=0 ``` No SIGSEGV. A plain run stays up 41 s and then stops on an unrelated path (`AGC graphics: unsupported primitive type 21`). A/B in the same session, same mount: | build | outcome | | --- | --- | | unpatched | SIGSEGV, ~10-18 s | | branch as-is | SIGSEGV, 18 s, guest `0x1F94F2B` | | branch + per-queue latch | no SIGSEGV, 41 s, then unrelated `unsupported primitive type 21` | The change I tested, on top of this branch: ```diff Execution/include/Driver/Driver.hpp - std::atomic<bool> guestEopBeforeNextFlip{false}; + std::mutex eopSelfSignalMutex; + std::unordered_set<std::uint32_t> eopSelfSignalQueues; Execution/src/Driver/Packets/PacketExecution.cpp void Driver::deliverGuestEopInterrupt(std::uint32_t queue) { - if (AgcDriverDeliverEopInterrupt(queue) && queue == 0) guestEopBeforeNextFlip.store(true, std::memory_order_release); + if (!AgcDriverDeliverEopInterrupt(queue)) return; + std::lock_guard<std::mutex> lock(eopSelfSignalMutex); + eopSelfSignalQueues.insert(queue); } void Driver::deliverFlipEopInterrupt(std::uint32_t queue) { - if (queue == 0 && guestEopBeforeNextFlip.exchange(false, std::memory_order_acq_rel)) return; + { + std::lock_guard<std::mutex> lock(eopSelfSignalMutex); + if (eopSelfSignalQueues.count(queue) != 0) return; + } AgcDriverDeliverEopInterrupt(queue); } ``` (`<unordered_set>` and `<mutex>` are already included. I used a set instead of an array because queue ids reach 80/81 on this title and I did not find a hard bound on them.) ## The regression test contradicts the titles With the latch applied, `agc_driver_guest_eop_flip_suppression` fails at ```cpp check(owner->GetTriggeredEvents(events.data(), 2) == 1 && events[0].data == 1, "a bare flip after the one-shot suppression did not raise its event"); // tests/Submit.cpp:231 ``` That assertion says a queue which has already delivered its own EOP must still get a later synthetic flip event. That event is exactly what kills the titles: GT7 and Rengundom's PPSA24156 arm one object before each `RELEASE_MEM`/`INT_SEL` and take-and-clear it on every graphics event of type 0/1, so any event with nothing armed derefs null. For a queue that asks for release interrupts, the event count has to match the release count — the synthetic flip EOP is the extra one. So this is not a silent behavior change; it is the change the titles need, and the test expectation should invert (guest EOP, flip, flip -> one event total, not two). The "self-signals once, then relies on flips forever" title the current assertion guards for is hypothetical: none of GT7, PPSA24156 or the flip-only titles we have (Minecraft PPSA17221) behaves that way. The latch is a queue-lifetime mode. If you would rather not latch for the queue's lifetime, a frame-scoped variant may be possible — GT7's two flips look like they belong to one frame — but I have not tested it, and I do not have frame-boundary evidence to back it. @MarcZX100 — I can push the latch as a commit on this branch, or open it separately if you would rather keep #6963's one-shot form for the record, and update the test to the flip/flip sequence. Say which base you want and I will send it.
keravyn-ops commented 2026-10-17 10:17:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by keravyn-ops on 2026-10-17T10:17:07Z.


Right, @Lberonio — that run is the test suite only, no title boot. It shows the changed tests build and run on AMD/Windows, not that their expectation matches GT7 or My First Gran Turismo; please don't read it as evidence for the current flip-event rule.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6232721722 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6963#issuecomment-6232721722). Originally posted by [keravyn-ops](https://github.com/keravyn-ops) on 2026-10-17T10:17:07Z. --- Right, @Lberonio — that run is the test suite only, no title boot. It shows the changed tests build and run on AMD/Windows, not that their expectation matches GT7 or My First Gran Turismo; please don't read it as evidence for the current flip-event rule.
Lberonio commented 2026-10-17 10:20:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Lberonio on 2026-10-17T10:20:53Z.


A correction to my offer above, after checking what updating the test actually takes.

guestEopBeforeNextFlip is one-shot, so tests/Submit.cpp can assert both sides in one run: the
first flip after a guest EOP is suppressed (line 247), the next bare flip delivers (lines 232/250).
Under a per-queue latch the second half is unreachable in this test. The graphics registration is on
queue 0 (sceAgcDriverAddEqEvent(eq, 0, &graphicsTag)), the flips go to queue 0, and the guest EOPs at
lines 200/207/256 are delivered on queue 0 — so queue 0 latches at the first of them and every later
flip in the file is suppressed. With the latch applied the test fails at line 232, as expected.

There is no way around it with another queue either: flips are queue-0-only
(Submission.cpp:241, require(submission.queue == 0, "EOP flips on async queues are not implemented")),
so a flip-only queue cannot be built in the same driver instance.

So the change cannot just invert the assertions. The flip-synthesis coverage has to move to its own
executable that never delivers a guest EOP — register on queue 0, submit bare flips, assert their
events, exit. That preserves coverage of the path the latch disables, while Submit.cpp keeps the
self-signaling half. Worth doing regardless of which rule you take: Submit.cpp is currently the only
test in the tree that asserts flip EOP events at all, and only after a guest EOP.

If you want the latch, I will send it with that split — the runtime change stays exactly as posted
above, the extra is test restructuring.

@keravyn-ops agreed, that is how I read it too — build coverage on AMD/Windows, not title behavior.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6232752720 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6963#issuecomment-6232752720). Originally posted by [Lberonio](https://github.com/Lberonio) on 2026-10-17T10:20:53Z. --- A correction to my offer above, after checking what updating the test actually takes. `guestEopBeforeNextFlip` is one-shot, so `tests/Submit.cpp` can assert both sides in one run: the first flip after a guest EOP is suppressed (line 247), the next bare flip delivers (lines 232/250). Under a per-queue latch the second half is unreachable in this test. The graphics registration is on queue 0 (`sceAgcDriverAddEqEvent(eq, 0, &graphicsTag)`), the flips go to queue 0, and the guest EOPs at lines 200/207/256 are delivered on queue 0 — so queue 0 latches at the first of them and every later flip in the file is suppressed. With the latch applied the test fails at line 232, as expected. There is no way around it with another queue either: flips are queue-0-only (`Submission.cpp:241`, `require(submission.queue == 0, "EOP flips on async queues are not implemented")`), so a flip-only queue cannot be built in the same driver instance. So the change cannot just invert the assertions. The flip-synthesis coverage has to move to its own executable that never delivers a guest EOP — register on queue 0, submit bare flips, assert their events, exit. That preserves coverage of the path the latch disables, while `Submit.cpp` keeps the self-signaling half. Worth doing regardless of which rule you take: `Submit.cpp` is currently the only test in the tree that asserts flip EOP events at all, and only after a guest EOP. If you want the latch, I will send it with that split — the runtime change stays exactly as posted above, the extra is test restructuring. @keravyn-ops agreed, that is how I read it too — build coverage on AMD/Windows, not title behavior.
Rengundom commented 2026-10-17 10:42:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Rengundom on 2026-10-17T10:42:39Z.


Thanks @lberonio, that matches what I see on PPSA24156, and GT7's flip/flip/release pattern explains why the one-shot form isn't enough.

I'm happy for the latch to land on this branch rather than as a separate PR from me. For the test, this is the sequence I used in testEndOfPipeInterrupts (tests/Submit.cpp), in case it's useful:

  1. A flip on a queue that has never submitted RELEASE_MEM with INT_SEL raises one graphics event (data == 1), which then clears. This is the Minecraft (PPSA17221) case.
  2. Two releases with INT_SEL raise one event with data == 2, as before.
  3. A second flip on that queue is handed to its output and raises no event.

I also changed the libSceAgcDriver debt entry. It now says it isn't known what the console does for a queue that mixes flip-driven and release-driven events. I can post either diff here.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6232949869 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6963#issuecomment-6232949869). Originally posted by [Rengundom](https://github.com/Rengundom) on 2026-10-17T10:42:39Z. --- Thanks @lberonio, that matches what I see on PPSA24156, and GT7's flip/flip/release pattern explains why the one-shot form isn't enough. I'm happy for the latch to land on this branch rather than as a separate PR from me. For the test, this is the sequence I used in `testEndOfPipeInterrupts` (`tests/Submit.cpp`), in case it's useful: 1. A flip on a queue that has never submitted `RELEASE_MEM` with `INT_SEL` raises one graphics event (`data == 1`), which then clears. This is the Minecraft (PPSA17221) case. 2. Two releases with `INT_SEL` raise one event with `data == 2`, as before. 3. A second flip on that queue is handed to its output and raises no event. I also changed the libSceAgcDriver debt entry. It now says it isn't known what the console does for a queue that mixes flip-driven and release-driven events. I can post either diff here.
Lberonio commented 2026-10-17 10:48:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Lberonio on 2026-10-17T10:48:43Z.


Ran your sequence against the latch on this branch — it passes:

$ agc_driver_tests --eop-interrupts
AGC EOP interrupt suppression tests passed

The ordering is what makes it work: the fresh-queue flip has to come before the first RELEASE_MEM
with INT_SEL on queue 0, since the latch is set by the first delivery. That is simpler than the
separate-executable split I suggested above — no new target needed, testEndOfPipeInterrupts just
starts with the flip (I moved the Output/flipPacket block above the interrupt submits).

One payload changes that you may not have hit: the flip-before-EOP case goes from data == 2 to
data == 1, because only the release triggers now — the flip used to add a second trigger to the
same coalesced event. The rest of the flipped-side assertions are simply == 0.

If you already have the tests/Submit.cpp diff and the libSceAgcDriver.md debt entry written, post
them and I will build on those rather than duplicate them; otherwise I can post both (I have the test
diff ready, the debt wording is yours).

Still waiting on Marc for which base to put the latch on.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6233005450 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6963#issuecomment-6233005450). Originally posted by [Lberonio](https://github.com/Lberonio) on 2026-10-17T10:48:43Z. --- Ran your sequence against the latch on this branch — it passes: ``` $ agc_driver_tests --eop-interrupts AGC EOP interrupt suppression tests passed ``` The ordering is what makes it work: the fresh-queue flip has to come before the first `RELEASE_MEM` with `INT_SEL` on queue 0, since the latch is set by the first delivery. That is simpler than the separate-executable split I suggested above — no new target needed, `testEndOfPipeInterrupts` just starts with the flip (I moved the `Output`/`flipPacket` block above the interrupt submits). One payload changes that you may not have hit: the flip-before-EOP case goes from `data == 2` to `data == 1`, because only the release triggers now — the flip used to add a second trigger to the same coalesced event. The rest of the flipped-side assertions are simply `== 0`. If you already have the `tests/Submit.cpp` diff and the `libSceAgcDriver.md` debt entry written, post them and I will build on those rather than duplicate them; otherwise I can post both (I have the test diff ready, the debt wording is yours). Still waiting on Marc for which base to put the latch on.
Rengundom commented 2026-10-17 11:25:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Rengundom on 2026-10-17T11:25:49Z.


Thanks. Your test sequence is the same as mine (flip on the fresh queue first, then the releases, then a second flip expecting nothing), so please go ahead with your diff rather than mine.

For the debt entry: in docs/dev/debt/libSceAgcDriver.md, the item Flip packets raise the graphics end-of-pipe event currently ends with:

Whether the console raises the event from the flip itself or from an interrupt its flip sequence contains is not measured; a title that waits only on release interrupts sees one extra event per flip, with data counting it.

I replaced that with:

Whether the console raises the event from the flip itself or from an interrupt its flip sequence contains is not measured. A registration whose queue has submitted a RELEASE_MEM with INT_SEL no longer gets the flip's event, because a title that waits on release interrupts takes each event as one finished release: My First Gran Turismo (PPSA24156) takes and clears an object it stored before each such release on every graphics event of type 0 or 1, and read a null pointer on the extra one. Which of the two the console does for a title that mixes both is unknown.

The rest of the item is unchanged. Adjust it to whichever form of the latch lands.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6233329191 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6963#issuecomment-6233329191). Originally posted by [Rengundom](https://github.com/Rengundom) on 2026-10-17T11:25:49Z. --- Thanks. Your test sequence is the same as mine (flip on the fresh queue first, then the releases, then a second flip expecting nothing), so please go ahead with your diff rather than mine. For the debt entry: in `docs/dev/debt/libSceAgcDriver.md`, the item **Flip packets raise the graphics end-of-pipe event** currently ends with: > Whether the console raises the event from the flip itself or from an interrupt its flip sequence contains is not measured; a title that waits only on release interrupts sees one extra event per flip, with `data` counting it. I replaced that with: > Whether the console raises the event from the flip itself or from an interrupt its flip sequence contains is not measured. A registration whose queue has submitted a `RELEASE_MEM` with `INT_SEL` no longer gets the flip's event, because a title that waits on release interrupts takes each event as one finished release: My First Gran Turismo (PPSA24156) takes and clears an object it stored before each such release on every graphics event of type 0 or 1, and read a null pointer on the extra one. Which of the two the console does for a title that mixes both is unknown. The rest of the item is unchanged. Adjust it to whichever form of the latch lands.
Lberonio commented 2026-10-17 11:33:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Lberonio on 2026-10-17T11:33:16Z.


Debt wording taken, and the package verified against your branch head (0880014), not against my
older local base — it applies clean:

 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp |  3 +-
 .../Execution/src/Driver/Packets/PacketExecution.cpp              |  9 +++-
 core/libs/prx/libSceAgcDriver/tests/Submit.cpp                    | 48 +++++----
 docs/dev/debt/libSceAgcDriver.md                                  |  2 +-
 4 files changed, 37 insertions(+), 25 deletions(-)
  • runtime: the per-queue latch from above.
  • test: your sequence — flip on the fresh queue, then the releases, then a flip expecting nothing.
    agc_driver_tests --eop-interrupts passes with it.
  • debt: your sentence, with Gran Turismo 7 (PPSA01317) added beside PPSA24156, since our crash is the
    same shape: the flip event that follows the marker arrives with a null context.
diff --git a/core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp b/core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
index ca49cc3..56cd759 100644
--- a/core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
+++ b/core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
@@ -330,7 +330,8 @@ private:
     std::shared_ptr<FrameTiming> pendingFrameTiming;
 
     std::atomic<std::uint64_t> flipsCounted{0};
-    std::atomic<bool> guestEopBeforeNextFlip{false};
+    std::mutex eopSelfSignalMutex;
+    std::unordered_set<std::uint32_t> eopSelfSignalQueues;
     std::atomic<std::uint64_t> flipSerial{0};
     std::atomic<std::uint64_t> flipBatchesUnsignaled{0};
 
diff --git a/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp b/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
index 3442aec..478fc5f 100644
--- a/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
+++ b/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
@@ -43,11 +43,16 @@ bool keepsDrawPipeline(std::span<const std::uint32_t> packet, std::uint32_t head
 }
 
 void Driver::deliverGuestEopInterrupt(std::uint32_t queue) {
-    if (AgcDriverDeliverEopInterrupt(queue) && queue == 0) guestEopBeforeNextFlip.store(true, std::memory_order_release);
+    if (!AgcDriverDeliverEopInterrupt(queue)) return;
+    std::lock_guard<std::mutex> lock(eopSelfSignalMutex);
+    eopSelfSignalQueues.insert(queue);
 }
 
 void Driver::deliverFlipEopInterrupt(std::uint32_t queue) {
-    if (queue == 0 && guestEopBeforeNextFlip.exchange(false, std::memory_order_acq_rel)) return;
+    {
+        std::lock_guard<std::mutex> lock(eopSelfSignalMutex);
+        if (eopSelfSignalQueues.count(queue) != 0) return;
+    }
     AgcDriverDeliverEopInterrupt(queue);
 }
 
diff --git a/core/libs/prx/libSceAgcDriver/tests/Submit.cpp b/core/libs/prx/libSceAgcDriver/tests/Submit.cpp
index ab9800c..b3a557b 100644
--- a/core/libs/prx/libSceAgcDriver/tests/Submit.cpp
+++ b/core/libs/prx/libSceAgcDriver/tests/Submit.cpp
@@ -195,11 +195,27 @@ void testEndOfPipeInterrupts() {
     check(sceAgcDriverAddEqEvent(eq, 0, &graphicsTag) == 0, "graphics event registration failed");
     check(sceAgcDriverAddEqEvent(eq, 0x20, &computeTag) == 0, "compute event registration failed");
     expectFailure([] { sceAgcDriverAddEqEvent(0, 0, nullptr); });
+    struct Output final : AgcDriver::IVideoOutput, AgcDriver::IFlipRequest, std::enable_shared_from_this<Output> {
+        std::atomic<int> ready{0};
+        std::shared_ptr<AgcDriver::IFlipRequest> Reserve(const AgcDriver::FlipInfo&) override { return shared_from_this(); }
+        void GpuReady(const std::shared_ptr<AgcDriver::FrameTiming>&) override { ready.fetch_add(1); }
+        void Fail(std::exception_ptr error) noexcept override { if (!error) std::terminate(); }
+    };
+    const auto output = std::make_shared<Output>();
+    AgcDriverRegisterVideoOutput_nid_postfix(7, output);
+    std::array<std::uint32_t, 6> flip{AgcDriver::FlipPacketHeader, 7, 0xfffffffeu, 1, 0, 0};
+    Packet flipPacket{flip.data(), static_cast<std::uint32_t>(flip.size()), 0, {}};
+    std::array<KernelEvent, 2> events{};
+    // A flip on a queue that has never requested a release interrupt still raises the interrupt.
+    check(sceAgcDriverSubmitDcb(&flipPacket) == 0, "flip-only queue submit failed");
+    AgcDriverWaitIdle_nid_postfix();
+    check(output->ready.load() == 1, "flip-only queue flip was not handed to its output");
+    check(owner->GetTriggeredEvents(events.data(), 2) == 1 && events[0].udata == &graphicsTag && events[0].data == 1 && sceAgcDriverGetEqEventType(events.data()) == 0, "a flip on a queue that never requested a release interrupt did not raise its event");
+    check(owner->GetTriggeredEvents(events.data(), 2) == 0, "flip-only queue event was not cleared");
     std::array<std::uint32_t, 8> words{0xc0064900, 0, 1u << 24u, 0, 0, 0, 0, 0};
     Packet packet{words.data(), static_cast<std::uint32_t>(words.size()), 0, {}};
     check(sceAgcDriverSubmitDcb(&packet) == 0 && sceAgcDriverSubmitDcb(&packet) == 0, "interrupt submit failed");
     AgcDriverWaitIdle_nid_postfix();
-    std::array<KernelEvent, 2> events{};
     check(owner->GetTriggeredEvents(events.data(), 2) == 1, "graphics end-of-pipe interrupt was not delivered to its queue only");
     check(events[0].filter == -14 && events[0].udata == &graphicsTag && events[0].data == 2 && sceAgcDriverGetEqEventType(events.data()) == 0, "graphics end-of-pipe event encoding is wrong");
     check(sceAgcDriverGetEqContextId(events.data()) == 0, "graphics end-of-pipe event reports another context");
@@ -212,25 +228,15 @@ void testEndOfPipeInterrupts() {
     check(sceAgcDriverSubmitDcb(&packet) == 0, "plain release submit failed");
     AgcDriverWaitIdle_nid_postfix();
     check(owner->GetTriggeredEvents(events.data(), 2) == 0, "release without INT_SEL raised an interrupt");
-    struct Output final : AgcDriver::IVideoOutput, AgcDriver::IFlipRequest, std::enable_shared_from_this<Output> {
-        std::atomic<int> ready{0};
-        std::shared_ptr<AgcDriver::IFlipRequest> Reserve(const AgcDriver::FlipInfo&) override { return shared_from_this(); }
-        void GpuReady(const std::shared_ptr<AgcDriver::FrameTiming>&) override { ready.fetch_add(1); }
-        void Fail(std::exception_ptr error) noexcept override { if (!error) std::terminate(); }
-    };
-    const auto output = std::make_shared<Output>();
-    AgcDriverRegisterVideoOutput_nid_postfix(7, output);
-    std::array<std::uint32_t, 6> flip{AgcDriver::FlipPacketHeader, 7, 0xfffffffeu, 1, 0, 0};
-    Packet flipPacket{flip.data(), static_cast<std::uint32_t>(flip.size()), 0, {}};
-    check(sceAgcDriverSubmitDcb(&flipPacket) == 0, "flip submit failed");
+    // Once this queue has delivered its own release interrupt, its flips raise nothing.
+    check(sceAgcDriverSubmitDcb(&flipPacket) == 0, "flip after release interrupts submit failed");
     AgcDriverWaitIdle_nid_postfix();
-    check(output->ready.load() == 1, "flip was not handed to its output");
+    check(output->ready.load() == 2, "flip after release interrupts was not handed to its output");
     check(owner->GetTriggeredEvents(events.data(), 2) == 0, "flip duplicated the preceding guest end-of-pipe event");
-    check(sceAgcDriverSubmitDcb(&flipPacket) == 0, "later bare flip submit failed");
+    check(sceAgcDriverSubmitDcb(&flipPacket) == 0, "second flip after release interrupts submit failed");
     AgcDriverWaitIdle_nid_postfix();
-    check(output->ready.load() == 2, "later bare flip was not handed to its output");
-    check(owner->GetTriggeredEvents(events.data(), 2) == 1 && events[0].udata == &graphicsTag && events[0].data == 1 && sceAgcDriverGetEqEventType(events.data()) == 0, "a bare flip after the one-shot suppression did not raise its event");
-    check(owner->GetTriggeredEvents(events.data(), 2) == 0, "later bare flip event was not cleared");
+    check(output->ready.load() == 3, "second flip after release interrupts was not handed to its output");
+    check(owner->GetTriggeredEvents(events.data(), 2) == 0, "a later bare flip raised an event on a queue that had delivered its own release interrupt");
 
     const std::array<std::uint32_t, 8> guestEop{0xc0064900, 0, 1u << 24u, 0, 0, 0, 0, 0};
     std::vector<std::uint32_t> flipThenGuestEop(flip.begin(), flip.end());
@@ -238,16 +244,16 @@ void testEndOfPipeInterrupts() {
     Packet orderedPacket{const_cast<std::uint32_t*>(flipThenGuestEop.data()), static_cast<std::uint32_t>(flipThenGuestEop.size()), 0, {}};
     check(sceAgcDriverSubmitDcb(&orderedPacket) == 0, "flip-before-EOP submit failed");
     AgcDriverWaitIdle_nid_postfix();
-    check(output->ready.load() == 3, "flip-before-EOP was not handed to its output");
-    check(owner->GetTriggeredEvents(events.data(), 2) == 1 && events[0].udata == &graphicsTag && events[0].data == 2, "flip-before-EOP did not deliver both events in execution order");
+    check(output->ready.load() == 4, "flip-before-EOP was not handed to its output");
+    check(owner->GetTriggeredEvents(events.data(), 2) == 1 && events[0].udata == &graphicsTag && events[0].data == 1, "flip-before-EOP did not deliver only the release event");
     check(owner->GetTriggeredEvents(events.data(), 2) == 0, "flip-before-EOP events were not cleared");
 
     check(sceAgcDriverSubmitDcb(&flipPacket) == 0, "post-EOP flip submit failed");
     AgcDriverWaitIdle_nid_postfix();
-    check(owner->GetTriggeredEvents(events.data(), 2) == 0, "guest EOP suppression was not consumed by exactly one later flip");
+    check(owner->GetTriggeredEvents(events.data(), 2) == 0, "post-EOP flip raised an event on a self-signalling queue");
     check(sceAgcDriverSubmitDcb(&flipPacket) == 0, "second post-EOP bare flip submit failed");
     AgcDriverWaitIdle_nid_postfix();
-    check(owner->GetTriggeredEvents(events.data(), 2) == 1 && events[0].data == 1, "one-shot suppression disabled a later bare flip");
+    check(owner->GetTriggeredEvents(events.data(), 2) == 0, "a later bare flip raised an event on a queue that had delivered its own release interrupt");
     check(owner->GetTriggeredEvents(events.data(), 2) == 0, "second post-EOP flip event was not cleared");
     AgcDriverUnregisterVideoOutput_nid_postfix(7, output);
     alignas(8) static volatile std::uint64_t label = 0;
diff --git a/docs/dev/debt/libSceAgcDriver.md b/docs/dev/debt/libSceAgcDriver.md
index ee8be5c..ec8b06d 100644
--- a/docs/dev/debt/libSceAgcDriver.md
+++ b/docs/dev/debt/libSceAgcDriver.md
@@ -159,6 +159,6 @@
 - [Descriptor pool recycling](../../../core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp) avoids individually freed sets: [RADV 26.2.2](https://gitlab.freedesktop.org/mesa/mesa/-/blob/mesa-26.2.2/src/amd/vulkan/radv_descriptor_pool.c) initializes its free-set heap with 32 bytes beyond the backing allocation. An allocation-only RX 6600 test reproduces acceptance of a 4,128-byte set in a 4,096-byte pool; the path without individual frees rejects it. Pools reset after their last set is released. A cached set can retain unused slots in an exhausted pool until eviction; peak gameplay pool memory remains unmeasured.
 - [16-bit depth with stencil](../../../core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp) (libSceAgcDriver) is stored as `D24_UNORM_S8_UINT`, or `D32_SFLOAT_S8_UINT`, on a device without `D16_UNORM_S8_UINT` as an attachment. Depth comparisons, clears and the depth image see the wider format's precision, so results at the 16-bit quantization boundary can differ from the console; the constant depth bias is scaled by 256 for D24, and a non-zero constant on the D32 float fallback throws. Not measured on console hardware.
 - [Depth surfaces created over storage writes](../../../core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp) (libSceAgcDriver): a depth surface created without HTILE copies its depth plane from the storage image at the plane's address, a pending one first, when that image has the plane's extent, one level, a 2D view or a 2D array view (its layer 0 is copied) and a 16-bit format for a 16-bit plane or a 32-bit format for a 32-bit plane. A multisampled surface, a surface the device stores in another format, a surface with HTILE and a surface without such an image start from `DB_DEPTH_CLEAR`, and the stencil plane from `DB_STENCIL_CLEAR`; CPU writes to the plane's memory are not read. Not measured on the console, where the plane is that memory.
-- [Flip packets raise the graphics end-of-pipe event](../../../core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp) (libSceAgcDriver) - a flip delivers the queue's end-of-pipe event (`sceAgcDriverAddEqEvent`) once the work recorded before it completes, as a `RELEASE_MEM` with `INT_SEL` does. Minecraft (PPSA17221) registers the graphics event, never requests an interrupt in its releases, and waits on the event after every flip while holding its render lock, so without this it never presents a second frame. Whether the console raises the event from the flip itself or from an interrupt its flip sequence contains is not measured; a title that waits only on release interrupts sees one extra event per flip, with `data` counting it.
+- [Flip packets raise the graphics end-of-pipe event](../../../core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp) (libSceAgcDriver) - a flip delivers the queue's end-of-pipe event (`sceAgcDriverAddEqEvent`) once the work recorded before it completes, as a `RELEASE_MEM` with `INT_SEL` does. Minecraft (PPSA17221) registers the graphics event, never requests an interrupt in its releases, and waits on the event after every flip while holding its render lock, so without this it never presents a second frame. Whether the console raises the event from the flip itself or from an interrupt its flip sequence contains is not measured. A registration whose queue has submitted a `RELEASE_MEM` with `INT_SEL` no longer gets the flip's event, because a title that waits on release interrupts takes each event as one finished release: My First Gran Turismo (PPSA24156) takes and clears an object it stored before each such release on every graphics event of type 0 or 1, and read a null pointer on the extra one; Gran Turismo 7 (PPSA01317) faults the same way on the flip event that follows its marker. Which of the two the console does for a title that mixes both is unknown.
 - [Host import windows and budget](../../../core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp) (libSceAgcDriver): a registered range larger than 64 MiB is imported one 64 MiB window at a time for buffer and fill accesses; an access across window edges imports the cells it touches, grown to the union of the range's imports it overlaps. An address-based build (`AcquireRegistered`) imports the range whole and replaces its windows. Live imports stay under a budget: `APS5_HOST_IMPORT_MIB`, else the larger of 6 GiB and half the physical memory, at most the largest host heap less 2 GiB (imports and type-3 mirrors share it; #167's rule). A new import beyond it retires the least recently used imports not used in the last 256 lookups; one that would not fit even then is refused before anything is retired, and imports made when a range is mapped never evict. A refused import is tried again at its next use. The 64 MiB window, the 256-lookup protection and the 2 GiB reserve are choices, not measured.
 - [Registration preparation at submit](../../../core/libs/prx/libSceAgcDriver/Execution/src/Driver/Queues/Submission.cpp) (libSceAgcDriver) - `Driver::Submit` waits for every registration-time shader preparation queued before the call, not only those of the shaders the commands use, so a submission behind a long queue of unrelated preparations waits for all of them on the submitting thread. Waiting there instead of in the queue worker keeps the GPU side of a submission short: a title that sees a submission take seconds treats the GPU as hung (Goat Simulator 3, PPSA04159, then stops submitting and its garbage collector fails a 10 s timeout). On the console shaders are compiled ahead of time, so neither wait exists; how long a title tolerates a slow submit call is not known.

@MarcZX100 this is the whole thing. The runtime change is the only part that needs a decision from
you; the other two files are the test and the debt line. If you would rather I open a PR from a fork
than paste the diff, say so and I will.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6233394183 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6963#issuecomment-6233394183). Originally posted by [Lberonio](https://github.com/Lberonio) on 2026-10-17T11:33:16Z. --- Debt wording taken, and the package verified against your branch head (`0880014`), not against my older local base — it applies clean: ``` core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp | 3 +- .../Execution/src/Driver/Packets/PacketExecution.cpp | 9 +++- core/libs/prx/libSceAgcDriver/tests/Submit.cpp | 48 +++++---- docs/dev/debt/libSceAgcDriver.md | 2 +- 4 files changed, 37 insertions(+), 25 deletions(-) ``` - runtime: the per-queue latch from above. - test: your sequence — flip on the fresh queue, then the releases, then a flip expecting nothing. `agc_driver_tests --eop-interrupts` passes with it. - debt: your sentence, with Gran Turismo 7 (PPSA01317) added beside PPSA24156, since our crash is the same shape: the flip event that follows the marker arrives with a null context. ```diff diff --git a/core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp b/core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp index ca49cc3..56cd759 100644 --- a/core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp +++ b/core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp @@ -330,7 +330,8 @@ private: std::shared_ptr<FrameTiming> pendingFrameTiming; std::atomic<std::uint64_t> flipsCounted{0}; - std::atomic<bool> guestEopBeforeNextFlip{false}; + std::mutex eopSelfSignalMutex; + std::unordered_set<std::uint32_t> eopSelfSignalQueues; std::atomic<std::uint64_t> flipSerial{0}; std::atomic<std::uint64_t> flipBatchesUnsignaled{0}; diff --git a/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp b/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp index 3442aec..478fc5f 100644 --- a/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp +++ b/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp @@ -43,11 +43,16 @@ bool keepsDrawPipeline(std::span<const std::uint32_t> packet, std::uint32_t head } void Driver::deliverGuestEopInterrupt(std::uint32_t queue) { - if (AgcDriverDeliverEopInterrupt(queue) && queue == 0) guestEopBeforeNextFlip.store(true, std::memory_order_release); + if (!AgcDriverDeliverEopInterrupt(queue)) return; + std::lock_guard<std::mutex> lock(eopSelfSignalMutex); + eopSelfSignalQueues.insert(queue); } void Driver::deliverFlipEopInterrupt(std::uint32_t queue) { - if (queue == 0 && guestEopBeforeNextFlip.exchange(false, std::memory_order_acq_rel)) return; + { + std::lock_guard<std::mutex> lock(eopSelfSignalMutex); + if (eopSelfSignalQueues.count(queue) != 0) return; + } AgcDriverDeliverEopInterrupt(queue); } diff --git a/core/libs/prx/libSceAgcDriver/tests/Submit.cpp b/core/libs/prx/libSceAgcDriver/tests/Submit.cpp index ab9800c..b3a557b 100644 --- a/core/libs/prx/libSceAgcDriver/tests/Submit.cpp +++ b/core/libs/prx/libSceAgcDriver/tests/Submit.cpp @@ -195,11 +195,27 @@ void testEndOfPipeInterrupts() { check(sceAgcDriverAddEqEvent(eq, 0, &graphicsTag) == 0, "graphics event registration failed"); check(sceAgcDriverAddEqEvent(eq, 0x20, &computeTag) == 0, "compute event registration failed"); expectFailure([] { sceAgcDriverAddEqEvent(0, 0, nullptr); }); + struct Output final : AgcDriver::IVideoOutput, AgcDriver::IFlipRequest, std::enable_shared_from_this<Output> { + std::atomic<int> ready{0}; + std::shared_ptr<AgcDriver::IFlipRequest> Reserve(const AgcDriver::FlipInfo&) override { return shared_from_this(); } + void GpuReady(const std::shared_ptr<AgcDriver::FrameTiming>&) override { ready.fetch_add(1); } + void Fail(std::exception_ptr error) noexcept override { if (!error) std::terminate(); } + }; + const auto output = std::make_shared<Output>(); + AgcDriverRegisterVideoOutput_nid_postfix(7, output); + std::array<std::uint32_t, 6> flip{AgcDriver::FlipPacketHeader, 7, 0xfffffffeu, 1, 0, 0}; + Packet flipPacket{flip.data(), static_cast<std::uint32_t>(flip.size()), 0, {}}; + std::array<KernelEvent, 2> events{}; + // A flip on a queue that has never requested a release interrupt still raises the interrupt. + check(sceAgcDriverSubmitDcb(&flipPacket) == 0, "flip-only queue submit failed"); + AgcDriverWaitIdle_nid_postfix(); + check(output->ready.load() == 1, "flip-only queue flip was not handed to its output"); + check(owner->GetTriggeredEvents(events.data(), 2) == 1 && events[0].udata == &graphicsTag && events[0].data == 1 && sceAgcDriverGetEqEventType(events.data()) == 0, "a flip on a queue that never requested a release interrupt did not raise its event"); + check(owner->GetTriggeredEvents(events.data(), 2) == 0, "flip-only queue event was not cleared"); std::array<std::uint32_t, 8> words{0xc0064900, 0, 1u << 24u, 0, 0, 0, 0, 0}; Packet packet{words.data(), static_cast<std::uint32_t>(words.size()), 0, {}}; check(sceAgcDriverSubmitDcb(&packet) == 0 && sceAgcDriverSubmitDcb(&packet) == 0, "interrupt submit failed"); AgcDriverWaitIdle_nid_postfix(); - std::array<KernelEvent, 2> events{}; check(owner->GetTriggeredEvents(events.data(), 2) == 1, "graphics end-of-pipe interrupt was not delivered to its queue only"); check(events[0].filter == -14 && events[0].udata == &graphicsTag && events[0].data == 2 && sceAgcDriverGetEqEventType(events.data()) == 0, "graphics end-of-pipe event encoding is wrong"); check(sceAgcDriverGetEqContextId(events.data()) == 0, "graphics end-of-pipe event reports another context"); @@ -212,25 +228,15 @@ void testEndOfPipeInterrupts() { check(sceAgcDriverSubmitDcb(&packet) == 0, "plain release submit failed"); AgcDriverWaitIdle_nid_postfix(); check(owner->GetTriggeredEvents(events.data(), 2) == 0, "release without INT_SEL raised an interrupt"); - struct Output final : AgcDriver::IVideoOutput, AgcDriver::IFlipRequest, std::enable_shared_from_this<Output> { - std::atomic<int> ready{0}; - std::shared_ptr<AgcDriver::IFlipRequest> Reserve(const AgcDriver::FlipInfo&) override { return shared_from_this(); } - void GpuReady(const std::shared_ptr<AgcDriver::FrameTiming>&) override { ready.fetch_add(1); } - void Fail(std::exception_ptr error) noexcept override { if (!error) std::terminate(); } - }; - const auto output = std::make_shared<Output>(); - AgcDriverRegisterVideoOutput_nid_postfix(7, output); - std::array<std::uint32_t, 6> flip{AgcDriver::FlipPacketHeader, 7, 0xfffffffeu, 1, 0, 0}; - Packet flipPacket{flip.data(), static_cast<std::uint32_t>(flip.size()), 0, {}}; - check(sceAgcDriverSubmitDcb(&flipPacket) == 0, "flip submit failed"); + // Once this queue has delivered its own release interrupt, its flips raise nothing. + check(sceAgcDriverSubmitDcb(&flipPacket) == 0, "flip after release interrupts submit failed"); AgcDriverWaitIdle_nid_postfix(); - check(output->ready.load() == 1, "flip was not handed to its output"); + check(output->ready.load() == 2, "flip after release interrupts was not handed to its output"); check(owner->GetTriggeredEvents(events.data(), 2) == 0, "flip duplicated the preceding guest end-of-pipe event"); - check(sceAgcDriverSubmitDcb(&flipPacket) == 0, "later bare flip submit failed"); + check(sceAgcDriverSubmitDcb(&flipPacket) == 0, "second flip after release interrupts submit failed"); AgcDriverWaitIdle_nid_postfix(); - check(output->ready.load() == 2, "later bare flip was not handed to its output"); - check(owner->GetTriggeredEvents(events.data(), 2) == 1 && events[0].udata == &graphicsTag && events[0].data == 1 && sceAgcDriverGetEqEventType(events.data()) == 0, "a bare flip after the one-shot suppression did not raise its event"); - check(owner->GetTriggeredEvents(events.data(), 2) == 0, "later bare flip event was not cleared"); + check(output->ready.load() == 3, "second flip after release interrupts was not handed to its output"); + check(owner->GetTriggeredEvents(events.data(), 2) == 0, "a later bare flip raised an event on a queue that had delivered its own release interrupt"); const std::array<std::uint32_t, 8> guestEop{0xc0064900, 0, 1u << 24u, 0, 0, 0, 0, 0}; std::vector<std::uint32_t> flipThenGuestEop(flip.begin(), flip.end()); @@ -238,16 +244,16 @@ void testEndOfPipeInterrupts() { Packet orderedPacket{const_cast<std::uint32_t*>(flipThenGuestEop.data()), static_cast<std::uint32_t>(flipThenGuestEop.size()), 0, {}}; check(sceAgcDriverSubmitDcb(&orderedPacket) == 0, "flip-before-EOP submit failed"); AgcDriverWaitIdle_nid_postfix(); - check(output->ready.load() == 3, "flip-before-EOP was not handed to its output"); - check(owner->GetTriggeredEvents(events.data(), 2) == 1 && events[0].udata == &graphicsTag && events[0].data == 2, "flip-before-EOP did not deliver both events in execution order"); + check(output->ready.load() == 4, "flip-before-EOP was not handed to its output"); + check(owner->GetTriggeredEvents(events.data(), 2) == 1 && events[0].udata == &graphicsTag && events[0].data == 1, "flip-before-EOP did not deliver only the release event"); check(owner->GetTriggeredEvents(events.data(), 2) == 0, "flip-before-EOP events were not cleared"); check(sceAgcDriverSubmitDcb(&flipPacket) == 0, "post-EOP flip submit failed"); AgcDriverWaitIdle_nid_postfix(); - check(owner->GetTriggeredEvents(events.data(), 2) == 0, "guest EOP suppression was not consumed by exactly one later flip"); + check(owner->GetTriggeredEvents(events.data(), 2) == 0, "post-EOP flip raised an event on a self-signalling queue"); check(sceAgcDriverSubmitDcb(&flipPacket) == 0, "second post-EOP bare flip submit failed"); AgcDriverWaitIdle_nid_postfix(); - check(owner->GetTriggeredEvents(events.data(), 2) == 1 && events[0].data == 1, "one-shot suppression disabled a later bare flip"); + check(owner->GetTriggeredEvents(events.data(), 2) == 0, "a later bare flip raised an event on a queue that had delivered its own release interrupt"); check(owner->GetTriggeredEvents(events.data(), 2) == 0, "second post-EOP flip event was not cleared"); AgcDriverUnregisterVideoOutput_nid_postfix(7, output); alignas(8) static volatile std::uint64_t label = 0; diff --git a/docs/dev/debt/libSceAgcDriver.md b/docs/dev/debt/libSceAgcDriver.md index ee8be5c..ec8b06d 100644 --- a/docs/dev/debt/libSceAgcDriver.md +++ b/docs/dev/debt/libSceAgcDriver.md @@ -159,6 +159,6 @@ - [Descriptor pool recycling](../../../core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp) avoids individually freed sets: [RADV 26.2.2](https://gitlab.freedesktop.org/mesa/mesa/-/blob/mesa-26.2.2/src/amd/vulkan/radv_descriptor_pool.c) initializes its free-set heap with 32 bytes beyond the backing allocation. An allocation-only RX 6600 test reproduces acceptance of a 4,128-byte set in a 4,096-byte pool; the path without individual frees rejects it. Pools reset after their last set is released. A cached set can retain unused slots in an exhausted pool until eviction; peak gameplay pool memory remains unmeasured. - [16-bit depth with stencil](../../../core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp) (libSceAgcDriver) is stored as `D24_UNORM_S8_UINT`, or `D32_SFLOAT_S8_UINT`, on a device without `D16_UNORM_S8_UINT` as an attachment. Depth comparisons, clears and the depth image see the wider format's precision, so results at the 16-bit quantization boundary can differ from the console; the constant depth bias is scaled by 256 for D24, and a non-zero constant on the D32 float fallback throws. Not measured on console hardware. - [Depth surfaces created over storage writes](../../../core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp) (libSceAgcDriver): a depth surface created without HTILE copies its depth plane from the storage image at the plane's address, a pending one first, when that image has the plane's extent, one level, a 2D view or a 2D array view (its layer 0 is copied) and a 16-bit format for a 16-bit plane or a 32-bit format for a 32-bit plane. A multisampled surface, a surface the device stores in another format, a surface with HTILE and a surface without such an image start from `DB_DEPTH_CLEAR`, and the stencil plane from `DB_STENCIL_CLEAR`; CPU writes to the plane's memory are not read. Not measured on the console, where the plane is that memory. -- [Flip packets raise the graphics end-of-pipe event](../../../core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp) (libSceAgcDriver) - a flip delivers the queue's end-of-pipe event (`sceAgcDriverAddEqEvent`) once the work recorded before it completes, as a `RELEASE_MEM` with `INT_SEL` does. Minecraft (PPSA17221) registers the graphics event, never requests an interrupt in its releases, and waits on the event after every flip while holding its render lock, so without this it never presents a second frame. Whether the console raises the event from the flip itself or from an interrupt its flip sequence contains is not measured; a title that waits only on release interrupts sees one extra event per flip, with `data` counting it. +- [Flip packets raise the graphics end-of-pipe event](../../../core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp) (libSceAgcDriver) - a flip delivers the queue's end-of-pipe event (`sceAgcDriverAddEqEvent`) once the work recorded before it completes, as a `RELEASE_MEM` with `INT_SEL` does. Minecraft (PPSA17221) registers the graphics event, never requests an interrupt in its releases, and waits on the event after every flip while holding its render lock, so without this it never presents a second frame. Whether the console raises the event from the flip itself or from an interrupt its flip sequence contains is not measured. A registration whose queue has submitted a `RELEASE_MEM` with `INT_SEL` no longer gets the flip's event, because a title that waits on release interrupts takes each event as one finished release: My First Gran Turismo (PPSA24156) takes and clears an object it stored before each such release on every graphics event of type 0 or 1, and read a null pointer on the extra one; Gran Turismo 7 (PPSA01317) faults the same way on the flip event that follows its marker. Which of the two the console does for a title that mixes both is unknown. - [Host import windows and budget](../../../core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp) (libSceAgcDriver): a registered range larger than 64 MiB is imported one 64 MiB window at a time for buffer and fill accesses; an access across window edges imports the cells it touches, grown to the union of the range's imports it overlaps. An address-based build (`AcquireRegistered`) imports the range whole and replaces its windows. Live imports stay under a budget: `APS5_HOST_IMPORT_MIB`, else the larger of 6 GiB and half the physical memory, at most the largest host heap less 2 GiB (imports and type-3 mirrors share it; #167's rule). A new import beyond it retires the least recently used imports not used in the last 256 lookups; one that would not fit even then is refused before anything is retired, and imports made when a range is mapped never evict. A refused import is tried again at its next use. The 64 MiB window, the 256-lookup protection and the 2 GiB reserve are choices, not measured. - [Registration preparation at submit](../../../core/libs/prx/libSceAgcDriver/Execution/src/Driver/Queues/Submission.cpp) (libSceAgcDriver) - `Driver::Submit` waits for every registration-time shader preparation queued before the call, not only those of the shaders the commands use, so a submission behind a long queue of unrelated preparations waits for all of them on the submitting thread. Waiting there instead of in the queue worker keeps the GPU side of a submission short: a title that sees a submission take seconds treats the GPU as hung (Goat Simulator 3, PPSA04159, then stops submitting and its garbage collector fails a 10 s timeout). On the console shaders are compiled ahead of time, so neither wait exists; how long a title tolerates a slow submit call is not known. ``` @MarcZX100 this is the whole thing. The runtime change is the only part that needs a decision from you; the other two files are the test and the debt line. If you would rather I open a PR from a fork than paste the diff, say so and I will.
MarcZX10 commented 2026-10-17 12:22:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T12:22:12Z.


Thanks for the title traces and the follow-up test sequence. The GT7 and My First Gran Turismo runs show the current one-shot form still permits an extra flip event on queues that use RELEASE_MEM with INT_SEL; the queue-lifetime latch is the only variant in these reports that gets both title runs past this fault. The fresh-queue flip followed by release interrupts and a later flip is a useful focused regression, and the debt entry should keep the mixed-mode console behavior explicitly unknown.

Please open the latch as a separate PR from your fork, with your own commit authorship, so the distinct queue-mode semantics and regression can be reviewed independently from this one-shot head. Include the exact observed title results and the test/validation scope; don’t claim console semantics or untested mixed-mode behavior. I’ll review the new PR and then update this PR’s scope/status based on that review.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6233824322 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6963#issuecomment-6233824322). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-17T12:22:12Z. --- Thanks for the title traces and the follow-up test sequence. The GT7 and My First Gran Turismo runs show the current one-shot form still permits an extra flip event on queues that use `RELEASE_MEM` with `INT_SEL`; the queue-lifetime latch is the only variant in these reports that gets both title runs past this fault. The fresh-queue flip followed by release interrupts and a later flip is a useful focused regression, and the debt entry should keep the mixed-mode console behavior explicitly unknown. Please open the latch as a separate PR from your fork, with your own commit authorship, so the distinct queue-mode semantics and regression can be reviewed independently from this one-shot head. Include the exact observed title results and the test/validation scope; don’t claim console semantics or untested mixed-mode behavior. I’ll review the new PR and then update this PR’s scope/status based on that review.
Lberonio commented 2026-10-17 13:16:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Lberonio on 2026-10-17T13:16:12Z.


@MarcZX100 opened it as its own change: #7137, from my fork, for separate review.

How it differs from this PR

This PR marks the frame and lets the next flip consume the mark. GT7 pairs two flips with one RELEASE_MEM/INT_SEL on queue 0 per frame, so the first flip consumes the mark and the second still delivers — two deliveries for one consumer per frame, and the second is the one that faults.

#7137 latches the queue instead: once a queue has actually delivered an interrupt from one of its own release packets, a flip on that queue delivers nothing for as long as the queue runs. A queue that never raised its own release interrupt still delivers from the flip, which is what Minecraft (PPSA17221) waits on after every flip. The latch is per queue, is never cleared, and only a queue that really delivered sets it (AgcDriverDeliverEopInterrupt now reports whether a registration received the interrupt).

Both changes sit on the same delivery sites. #7137 is rebased on main @ e679bab91 and does not build on this one, so the two can be reviewed and landed independently.

Observed results

On this PR's head (34454bd + #6083 + #6616 + this change), GT7 (PPSA01317 v01.680) still faults:

rc = 139 (SIGSEGV), 18 s
gdb: DELIVER #2 site=libSceAgcDriver.prx+0x28489d ctx=0x0   (flip delivery)
     guest consumer r14=0 -> SIGSEGV at guest 0x1F94F2B
     deliveries=2

With the queue latch instead, the same trace shape:

gdb: AFTER deliveries=231 consumer=231 nulls=0
     every sampled delivery site = libSceAgcDriver.prx+0x28388a   (guest release only)
     flip site +0x28489d absent
plain run: no SIGSEGV; later abort on the unrelated
     [libc] unhandled exception 'St13runtime_error' ... what(): sceSslEnableVerifyOption not implemented

Test in #7137: agc_driver_tests --eop-interrupts (new agc_driver_eop_interrupts ctest) passes — a flip on a queue with no release interrupt raises the event (data = 1), two releases on that queue deliver it (data = 2), a later flip on the same queue raises nothing. Reverting only the runtime sources in the same tree makes it fail with flip on a queue that already raised its own release interrupt raised a second event, so it covers the change and not the old behaviour. tools/check_conventions.py passes.

Scope

The GT7 runs above used the equivalent change on the older tree the runtime was built from. The .prx built from #7137's branch cannot be loaded into that runtime: current main needs LibcRegisterFailureReport_nid_no_patch from a libc.prx newer than the one in it (symbol lookup error, rc 127), and rebuilding the whole runtime from main is outside this change. I have not measured console behaviour, and a title that both waits on the flip event and raises its own release interrupts is untested.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6234328521 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6963#issuecomment-6234328521). Originally posted by [Lberonio](https://github.com/Lberonio) on 2026-10-17T13:16:12Z. --- @MarcZX100 opened it as its own change: **#7137**, from my fork, for separate review. ## How it differs from this PR This PR marks the frame and lets the next flip consume the mark. GT7 pairs **two** flips with **one** `RELEASE_MEM`/`INT_SEL` on queue 0 per frame, so the first flip consumes the mark and the second still delivers — two deliveries for one consumer per frame, and the second is the one that faults. #7137 latches the queue instead: once a queue has actually delivered an interrupt from one of its own release packets, a flip on that queue delivers nothing for as long as the queue runs. A queue that never raised its own release interrupt still delivers from the flip, which is what Minecraft (PPSA17221) waits on after every flip. The latch is per queue, is never cleared, and only a queue that really delivered sets it (`AgcDriverDeliverEopInterrupt` now reports whether a registration received the interrupt). Both changes sit on the same delivery sites. #7137 is rebased on `main` @ `e679bab91` and does not build on this one, so the two can be reviewed and landed independently. ## Observed results On this PR's head (`34454bd` + #6083 + #6616 + this change), GT7 (PPSA01317 v01.680) still faults: ``` rc = 139 (SIGSEGV), 18 s gdb: DELIVER #2 site=libSceAgcDriver.prx+0x28489d ctx=0x0 (flip delivery) guest consumer r14=0 -> SIGSEGV at guest 0x1F94F2B deliveries=2 ``` With the queue latch instead, the same trace shape: ``` gdb: AFTER deliveries=231 consumer=231 nulls=0 every sampled delivery site = libSceAgcDriver.prx+0x28388a (guest release only) flip site +0x28489d absent plain run: no SIGSEGV; later abort on the unrelated [libc] unhandled exception 'St13runtime_error' ... what(): sceSslEnableVerifyOption not implemented ``` Test in #7137: `agc_driver_tests --eop-interrupts` (new `agc_driver_eop_interrupts` ctest) passes — a flip on a queue with no release interrupt raises the event (`data = 1`), two releases on that queue deliver it (`data = 2`), a later flip on the same queue raises nothing. Reverting only the runtime sources in the same tree makes it fail with `flip on a queue that already raised its own release interrupt raised a second event`, so it covers the change and not the old behaviour. `tools/check_conventions.py` passes. ## Scope The GT7 runs above used the equivalent change on the older tree the runtime was built from. The `.prx` built from #7137's branch cannot be loaded into that runtime: current `main` needs `LibcRegisterFailureReport_nid_no_patch` from a `libc.prx` newer than the one in it (`symbol lookup error`, rc 127), and rebuilding the whole runtime from `main` is outside this change. I have not measured console behaviour, and a title that both waits on the flip event and raises its own release interrupts is untested.
MarcZX10 commented 2026-10-17 13:17:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T13:17:33Z.


I reviewed the separate #7137 follow-up. Its queue latch has focused coverage for a queue that has only flip events and for a queue that has delivered release interrupts, and the GT7 report explains why this PR's one-shot marker misses the second flip. The mixed-mode console behavior remains explicitly unmeasured in the new PR. I agree #7137 is the right separate review path for that broader queue-mode rule; I’ll keep this PR open while that review proceeds, and won’t describe this one-shot patch as fixing #6350.

AI-assisted: yes (Codex); code and test scope reviewed.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6234342086 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6963#issuecomment-6234342086). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-17T13:17:33Z. --- I reviewed the separate #7137 follow-up. Its queue latch has focused coverage for a queue that has only flip events and for a queue that has delivered release interrupts, and the GT7 report explains why this PR's one-shot marker misses the second flip. The mixed-mode console behavior remains explicitly unmeasured in the new PR. I agree #7137 is the right separate review path for that broader queue-mode rule; I’ll keep this PR open while that review proceeds, and won’t describe this one-shot patch as fixing #6350. AI-assisted: yes (Codex); code and test scope reviewed.
Lberonio commented 2026-10-17 13:32:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Lberonio on 2026-10-17T13:32:13Z.


Noted, and thanks for the review — #7137 is unchanged and the status of #6963 is yours to set.

One clarification on the mixed-mode gap, posted on #7137: GT7's queue 0 is itself a queue that carries flips and raises its own release interrupts. With the queue latch, all 231 deliveries in the reconfirmed run were consumed with 0 null contexts and the title advanced past frame pacing, so the latch does not starve that queue in this title. It is still not the untested case — GT7 never waits on the flip event for that queue — and console behaviour stays unmeasured, as stated in the new PR's Not tested line.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6234478736 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6963#issuecomment-6234478736). Originally posted by [Lberonio](https://github.com/Lberonio) on 2026-10-17T13:32:13Z. --- Noted, and thanks for the review — #7137 is unchanged and the status of #6963 is yours to set. One clarification on the mixed-mode gap, posted on #7137: GT7's queue 0 is itself a queue that carries flips *and* raises its own release interrupts. With the queue latch, all 231 deliveries in the reconfirmed run were consumed with 0 null contexts and the title advanced past frame pacing, so the latch does not starve that queue in this title. It is still not the untested case — GT7 never waits on the flip event for that queue — and console behaviour stays unmeasured, as stated in the new PR's `Not tested` line.
MarcZX10 commented 2026-10-17 13:33:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T13:33:27Z.


Coordination update: #7137 reports that GT7 submits two flips per release interrupt, so the one-shot marker in this PR is consumed by the first flip and the second still raises the unpaired event. Their queue-mode change reports the original SIGSEGV gone, with later unrelated blockers. I am leaving this PR open as requested, but the current one-shot behavior should not be treated as fixing #6350.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6234490331 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6963#issuecomment-6234490331). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-17T13:33:27Z. --- Coordination update: #7137 reports that GT7 submits two flips per release interrupt, so the one-shot marker in this PR is consumed by the first flip and the second still raises the unpaired event. Their queue-mode change reports the original SIGSEGV gone, with later unrelated blockers. I am leaving this PR open as requested, but the current one-shot behavior should not be treated as fixing #6350.
MarcZX10 commented 2026-10-17 13:43:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T13:43:00Z.


Thanks for the additional GT7 and PPSA24156 evidence. It confirms the one-shot marker on this branch is insufficient: GT7 pairs two flips with one release, and My First Gran Turismo can still receive an unpaired event. The queue-latch behavior is now isolated in PR #7137 with a focused regression sequence and test results. I am keeping #6963 open per the repository-work tracking instruction; its current one-shot change should not be treated as resolving these reports.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6234592807 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6963#issuecomment-6234592807). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-17T13:43:00Z. --- Thanks for the additional GT7 and PPSA24156 evidence. It confirms the one-shot marker on this branch is insufficient: GT7 pairs two flips with one release, and My First Gran Turismo can still receive an unpaired event. The queue-latch behavior is now isolated in PR #7137 with a focused regression sequence and test results. I am keeping #6963 open per the repository-work tracking instruction; its current one-shot change should not be treated as resolving these reports.
adriadam10 commented 2026-10-19 12:33:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-19T12:33:02Z.


Closing: the one-shot suppression here was shown not to fix #6350 (GT7 pairs two flips with one RELEASE_MEM/INT_SEL, so the second flip still raises the unpaired event; confirmed on GT7 and PPSA24156 runs and acknowledged in this thread). The queue-latch approach landed as #7137, which supersedes this change. This branch also conflicts with main and carries a merge of the closed #6616. Feel free to reopen rebased if there is a part #7137 doesn't cover.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6267296507 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6963#issuecomment-6267296507). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-19T12:33:02Z. --- Closing: the one-shot suppression here was shown not to fix #6350 (GT7 pairs two flips with one `RELEASE_MEM`/`INT_SEL`, so the second flip still raises the unpaired event; confirmed on GT7 and PPSA24156 runs and acknowledged in this thread). The queue-latch approach landed as #7137, which supersedes this change. This branch also conflicts with `main` and carries a merge of the closed #6616. Feel free to reopen rebased if there is a part #7137 doesn't cover.

Pull request closed

Sign in to join this conversation.
No reviewers
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!6963
No description provided.