Repository navigation
test(libkernel): describe the flexible memory fixture's segment on macOS - #9972
oneandonlydean merged 1 commit into
Conversation
guest_flexible_memory_declared loads a host-built .guest.prx fixture whose 512 MiB array must count against the flexible memory budget. On macOS, dl_iterate_phdr reports only images that carry the relinker's __APS5DATA,__meta program headers, which every relinked guest module has but the host-built fixture does not. GuestImageSegmentBytes left the fixture out and the test failed at its budget check. On macOS the fixture now fills its own __APS5DATA,__meta at load with one PT_LOAD header for the array, as ProcessParametersFixture does for the test program. Linux and Windows are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
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.
|
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed exact head 2fd0c1b against current main. The fixture metadata uses the same v2 offsets and PT_LOAD representation consumed by the existing macOS dl_iterate_phdr shim, 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 --check pass. 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.
Independent test: Apple M1 Pro, macOS 27.0.1Apple M1 Pro, macOS 27.0.1, Apple clang 21, x86-64 Release build under Rosetta 2,
AI-assisted: yes (Claude Code ran the build and the tests). |
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(53db0ba,main3fd1cc3) 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 test: organize library tests and label CTest suites #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