test(libkernel): describe the flexible memory fixture's segment on macOS #9972
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/9972"
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 tkcm01 on 2026-10-23T01:18:26Z.
What
guest_flexible_memory_declaredloadsguest_flexible_memory_module.guest.prx, a host-built fixture whose 512 MiB array must count against the flexible memory budget (GuestImageSegmentBytes). On macOS,dl_iterate_phdr(libc/src/specifics/macos/GuestImages.cpp) reports only images that carry the relinker's__APS5DATA,__metaprogram headers. Every relinked guest module has them, but the host-built fixture doesn't, so it was left out and the test failed at its budget check (GuestFlexibleMemoryBudget.cpp,GuestImageSegmentBytes_nid_no_patch() > 448u * 1024u * 1024u).On macOS the fixture now fills its own
__APS5DATA,__metaat load, with onePT_LOADheader for the array, asProcessParametersFixture.hppalready does for the test program. The module target gets${LIBS_INCLUDE_DIR}forElfTypes.hpp. Linux and Windows are unchanged. The runtime is unchanged too: #7201 would make the test pass by synthesising program headers indl_iterate_phdrfor every host image, which this test alone doesn't need. Announced on #1, where @mugurc listed the failure as known in #7631.Tested
macOS 27.0.1, Apple M4, Apple clang 21, x86-64 build under Rosetta 2. The libraries do not link on macOS from
mainalone, so the run is on mugurc'sci/macos-series-2(53db0badb,main3fd1cc393) with #7524, the code commits of #7937 and the libSceSsl change from #7332, as described on #1, plus my local macOS fixes listed there. The patch applies to that tree as is.ctest -R '^guest_flexible_memory_': without this change 4 of 5 pass, anddeclaredaborts withFlexible memory budget check failed at .../GuestFlexibleMemoryBudget.cpp:108. With it all 5 pass.ctest -j4with Vulkan (MoltenVK 1.4.2) on the same tree, with and without this change: 1648 tests.guest_flexible_memory_declaredis the only test that now passes. The one that differs the other way,agc_driver_pass_input_hazard, failed once under load and passed 20 of 20 on its own and in 4 other full runs. No new failure.python3 tools/check_conventions.py --base upstream/main: passed.tools/pr_overlap.pylists open PRs that changelibkernel/CMakeLists.txt, and #6044, which moves the test sources; none changes this fixture.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-23T04:17:08Z.
Review: APPROVED
Reviewed exact head
2fd0c1b8faagainst current main. The fixture metadata uses the same v2 offsets andPT_LOADrepresentation consumed by the existing macOSdl_iterate_phdrshim, and points the segment at the fixture's 512 MiB array. The change is limited to the host test fixture and its test-target include path; it does not change runtime image enumeration. The reported no-change platform results and macOS before/after tests exercise the intended regression.The convention check against current main, exact-head 171-script registration audit, and
git diff --checkpass. The author reports 5/5 targeted macOS tests and a 1,648-test full run with one additional pass; the one intermittent opposite-direction failure is documented with its repeated standalone result. I could not run the macOS tests locally from this Linux workspace. Hosted policy checks pass and product build jobs are skipped. The PR is mergeable, and I found no blocking issue.