test(libkernel): cover the block sceKernelAllocateMainDirectMemory returns and its type #11681
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/11681"
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 milescoviello on 2026-10-27T02:36:29Z.
What
GuestMemory.cppgets aCheckAllocateMainDirectMemorycase afterCheckReusedDirectMemorySections. Two 16 KiB pages of type 3 with two-page alignment come back aligned, insidesceKernelGetDirectMemorySize(), andsceKernelGetDirectMemoryTypereports that type over exactly that range.It is called by PPSA01494, PPSA18194, PPSA21564, PPSA30839 and PPSA31162 (call sites found through the import's PLT stub in each title's relinked
eboot.bin), and until now no test called it.Changed:
core/libs/tests/GuestMemory.cpp. Test only, no change to the library.Tested
Linux (Ubuntu 26.04, GCC 15.2), Release:
cmake --build build --target guest_memory_testsandctest -R '^guest_memory$' --repeat until-fail:3pass on this branch, which is currentmainplus the test.tools/check_conventions.py --base upstream/mainpasses.guest_memorypasses 3 of 3 at this head (3d1463aef6) and on its basemainabed035468.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
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T02:40:01Z.
Review: APPROVED
Reviewed exact head
3134ed1658c4da281d3b77346fa804e0c6a67a94. The new case exercises successful allocation/alignment, verifies the reported type and exact range, releases the allocation, and checks invalid length/alignment/null-output refusals preserve the output sentinel. The test is registered in the existing GuestMemory suite, and the current implementation returns these error paths as expected.check_conventions.pyandgit diff --checkpass against refreshed upstream main. The PR reports three passing focused Linux CTest repeats; I could not independently execute that binary here because this host fails the repository's static Zen 2 CPU compatibility guard. Hosted product tests are skipped by path policy. No code issue found.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T04:36:21Z.
Review: APPROVED
Re-reviewed exact head
3d1463aef6ba25b976f024f4004713f31844cf80. The revision removed the four unmeasured error-code assertions, leaving the successful allocation, alignment, range/type verification, and release case.check_conventions.pyandgit diff --checkpass against refreshed upstream main. The author reportsguest_memoryandguest_mmap_fixed_anonymouspassing 3/3 on both main and this head on the same Windows 11 VM; hosted product jobs are skipped by path policy. I could not independently run the CTest binary on this host because it fails the static Zen 2 CPU compatibility guard. No issue found in the revised test.Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-10-28T12:49:19Z.
Review: APPROVED
Reviewed
3d1463aef6ba25b976f024f4004713f31844cf80— approve. The main-direct-memory case checks alignment, bounds, reported type/range and release of the allocation. It reuses the existing guest-memory fixture and leaves no test allocation intentionally outstanding.Windows/GCC 15.3 Release native validation from pinned sources: head: 2 passed, 0 skipped;
guest_memory,guest_mmap_fixed_anonymous; author base was source-compared: production sources are unchanged; its runtime was not built or executed for this review. This changes test coverage, not production behavior, so an old-production failure is not required. The build reuses matching dependency source pins and the existing FFmpeg package; no full product or game execution is claimed.