fix(libkernel): report a 256 GiB AMM range starting on a 64 GiB boundary #6437
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6437"
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 fma-rc on 2026-10-15T15:14:49Z.
What
sceAmprAmmGetVirtualAddressRangesreported a 32 GiB AMM range. Death Stranding 2 (PPSA02015, 01.015.000) starts its main heap 64 GiB above the reported start, so on currentmainit stops after 1 s:The title sets its heap cursor to start + 0x1000000000. Its small-block pools sit at start + 16 GiB, one per 256 MiB, and its
realloctells a pool pointer from a heap pointer by((ptr & 0xff0000000) - 0x400000000) >> 28 <= 0x17, which only works when the start is a multiple of 64 GiB.This reports a 256 GiB range followed by the 32 GiB multimap range, with the start on a 64 GiB boundary. DS2's AMM use reached 84 GiB above the start in its first 160 s. KytyPS5 reports 512 GiB, and I tried that first, but the guest arena is 64 to 1008 GiB, so every 64 GiB-aligned 544 GiB window covers 448 to 608 GiB, and on Windows one host thread stack there was enough to block it:
guest_ampr_markersfailed 17 of 100 runs in my Windows VM, and passes 100 of 100 with 256 + 32 GiB. The console's values are not known; the TechnicalDebt entry says so. If someone has them from a console, I would rather use those.Tested
Linux (Arch, GCC 16.2.1):
guest_amm_placement,guest_ampr_markers,guest_ampr_threadsandguest_ampr_cpp_errorpass on an RTX 5080, on a Radeon 610M (RADV) and on lavapipe onmainff23657f3with this change, and again onmain92e50418f.guest_amm_placementfails withmain'sApr.cpp(AMM ranges are not a 256 GiB range and an adjacent 32 GiB multimap range). Windows Server 2025 VM, WinLibs GCC 15.2: the full ctest suite shows no new failure, andguest_ampr_markerspassed 100 of 100 runs.Ratchet & Clank: Rift Apart (PPSA01474), which also uses AMM, runs the same 180 s without a stop on
mainand with this change (my earlier issue #3146 was about its maps and the AMM range). Death Stranding 2 onmainwith this change runs past the AMM stop to 24.5 s, where it stops onFLAT address register range overflow, which PR 5426 fixes.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)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T15:33:57Z.
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.
docs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mdcore/libs/tests/GuestAmmPlacement.cppdocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mdcore/libs/tests/GuestAmmPlacement.cppdocs/dev/debt/libkernel.mdImported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-15T18:10:34Z.
I ran the test this PR changes, on Linux.
Setup: head
451f11eafmerged into main at92e50418f(no conflicts; the PR is based on that main), default CMake build (CMAKE_BUILD_TYPE empty, unoptimized), clean environment (env -iwith only HOME, PATH and VK_ICD_FILENAMES set).ctest -R '^guest_amm_placement$', 3 runs each.I did not check Windows or macOS.
AI-assisted: yes