build(agc): keep the Linux-only parts of three AGC tests off macOS #11437
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/11437"
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 imellag on 2026-10-26T13:18:36Z.
What
Three AGC tests don't compile on macOS on current
main:Their Linux-only parts are guarded with
#ifndef _WIN32, so macOS compiles them too. This change guards them with#ifdef __linux__instead:HostImportSparseDmaBuf.cppandexecution/SparseDmaBufImport.cpptest udmabuf imports. On Windows they already printskipped, udmabuf imports are Linux onlyand return the skip code; on macOS they now do the same.In
SharedWrites.cpp:RUSAGE_THREAD, which macOS lacks). Windows already leaves it at 0;/proc/self/maps;GuestArenaWriteSharedBacking.DirectMemory.cppregisters that writer only on Linux, so on macOS it returns false by design and the test fails withshared writer rejected direct backing.The partial
sceKernelMunmapblock stays on macOS, where it passes.On Linux and Windows the compiled code doesn't change: the
unifdefviews of the three files with-D__linux__ -U_WIN32and with-U__linux__ -D_WIN32equalmain's.Tested
Current head
182c89266a, rebased ontomain98ddd9c179. #12168 merged in the meantime and changedSparseDmaBufImport.cpp's skip tomain(int argc, char** argv)withSkipCode; this PR keeps that and only changes its guard to#ifndef __linux__. Nothing else changed.Apple M4 Pro, macOS 27.2, Apple clang 21, x86-64 Release under Rosetta 2 (
-DCMAKE_OSX_ARCHITECTURES=x86_64, Ninja,BUILD_TESTING=ON), MoltenVK 1.4.2 from Vulkan SDK 1.4.363.0.maindoes not build the AGC driver and its tests on macOS yet, so this ran on a support branch, notmain: fork branchsupport/macos-boot-1030(6747733e89) =main98ddd9c179+ only the open macOS PRs #11447 #11554 #10552 #7631 #7804 #4630 and #13220 (the duplicatewrite_watchtest registration that stopsmain's CMake on macOS), plus one local line that readsenvironthrough_NSGetEnviron()inHostReportSources.cpp(maindoesn't compile it on macOS; no open PR covers it yet). The conflicts of #11554, #10552, #7631, #7804 and #4630 withmainare resolved in the merge commits. Change:support/macos-boot-1030-pr11437(f8fe1be811) = that branch + this PR's commit.ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validationandVK_LOADER_DEBUG=layer,ctest -R '^(agc_shared_write|agc_shared_write_partial_collect|agc_host_import_sparse|agc_driver_sparse_dma_buf_import)$' -V, 3 runs:agc_shared_writeandagc_shared_write_partial_collectpass;agc_host_import_sparseandagc_driver_sparse_dma_buf_importare skipped withskipped, udmabuf imports are Linux only;VK_LAYER_KHRONOS_validationas enabled byVK_INSTANCE_LAYERS, there is nowas not found but was requested by env var VK_INSTANCE_LAYERS, and noVUID-line.Logs attached.
Previous head
2e0a9091cc(main035ac96eddwith the macOS PRs of that day, macOS 27.0.1): the same results. Without #10898, which has merged since,agc_shared_writebuilt but failed withinvalid write was accepted.Not built on Linux or Windows; the
unifdefcomparison above shows that their code is unchanged.check_conventions.py --base upstream/mainpasses.pr_overlap.pyreports no conflicting lines. Of the pull requests it couldn't compare:HostImportSparseDmaBuf.cpp, which this PR doesn't change;SharedWrites.cppas part of its whole port: it also moves the/proc/self/mapscount and the shared backing writer block to__linux__, but keeps the fault count on macOS withRUSAGE_SELFand leaves the partial unmap block off macOS. Proposed order, asked on #5021: this PR first; #5021 then takesmain's guards when it rebases and keeps itsRUSAGE_SELFfault count on top if it still wants it.Checklist
main; no other open PR implements the same functions (except #5021, see the end of Tested)NotImplemented_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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T13:45:30Z.
Review: CHANGES_REQUESTED
I rechecked the updated head
2e0a9091ccb247d2465d3292dee2de44e225d92against currentmain. The three touched files have not changed on main since the reported base, andtools/check_conventions.py --base upstream/main --head upstream/pr-11437plusgit diff --check upstream/main...upstream/pr-11437pass. The updated macOS build/run report is useful; I have not independently run that macOS suite.There is one repository-rule overlap to resolve before approval. Open #7201 changes the same
HostImportSparseDmaBuf.cppandSparseDmaBufImport.cppplatform guards to skip those Linux-only cases on macOS, and carries a broader macOS-specific implementation in the sameSharedWrites.cppregions this PR now excludes from macOS. The open draft #5021 also carries relatedSharedWrites.cppedits. If this PR is intended as the immediate standalone fix, please clarify the merge order and coordinate the overlapping hunks so the same macOS test handling is not duplicated or regressed when those branches are integrated. I am requesting changes for that overlap only; I found no separate defect in the guards themselves.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-14T07:37:34Z.
Review: APPROVED
Reviewed — looks good
The reviewed change updates the three tests’ platform guards to keep Linux-only code off macOS; the source inspected supports the stated skip behavior for the two DMA-BUF tests and limits the
/procleak check andRUSAGE_THREADfault count to Linux.What I ran
No build or tests were run. I read the prepared review description, commit list, manifest, diff, README, and each changed file’s added lines and relevant surrounding code at head
182c89266a40bf584a7f9a1dd7ba8fe03674cc7e, usingrepo_read.py.Results
unifdefcomparisonsFindings
Blocking
None.
Non-blocking
None.
Not verified
Builds and runtime behavior were not independently verified. I did not inspect the remainder of the changed files beyond the added lines and relevant surrounding code.
files.jsonwas not available as a review document; the manifest lists all three changed files as included, and the review folder lists no excluded changed files.To get this to a good state
Nothing is required.