fix(libSceVideoOut): propagate shutdown driver error and register flip tests #1575

Closed
neuralsin wants to merge 1 commit from upstream-pr/1575 into main
neuralsin commented 2026-10-08 13:15:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by neuralsin on 2026-10-08T13:15:02Z.


What

Resolves #1040:

  1. In VideoOutDriver::presentLoop, wraps AgcDriverShutdown_nid_postfix() in a try-catch block and records any shutdown exception into flipQueue->failure. This prevents Driver::Shutdown()'s stored worker failure from throwing unhandled on presentThread and invoking std::terminate(), allowing presentThread.join() to finish cleanly so VideoOutDriver::Shutdown() can propagate the error to the caller thread as expected by tests.
  2. In core/libs/prx/libSceVideoOut/CMakeLists.txt, builds video_out_flip_tests under if(BUILD_TESTING) and registers all three headless test cases (video_out_flip, video_out_flip_decode, video_out_flip_controls) in CTest with SDL_VIDEODRIVER=offscreen and Windows libc path prepend.
  3. In tools/check_test_registration.py, removes video_out_flip_tests from KNOWN_UNRUN.

Tested

  • Linux / WSL 2 Ubuntu 24.04 (x86_64), GCC 15.2.0, Ninja 1.13.2
  • ctest -R video_out_flip: 3/3 passed (100% tests passed: video_out_flip, video_out_flip_decode, video_out_flip_controls)
  • python tools/check_test_registration.py build_wsl: 100% passed (401 test executables, 3 built and not run as recorded, none new)
  • python tools/check_conventions.py --base origin/main: 100% passed

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 (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4787360453 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1575). Originally posted by [neuralsin](https://github.com/neuralsin) on 2026-10-08T13:15:02Z. --- ### What Resolves #1040: 1. In `VideoOutDriver::presentLoop`, wraps `AgcDriverShutdown_nid_postfix()` in a try-catch block and records any shutdown exception into `flipQueue->failure`. This prevents `Driver::Shutdown()`'s stored worker failure from throwing unhandled on `presentThread` and invoking `std::terminate()`, allowing `presentThread.join()` to finish cleanly so `VideoOutDriver::Shutdown()` can propagate the error to the caller thread as expected by tests. 2. In `core/libs/prx/libSceVideoOut/CMakeLists.txt`, builds `video_out_flip_tests` under `if(BUILD_TESTING)` and registers all three headless test cases (`video_out_flip`, `video_out_flip_decode`, `video_out_flip_controls`) in CTest with `SDL_VIDEODRIVER=offscreen` and Windows libc path prepend. 3. In `tools/check_test_registration.py`, removes `video_out_flip_tests` from `KNOWN_UNRUN`. ### Tested - Linux / WSL 2 Ubuntu 24.04 (x86_64), GCC 15.2.0, Ninja 1.13.2 - `ctest -R video_out_flip`: 3/3 passed (100% tests passed: `video_out_flip`, `video_out_flip_decode`, `video_out_flip_controls`) - `python tools/check_test_registration.py build_wsl`: 100% passed (401 test executables, 3 built and not run as recorded, none new) - `python tools/check_conventions.py --base origin/main`: 100% passed ### 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 (`NotImplemented_nid_no_patch`); silent stubs are listed in TechnicalDebt - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-08 13:19:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-08T13:19:25Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#1648 core/libs/prx/libSceVideoOut/CMakeLists.txt L29-33
core/libs/prx/libSceVideoOut/src/VideoOutDriver.cpp L555
#1801 core/libs/prx/libSceVideoOut/src/VideoOutDriver.cpp L554-555
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6060768994 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1575#issuecomment-6060768994). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-08T13:19:25Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #1648 | `core/libs/prx/libSceVideoOut/CMakeLists.txt` [L29-33](https://github.com/boykopovar/AnyPS5/blob/f145139676a48306681d3a4d5fabf83938759daf/core/libs/prx/libSceVideoOut/CMakeLists.txt#L29-L33)<br>`core/libs/prx/libSceVideoOut/src/VideoOutDriver.cpp` [L555](https://github.com/boykopovar/AnyPS5/blob/f145139676a48306681d3a4d5fabf83938759daf/core/libs/prx/libSceVideoOut/src/VideoOutDriver.cpp#L555) | | | | #1801 | `core/libs/prx/libSceVideoOut/src/VideoOutDriver.cpp` [L554-555](https://github.com/boykopovar/AnyPS5/blob/f145139676a48306681d3a4d5fabf83938759daf/core/libs/prx/libSceVideoOut/src/VideoOutDriver.cpp#L554-L555) | | |
MarcZX10 commented 2026-10-08 20:40:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-08T20:40:45Z.


One more overlap beyond the bot's #1648/#1801 list: open PR #1048 also catches AgcDriverShutdown_nid_postfix() in presentLoop() and registers the same three CTest cases; open PR #1225 does the same plus the Windows libc PATH setup. All three address the #1040 shutdown/test-registration path. #1225's latest Linux and Windows runs currently fail before compilation because it does not remove video_out_flip_tests from KNOWN_UNRUN; #1575 already has that removal.

Please coordinate with those authors/maintainers on the canonical change and list any actual dependency in the PR body before rebasing or resolving the shared VideoOutDriver.cpp / CMake hunks. That should prevent reviewers from merging conflicting versions of the same fix.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6068649306 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1575#issuecomment-6068649306). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-08T20:40:45Z. --- One more overlap beyond the bot's #1648/#1801 list: open PR #1048 also catches `AgcDriverShutdown_nid_postfix()` in `presentLoop()` and registers the same three CTest cases; open PR #1225 does the same plus the Windows libc PATH setup. All three address the #1040 shutdown/test-registration path. #1225's latest Linux and Windows runs currently fail before compilation because it does not remove `video_out_flip_tests` from `KNOWN_UNRUN`; #1575 already has that removal. Please coordinate with those authors/maintainers on the canonical change and list any actual dependency in the PR body before rebasing or resolving the shared `VideoOutDriver.cpp` / CMake hunks. That should prevent reviewers from merging conflicting versions of the same fix.
MarcZX10 commented 2026-10-09 05:23:41 +00:00 (Migrated from github.com)

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


I reviewed the full diff and compared it with the live PR list. #1225 is still open and already contains the same presentLoop shutdown-error propagation and registration of the same three headless modes, so this PR’s checklist claim that no other open PR implements the same functions is currently stale. Please coordinate with #1225 and keep one PR for this change. Also, these new CTest entries do not set a timeout; CONTRIBUTING requires tests to complete in under 30 seconds, so please set an explicit 30-second timeout. I’m holding review until those are resolved.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6074862335 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1575#issuecomment-6074862335). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-09T05:23:41Z. --- I reviewed the full diff and compared it with the live PR list. #1225 is still open and already contains the same `presentLoop` shutdown-error propagation and registration of the same three headless modes, so this PR’s checklist claim that no other open PR implements the same functions is currently stale. Please coordinate with #1225 and keep one PR for this change. Also, these new CTest entries do not set a timeout; CONTRIBUTING requires tests to complete in under 30 seconds, so please set an explicit 30-second timeout. I’m holding review until those are resolved.
oneandonlydean commented 2026-10-09 08:53:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T08:53:01Z.


Closing: #1225 makes the same presentLoop change and ctest registration for #1040 and was opened first. If something here is missing from #1225, a review comment there is the best place for it.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6077680451 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1575#issuecomment-6077680451). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-09T08:53:01Z. --- Closing: #1225 makes the same `presentLoop` change and ctest registration for #1040 and was opened first. If something here is missing from #1225, a review comment there is the best place for it.

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!1575
No description provided.