test(agc): keep sampled cache fixture registrations separate #4159
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4159"
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 MarcZX10 on 2026-10-12T00:13:05Z.
What
Fixes #4141. The sampled-cache eviction test allocates two 3 MiB blocks independently and registers both. If the allocations are adjacent, guest registration coalescing makes the supposed snapshot a view of the imported storage image; its sampled-cache byte charge is zero and the test divides by zero.
Reserve an extra unregistered 64 KiB after each block so separately registered regions cannot coalesce, and assert the snapshot has a nonzero charge before using it as a divisor.
Tested
Linux, GCC 12.2, Release:
cmake --build /tmp/AnyPS5-sampled-fixture-4141-build --target agc_driver_sampled_cache_budget_tests -j4passed.ctest --test-dir /tmp/AnyPS5-sampled-fixture-4141-build -R agc_driver_sampled_cache_budget --output-on-failurepassed (2/2).python3 tools/check_conventions.py --base upstream/mainpassed.Checklist
main; no other open PR implemented this when #4159 was opened. A later PR, #4161, carries a substantially identical change; the authors have been asked to coordinate.