From f3300a074da4945ada3c04def919be0217631b3e Mon Sep 17 00:00:00 2001 From: Yunus Shaikh <75296019+EagleBearerYS@users.noreply.github.com> Date: Thu, 15 Oct 2026 07:48:13 +0000 Subject: [PATCH] test(agc): prove the merged read-only V# test keeps the address space, and cross access The test of two read-only V#s merged over three imports now asserts that its second build hits the cached address space without a dissolve and that the third leaves it only for the import change. One crossed piece is writable, so a join of the crossed run cannot erase the overlap the test is about. --- core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp b/core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp index 30f0dce70f..1aa145074e 100644 --- a/core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp +++ b/core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp @@ -570,7 +570,7 @@ void spaceReadsAcrossImportsMergedTests(const Context& context, const BdaTestAcc SetHostImportWindow(window); const auto change = [&](std::uint8_t* range, bool add) { auto* mutation = GuestAllocations::GuestAllocationsBegin_nid_postfix(); - if (add) GuestAllocations::GuestAllocationsAdd_nid_postfix(mutation, range, piece, true, false, true); + if (add) GuestAllocations::GuestAllocationsAdd_nid_postfix(mutation, range, piece, true, range == guest + 3 * piece, true); else GuestAllocations::GuestAllocationsRemove_nid_postfix(mutation, range); GuestAllocations::GuestAllocationsEnd_nid_postfix(mutation); }; @@ -582,6 +582,7 @@ void spaceReadsAcrossImportsMergedTests(const Context& context, const BdaTestAcc const std::uint64_t upper = second + 128; const std::uint64_t upperBytes = third + 256 - upper; for (int build = 0; build < 3; ++build) { + const auto before = AddressSpaceCounters(); GuestBufferMemory leased(importing); leased.AcquireRegistered(); leased.AddReadable(lower, lowerBytes); @@ -599,6 +600,8 @@ void spaceReadsAcrossImportsMergedTests(const Context& context, const BdaTestAcc Require(at + bytes <= mapped.size() && mapped[at] == expected(address) && mapped[at + bytes - 1] == expected(address + bytes - 1), "a read-only V# over imports, merged with another one, maps other bytes than its own"); } leased.WriteBack(); + const auto after = AddressSpaceCounters(); + if (after.enabled && build > 0) Require(after.hits == before.hits + 1 && after.dissolvedOverlap == before.dissolvedOverlap && after.dissolvedImports == before.dissolvedImports + (build == 2 ? 1u : 0u), "read-only V#s over imports, merged with each other, left the cached address space other than by the import change"); } for (std::size_t index = 0; index < pieces; ++index) change(guest + index * piece, false); SetHostImportWindow(0);