test(macos): add the homebrew guest and MoltenVK square smokes #16793
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/16793"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by wanderingbug on 2026-11-07T16:45:14Z.
What
Open #16801 (
fix/macos-test-compile,38bddbff44) edits onlyResourceRequest.cpp,RtcpTransportFeedback.cpp, andGuestCesGbSetters.cpp:<initializer_list>andResourceRequestBasevalue initialization. None of those symbols are in this pull request.Adds two homebrew macOS smokes and the square fixture they relink.
tools/macos_guest_smoke.shruns a small guest ELF.tools/macos_moltenvk_smoke.shfetches MoltenVK, relinkssquare.c, and checksframe_000.bmp.tools/fetch_apple_vulkan.shandtools/macos_address_space.cppsupport that run.docs/dev/BUILD.mdanddocs/dev/ENVIRONMENT.mdname the scripts.Tested
In the cache-reuse run on an Apple M2 Max, macOS 27.2, x86_64 under Rosetta, snapshot
7a6e44ece4plus the six overlays:macos_guest_smokeexited 0. The guest printedhello from a PS5 ELF on macOSandguest thread.macos_moltenvk_smokeexited 0. MoltenVK 1.4.2, Vulkan-Loader 1.4.321 x86_64,square presented,frame_000.bmp320x180. The record describes a green square, a blue player, and two yellow coins. Image sha256c4d55b77b2a7c531ecddda86b0fbef1bfa7604928d966f96b23dffefefd37b93.This head was not rebuilt alone. The run is one existing build tree, not a fresh full runner. Not tested on a second machine; no game tested.
Checklist
main; no other open PR implements the same functions. Unchecked: parent is30a863d12d, and upstreammainis nowdaad891ea6. #16801 does not implement these functions. Other open pull requests were not fully scanned.//comments..mdfiles or images added to the repository. Existing development documentation is edited; maintainer confirmation of this rule is still needed. The markdown edits are the build and environment docs for the scripts.relinkerandlibsin the same tree. Test-only #7804 and #4630 were in the Mac tree and are not in this branch.main.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-11-11T10:31:01Z.
Review: CHANGES_REQUESTED
main, no notes/.mdfiles, Fixes, Unblocks). Rebase ontomain, then tick them or fill them withnone; the check needs every box ticked.core/relinker/relinker/tests/macos/square_elf.py:212-214embeds a ~10 KB base64+zlib ELF that nobody can review or tie tosquare.c. Generate the guest at run time fromsquare.c(or build it with the relinker's existing fixture helpers likeimport_fixture.py), or state how a reviewer reproduces the exact bytes and check them in CI.tools/macos_guest_smoke.shandtools/macos_moltenvk_smoke.share manual, andmacos_guest_thread_selfisEXCLUDE_FROM_ALLwith noadd_test(core/libs/CMakeLists.txt:323). A change that adds test scripts needs at least one registered test that fails without it, or an explanation of why a macOS job is not possible.docs/dev/BUILD.md:380sayslibcandlibkernelstill do not compile on macOS, which contradicts the smokes in the same section that claim to run them; either state which commits the scripts need, or mark them as blocked on those PRs and wait for them.tools/macos_moltenvk_smoke.sh:108-141checks pixels offrame_000.bmp, which depends onAPS5_DUMP_FRAMES/APS5_NO_GPU_DUMP/APS5_SYNC_FLIP; please name the code that writes that file so the check can be tied to main.tools/fetch_apple_vulkan.shdownloads two archives with no checksum; pin SHA-256s.core/libs/CMakeLists.txt:320-329addsmacos_address_spaceas a default target for every Apple build from a probe tool intools/; make itEXCLUDE_FROM_ALLlike the other target or drop it from this PR (one topic).Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-17T04:54:46Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
Changes are required before merge: the guest smoke must build the binary it runs, or the target must be built by default.
What I ran
5a3664277e326e604e996fc513d714d02323b4cc, basemain. No build and no smoke run; the review is read-only.Commands
Also a search of the added lines in
diff.patchfor//and/*.Results
EXCLUDE_FROM_ALLFindings
Blocking
tools/macos_guest_smoke.sh:34runs$build/macos_guest_thread_self, butcore/libs/CMakeLists.txt:320declares that targetEXCLUDE_FROM_ALL. Nothing in the script or the docs builds it, so on a default build the last step fails because the binary is missing. DropEXCLUDE_FROM_ALL, or build the target in the script before it runs.Non-blocking
docs/dev/BUILD.md:375sayslibcdoes not compile on macOS until theSYS_gettiduse incore/libs/prx/libc/src/HeapDiagnostics.cpp:53is fixed. This head still has that code, so the smoke cannot be expected to pass on it as is. The author's run used a different tree; say so in the PR body.core/relinker/relinker/tests/macos/square_elf.py:227runsclang -cwithout a target. On macOS that emits Mach-O andread_elf_objectexits with "not ELF64". The docstring describes a Linux toolchain but does not say--rebuildmust run there.square.elf.ois also left in the source folder.core/relinker/relinker/tests/macos/square_elf.py:250has two identical branches. For-it still opens a file named-rather than writing to stdout, and the handle is never closed.core/relinker/relinker/tests/macos/square.c:184never fires:startedis set on the line before it in every interactive iteration. Remove it or fix the intent.docs/dev/ENVIRONMENT.md:28says a value that is not a positive integer uses 180, butsquare_framesreads leading digits, so5xgives 5.docs/dev/ENVIRONMENT.md:29says "other than 0", but any value starting with0disables the mode. Match the code or the wording.tools/fetch_apple_vulkan.sh:16and:46download MoltenVK and Vulkan-Loader and run them without a checksum. Pin a SHA-256 for each archive.Sources
SYS_gettid:github.com/boykopovar/AnyPS5@5a3664277e/core/libs/prx/libc/src/HeapDiagnostics.cpp (L53)pthread_getattr_npcall in libkernel:github.com/boykopovar/AnyPS5@5a3664277e/core/libs/prx/libkernel/Pthread/src/Thread.cpp (L394)Not verified
7a6e44ece4plus six overlays. The head was not rebuilt alone, so they do not show that this head passes.libcon macOS was not compiled. TheSYS_gettidpoint comes from reading the source andBUILD.md; the macOS headers were not checked.tools/macos_moltenvk_smoke.shwere checked by reading only.square.cdoes not read the keyboard, and the source of that behaviour was not found.tools/macos_address_space.cppwas not compiled; the behaviour ofVM_FLAGS_FIXEDon macOS was not checked.30a863d12d, upstreammaindaad891ea6) and the other open PRs were not checked.pthread_getattr_npin libkernel matches theBUILD.mdnote. PR #7804 was not checked.reviewed. The full head texts infiles/were not opened. Files excluded: none.To get this to a good state
macos_guest_thread_selfbuild by default: dropEXCLUDE_FROM_ALLatcore/libs/CMakeLists.txt:320, or add a build step totools/macos_guest_smoke.sh.tools/macos_guest_smoke.shandtools/macos_moltenvk_smoke.shand attach the output.Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T17:18:44Z.
Review: COMMENTED
The smoke script relinks the embedded ELF written by
square_elf.py. Can the build docs identify the compiler version used to generate that payload and say when to rebuild it? I ran the generator against the checked-insquare.cwith Clang 19.1.7 and 21.1.8 on Linux. Both rebuilt x86-64 ELF images had 14 import relocations, but each differed from the embedded image, including in its executable segment. Documenting the generating toolchain would make it easier to verify the fixture after source changes.The three shell scripts passed syntax checks. I verified the embedded and regenerated ELF headers on Linux. Running the two smokes still requires macOS and MoltenVK.
AI-assisted: yes.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.