Repository navigation
build(videoout): link one SDL copy on macOS - #11119
Conversation
MarcZX10
left a comment
There was a problem hiding this comment.
The macOS SDL de-duplication approach and the reported measurements are clear. The repository overlap check could not compare this file against #674, and the PR description confirms that #674 changes the same target_link_libraries(libSceVideoOut ...) line. The current checklist declares only #11049 as a dependency. Please coordinate the merge order with #674’s author and add a Depends on: #674 entry if the line-level conflict requires an order; otherwise record that both changes were manually combined cleanly. This is the remaining workflow blocker I found.
|
@MarcZX10 Thanks. I combined the two by hand; no merge order is needed, so I haven't added #674's head (base if(APPLE)
set(videoOutSdl libSceAgcDriver)
else()
set(videoOutSdl SDL2-static)
endif()
target_link_libraries(libSceVideoOut PRIVATE anyps5_input_editor anyps5_input libSceAgcDriver libScePad libSceUserService libSceMouse libSceKeyboard libSceIme libc libkernel decoder_png ${videoOutSdl})i.e. #674's two input libraries in front of current AI-assisted: yes |
MarcZX10
left a comment
There was a problem hiding this comment.
The author has now recorded a concrete manual resolution for the shared link line and notified #674’s author. I checked the current diff: Apple links the VideoOut and affected test targets through libSceAgcDriver, while Linux and Windows retain SDL2-static; the input libraries from #674 can be retained alongside this ${videoOutSdl} selection as shown in the follow-up. The reported Apple test/title runs and validation results cover the changed platform path. The earlier overlap coordination point is addressed; the remaining large rebase conflicts on #674 are separate from this PR.
|
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.
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.
|
|
@Betr0x Coordinating with #11345, as @MarcZX10 asked there. #11345 adds Proposed order: #11345 first, since it is small and independent of the macOS series. After it, this PR changes that line to target_link_libraries(video_out_flip_tests PRIVATE libSceVideoOut libSceAgcDriver libkernel libc ${videoOutSdl})along with the other test targets. If this PR merges first, I will rebase #11345 and use |
THEMANnt
left a comment
There was a problem hiding this comment.
Reviewed 572fa398d8e3a7a542b2ad6c02036db8b118515d. Pending review.
The VideoOut link selection is checked; native Apple verification and upstream Build authorization remain pending.
Validation: Actual submitted CMake selects libSceAgcDriver for the changed Darwin library/test links and SDL2-static on Linux/Windows; the extra pad_sdl include directory is retained. These branch checks are not macOS links or controller execution.
Scope / next step: The author reports combined-series macOS testing, which I have not independently rerun. Complete the authorized hosted Build and retain native Apple SDL/VideoOut evidence before final approval.
jotitadev
left a comment
There was a problem hiding this comment.
Ran head 572fa398d on a second Apple Silicon machine, both on its own and together with #11049.
Machine: Apple M2 Max (32 GB), macOS 27.2 (26B5112a), Apple clang 21.0.0, x86_64 Release under Rosetta 2 (-DCMAKE_OSX_ARCHITECTURES=x86_64, Ninja, BUILD_TESTING=ON, Python 3.9 from Xcode).
Base: main b986c11a34 does not build the libraries on macOS by itself, so the tree is that main plus the open macOS build PRs (#10366, #7631, #10659, #10660, #11249, #11358, #10669, #10552, #7804, #10676, #11447, #11437) and #11554, plus #11705 (applied locally). Only this PR is toggled, with git merge --no-commit on top.
Copies of SDL in the built .prx files: Objective-C SDL* classes, plus SDL_ symbols defined and imported. The warnings come from a small x86_64 program that dlopens libSceAgcDriver, libSceVideoOut, libSceAudioIn and libSceAudioOut and counts is implemented in both:
| base | this PR | #11049 | this PR + #11049 | |
|---|---|---|---|---|
libSceVideoOut.prx |
13 classes, 837 defined, 1,741,768 B | 0 defined, 55 imported, 312,304 B | unchanged | 0 defined, 55 imported |
libSceAudioIn / libSceAudioOut |
837 defined each | unchanged | 0 defined, 7 / 14 imported | 0 defined, 7 / 14 imported |
| duplicate class warnings, all four loaded | 42 | 28 | 14 | 0 |
video_out_mouse + pad_sdl output (ctest -V) |
28 warnings | 0 | not run | not run |
pad_sdlandvideo_out_mousepass 3/3 with this PR.ctest -R "audio|pad|mouse|keyboard|sdl"passes 71/71, alone and together with #11049. I left out the video_out flip, HDR-probe and telemetry tests, which open windows.- #11049 alone passes
ctest -R audio51/51, 3/3. - All three states build without new failures.
Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
|
@NerfEko Works for me, either order. If #11345 lands first, I'll switch AI-assisted: yes |
|
Re-measured the merged head Setup: Apple M4, macOS 27.0.1, Apple clang 21, x86-64 Release under Rosetta 2, MoltenVK 1.4.2.
The one failure on AI-assisted: yes |
THEMANnt
left a comment
There was a problem hiding this comment.
Reviewed f92e5b7c3ed4dfdc949da3fcb29709ef20eca35f — comment; validation/readiness remains incomplete.
The updated CMake retains the intended Apple SDL selection, including the newly affected HDR-probe and telemetry links. Native Apple verification remains outside my available environment.
Executed the submitted CMake conditionals with target-command recording for Darwin, Linux and Windows: all five affected targets use libSceAgcDriver for the selected Apple SDL dependency and retain SDL2-static elsewhere. The corresponding author-base branches were checked too. This evaluates real CMake control flow, but does not link Mach-O libraries, load Objective-C classes or run pad/VideoOut tests. The author’s combined-series macOS and validation-layer results remain author evidence; I did not independently rerun them. No new production defect found.
✅ NVIDIA GPU test: passedPR head
Unstable on main (2, these also failed in recent main runs on this machine; not counted against this PR)Validation IDs already present on main (3 IDs in 125 tests)Skipped (8)ReproduceAutomated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
|
Merged current
Re-measured on macOS (Apple M4, macOS 27.0.1, x86-64 Release under Rosetta 2, MoltenVK 1.4.2). The tree was this merge plus the open macOS build PRs
AI-assisted: yes |
✅ NVIDIA GPU test: passedPR head
Failing on main too (3, not counted against this PR)Validation IDs already present on main (9 IDs in 549 tests)Skipped (3)ReproduceAutomated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
3428c9a to
f9d18c5
Compare
libSceVideoOut linked its own SDL2-static next to libSceAgcDriver's. On macOS the Objective-C runtime registers SDL's classes from every copy, so a relinked title printed 14 "Class SDL_... is implemented in both" warnings for libSceVideoOut against libSceAgcDriver, which the runtime says may cause spurious casting failures and crashes. On Apple, libSceVideoOut and the test executables that link it now take SDL from libSceAgcDriver, which it already links, as boykopovar#11049 does for the audio libraries. The test executables have to follow: pad_sdl attaches its virtual joysticks in its own SDL copy and aborts when VideoOut asks another one. Linux and Windows link as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
f9d18c5 to
3004cbe
Compare
|
The full Build failed |
What
Follow-up to #11049, which @imellag asked me to open there. On macOS the Objective-C runtime registers SDL's classes from every copy in the process.
libSceVideoOutlinked its ownSDL2-staticnext tolibSceAgcDriver's, so every relinked title printed 14Class SDL_... is implemented in both .../libSceAgcDriver.prx and .../libSceVideoOut.prxwarnings, which the runtime says "may cause spurious casting failures and mysterious crashes".On Apple,
libSceVideoOutnow takes SDL fromlibSceAgcDriver, which it already links, the same way #11049 does forlibSceAudioInandlibSceAudioOut. The test executables that link bothlibSceVideoOutand their ownSDL2-static(video_out_mouse_tests,pad_sdl_tests,video_out_hdr_probe_tests,video_out_telemetry_tests) follow: without that,pad_sdlaborts, because it attaches its virtual joysticks in its own SDL copy while VideoOut askslibSceAgcDriver's.pad_sdl_testsgets${ANYPS5_SDL2_INCLUDE_DIR}, which it used to receive throughSDL2-static.On Linux and Windows
videoOutSdlisSDL2-static, so every link line is the same as before.Tested
Apple M4 (10-core GPU), macOS 27.0.1, Apple clang 21, x86-64 Release under Rosetta 2 (
-DCMAKE_OSX_ARCHITECTURES=x86_64, Ninja,BUILD_TESTING=ON), MoltenVK 1.4.2 from the LunarG SDK 1.4.363.0.maindoes not build the libraries on macOS by itself, so the tree ismain3a2c51afdmerged with mugurc'sci/macos-series-2(which carries #11049's change as63db337cd8), #10885 and #10540. Both states below are the same tree, withcore/libs/prx/libSceVideoOut/CMakeLists.txtas onmainand as in this PR.mainlibSceVideoOut.prxlibSceAgcDrivervideo_out_mouse_testspad_sdl,video_out_telemetry*,video_out_hdr_probeoutputctest -R "video_out|audio|pad|mouse|keyboard"Both titles were relinked with
--macos --to-rosettaand driven throughAPS5_PAD_INPUT_FILE: Syobon Action reaches level 1 and moves, DriftCheck shows both sticks, L1+R1 and Triangle, in both states.Validation, as CONTRIBUTING asks for VideoOut changes (
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1):ctest -R "video_out|pad_sdl" -V: 32/32 pass in both states, nowas not found but was requested by env var VK_INSTANCE_LAYERS, noVUID-. This says little on macOS: every VideoOut test that creates a Vulkan device skips there (Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen)), and withVK_LOADER_DEBUG=layernone of the 32 inserts the layer.VK_LOADER_DEBUG=layerthe loader insertsVK_LAYER_KHRONOS_validationin every run; both titles log noVUID-onmainand with this PR, and dump the same number of frames (8 each).Linux and Windows: not built here; on both
videoOutSdlexpands toSDL2-static.python3 tools/check_conventions.py --base origin/mainpasses.python3 tools/pr_overlap.pycould not comparecore/libs/prx/libSceVideoOut/CMakeLists.txtwith #674, #5021, #7201 and #8927, which conflict withmain. Of those, #674 changes the sametarget_link_libraries(libSceVideoOut ...)line, for its input editor; none of them changes how VideoOut gets SDL on macOS. The two were combined by hand: no merge order is needed, and whichever lands second puts #674'sanyps5_input_editor anyps5_inputin front of the current line and keeps${videoOutSdl}in place ofSDL2-static(details in the review reply; #674 also needs a rebase onto currentmainfor other files).Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code