fix(agc): build the guarded mapped compare on macOS #27739
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/27739"
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 Gonic0 on 2026-11-27T06:57:01Z.
What
#24031 (
4cb7752e50) stoppedmainfrom building on macOS. In the Linux and macOS branch ofGuestMemory::CompareMapped,std::min(end, at + PageBytes - (address + at) % PageBytes)mixesstd::size_twithstd::uint64_t, becauseaddressis astd::uint64_t. On macOS these areunsigned longandunsigned long long, so template deduction fails:The remainder of the division by
PageBytesis below 4096, so it is cast tostd::size_tandstd::minis called onstd::size_t. On Linux both types are alreadyunsigned long, so nothing changes there; the Windows branch is not touched.Tested
Apple M5 Pro, macOS 27.3, Apple clang, x86_64 Release under Rosetta 2,
BUILD_TESTING=ON. The tree ismain4cb7752e50plus #17425, #11049, #26739 and #27621, which macOS needs to build; they are not part of this PR.main:libSceAgcDriverand every test that compilesGuestMemory.cppfail with the error above.agc_driver_pipelined_flush_read_order_tests, which fails onmaintoo (mappedundeclared inPipelinedFlushReadOrder.cpp) and is unrelated.ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer ctest -R '^(agc_compare_hook_[a-z]+|agc_mapped_copy_[a-z]+|agc_driver_guest_memory_lifetime[a-z_]*|agc_shader_memory|guest_allocations_[a-z]+|guest_memory[a-z_]*|write_watch[a-z_]*)$' -V, three rounds on MoltenVK from Vulkan SDK 1.4.363.0: 37 of 37 pass each round, including #24031'sagc_mapped_copy_*cases. Every Vulkan test log shows the layer inserted, none reports it missing, and there are noVUID-lines.maincannot run them on macOS because it does not build.main.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
Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-27T07:36:36Z.
Review: APPROVED
Reviewed — looks good
Nothing in the changed line shows a defect; the explicit
std::size_tconversion addresses the stated template deduction issue, and the remainder moduloPageBytesis bounded below one page.What I ran
Reviewed head
478f9722ecfc9b90a26beae8eda5ce84eff59377. No build or tests were run. Readreview/description.md,review/commits.md,review/manifest.json,review/diff.patch, and the changed function context inGuestMemory.cpp. The changed file was included;files.jsonwas unavailable in the prepared review folder.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
Builds, tests, reported game behavior, and files excluded by preparation rules were not independently checked. The prepared file listing identifies one changed file, and its full text was available for targeted reading.
To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T21:02:27Z.
Review: COMMENTED
I reproduced the template-deduction failure using the changed expression with
size_tandunsigned long longon Linux. The revised expression compiled and passed three page-boundary cases. The remainder is below the page size, so converting it tosize_tpreserves the value. Native macOS coverage comes from the author’s runs.Source review at
478f9722ec. The head trial-merges onto6ef4f2f73b. Focused Linux checks are queued.AI-assisted: yes.
Pull request closed