test(libkernel): cover flexible budget after direct replacements #6515
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6515"
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 Ondra97 on 2026-10-15T18:28:49Z.
What
I added a limited-budget regression for direct mappings that replace the middle 32 KiB of a 64 KiB flexible mapping through the ordinary, typed, named and batch APIs.
The test checks that failed
MAP_NOOVERWRITEcalls preserve the address, budget and mapped data; successful replacements recover exactly 32 KiB, keep neighboring data intact and report direct memory; recovered capacity can actually be allocated; and releasing direct memory and cleaning up the remaining flexible pages do not release the same budget twice.The production fix landed in #7112. This rebased PR keeps its additional regression coverage and removes the duplicate production changes. Production code is identical to
main. #6491 covers flexible-over-flexible replacements; #6044 moves this test file.Tested
Base
e5c2b3c325e485ba7fd417c47c46f48aa2c89115; head8627ac796583c9db7694c8c324546d39b7bd7016. These are CPU memory/API tests, with no title or performance claim.relinker,libs, including patched libraries) and selected fixtures built successfully. All 15 selected CTests passed with zero skips (3.85 s total; limited-budget regression 0.12 s).libc,libkernel,guest_memory_tests,guest_flexible_memory_budget_tests) passed, followed by all six selected CTests with zero skips. All 16,121 transferred source/dependency SHA-256 hashes matched before the build and after restoration.The focused CTest filter on both platforms includes
guest_memoryand all fiveguest_flexible_memory_*modes. Windows additionally ranpatched_libraries,guest_kernel_sys,guest_memory_pool_stats,guest_jit_shared_memory,guest_addresses,guest_mmap_fixed_anonymous,guest_mprotect_unmapped,guest_page_table_statsandguest_mlock.Linux graphics/Vulkan tests: NOT RUN — intentionally excluded from VirtualBox validation. Native/bare-metal Linux was not tested. Native Linux GPU validation: not tested. The Linux application and unrelated test targets were not built. No GPU execution or retail/homebrew title was tested. Hosted full builds require collaborator dispatch; local results do not replace those jobs.
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-15T18:35:32Z.
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.
core/libs/tests/GuestFlexibleMemoryBudget.cppImported from boykopovar/AnyPS5. Originally posted by Pouare514 on 2026-10-17T12:05:35Z.
Heads-up from #7112 (open, mine): partial overlap with this PR - both release flexible budget after direct replacements. #7112 additionally scopes _releaseFlexible to tracked ranges (fixes over-release on munmap of direct/reserved ranges, the TLOU 2^64-wrap direction), covers _mapFlexible release-then-record + ReserveVirtualRange, and pins it in guest_memory. Proposal: whichever lands first, the other rebases (my PR can adopt your _mapDirect helper shape and keep scoping + tests, or vice versa). No action needed now, just flagging to avoid surprise at merge.