feat(libSceAmpr): answer sceAmprAmmGetUsageStatsData #4207
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4207"
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 xXPBSXx on 2026-10-12T01:24:07Z.
What
sceAmprAmmGetUsageStatsData(PPSA30601, Resonance, stops there after #4101; see #4067) currently throws as a stub declared by #3814. This PR implements it: a null pointer, or asize_in_byteslarger than 0x18, returnsSCE_KERNEL_ERROR_EINVAL; otherwise the caller-sized prefix of a 24-byte structure is written (size_in_bytes,num_page_table_pool_entries,snapshot allocated entries,high watermark, a reservedu16,ring_idle_flags).Origin of the layout and values (no console measurement):
libAmpr.cpp(AmmUsageStatsData,AmmGetUsageStatsData); the same layout is in iStark/PS5PCEM (likely derived from it, so not independent).0x7are KytyPS5's constants; allocated entries and watermark are 0 (nothing is counted). They are not measured anywhere I could find (neither console nor an independent source) and are listed in TechnicalDebt.sceKernelMapperGetUsageStatsData(no layout there); this port has no kernel-side counterpart.Tested
guest_ampr_markersandguest_ampr_threadspass with the newTestAmmUsageStats(null, oversize, full structure, partial 8-byte and zero-size writes); the test aborts without the change because the stub throws.tools/check_conventions.py --base upstream/mainpasses.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)AI-assisted (Claude Code).
🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-12T01:24:26Z.
Progress report (
682ef0c→4b6f463)📈 System libraries: 86.39% (+0.03%, +1 implemented functions)
✅ 1 implemented
sceAmprAmmGetUsageStatsDataImported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-12T03:24:59Z.
Supporting evidence for this one: a second title needs
sceAmprAmmGetUsageStatsData, not just PPSA30601. Trails in the Sky 2nd Chapter (PPSA35169, 01.003.000) importsKqiWXLgCVe0as well and stops on it once thelibkernelpair in #4214 is recorded — measured on the relinked title: #4214 (comment). With the set of imports it is missing answered — this one among them — the title clears that wall and reaches its Vulkan device, swapchain, save data and 16 game threads (same run), so the call sits on a start-up path rather than a rare one.Disclosure: my #4251 carried a copy of the throwing stub for this export before I saw this PR, #3814 and #4220. I have narrowed #4251 to
touqMEt6qXQ=sceAmprAmmSetPageTablePoolOccupancyNotificationThresholdinstead, so the implementation here is the only copy ofsceAmprAmmGetUsageStatsDataoutside those two stubs.Written with AI assistance.
Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-12T15:27:02Z.
Rebase handoff — rebased onto current
main, authorship unchanged (staleness only — the rebase applied cleanly).Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release,
BUILD_TESTING=ON, AMD RX 9070 XT / RADV):tools/check_conventions.py --base origin/mainpassesTo pick it up:
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-12T17:56:35Z.
Thanks for the rebase and the full-suite run. I had already rebased this branch onto
main2a5eca11cbefore I saw your handoff (head83f94758c), so there is nothing to pick up. Your 957/957 on Linux is a useful second platform; on Windows the same state passesguest_ampr_markersandguest_ampr_threads(2/2).AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-12T19:27:12Z.
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.
main)core/libs/tests/GuestAmpr.cppL1295Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-12T20:57:00Z.
Checked the layout, size check and constants against KytyPS5
AmmGetUsageStatsData(identical), built and ran theguest_ampr_*tests on Linux (pass), and confirmedTestAmmUsageStatsfails without the change. The TechnicalDebt entry is in the right section and the old stub mention inlibSceJson2.mdis removed; merging.