[MG_IntegrationTest] (Disaggregated): prove real Magma queued state and present credit

This commit is contained in:
2026-09-20 04:02:44 -04:00
parent 0e4afb624f
commit c1960fdfaa
7 changed files with 486 additions and 14 deletions
@@ -218,19 +218,14 @@ namespace {
EXPECT_EQ(mint.Count(), 1u);
}
// Application buffer record consumers do not imply run-ahead readiness.
// Magma retains its lockstep lifetime/submission contract; the capability
// must remain absent even when the Espryt readiness constant is true.
// Historical test name retained. Each backend's readiness is now a real gate:
// false forbids the capability, true permits it. Production keeps its own
// Magma readiness constant, which the bootstrap and GPU queue tests also check.
TEST_F(MagmaPipeIdentityTest, AMagmaServerNeverPublishesTheRunAheadCapBit) {
// Whatever the integration constant says. `true` is what the P5e integration commit
// will pass, so the Magma answer is pinned on BOTH sides of that flip and the case
// does not quietly stop asserting anything the day the constant moves.
EXPECT_EQ(MG_Pipe::MGPipeRunAheadCapBitsFor(BackendType::DirectVulkan, /*ready=*/false) &
static_cast<Uint64>(MG_Pipe::kCapRunAheadApply),
0u);
EXPECT_EQ(MG_Pipe::MGPipeRunAheadCapBitsFor(BackendType::DirectVulkan, /*ready=*/true) &
static_cast<Uint64>(MG_Pipe::kCapRunAheadApply),
0u);
EXPECT_EQ(MG_Pipe::MGPipeRunAheadCapBitsFor(BackendType::DirectVulkan, /*ready=*/false), 0u);
EXPECT_EQ(MG_Pipe::MGPipeRunAheadCapBitsFor(BackendType::DirectVulkan, /*ready=*/true),
static_cast<Uint64>(MG_Pipe::kCapRunAheadApply));
EXPECT_EQ(MG_Pipe::MGPipeRunAheadCapBitsFor(BackendType::Unknown, /*ready=*/true), 0u);
// And the Espryt half, so the case says what the arm IS and not only what it is not:
// the bit is published for DirectGLES and ONLY once the integration commit flips
+3 -2
View File
@@ -634,6 +634,7 @@ TEST(CapsMirrorTest, ObjectFamilyEmissionTracksIndependentConsumerCapsWithoutBuf
#endif
}
// Historical name retained; the real bootstrap must now publish and arm Magma readiness.
TEST(CapsMirrorTest, MagmaTransportPublishesRealBufferConsumersWithoutRunAhead) {
#if MGTEST_HAVE_FORK
const ChildResult result = RunInChild([] {
@@ -654,7 +655,7 @@ TEST(CapsMirrorTest, MagmaTransportPublishesRealBufferConsumersWithoutRunAhead)
const Uint64 mask = server.CallMask();
EXPECT_TRUE(MGCapsServerConsumes(mask, kMGPipeSubsystemResources));
EXPECT_TRUE(MGCapsServerConsumes(mask, kMGPipeSubsystemBufferBindings));
EXPECT_EQ(mask & static_cast<Uint64>(kCapRunAheadApply), 0u);
EXPECT_EQ(mask & static_cast<Uint64>(kCapRunAheadApply), static_cast<Uint64>(kCapRunAheadApply));
}
const auto* ops = MG_Pipe::MGPipeGetResourceOps();
EXPECT_NE(ops, nullptr);
@@ -669,7 +670,7 @@ TEST(CapsMirrorTest, MagmaTransportPublishesRealBufferConsumersWithoutRunAhead)
if (ops->MapPersistent) EXPECT_EQ(ops->MapPersistent({7, 1}, 64, nullptr), nullptr)
<< "Magma must not donate a server address as a client persistent map";
}
EXPECT_FALSE(ClientSessionInstance().RunAheadArmed());
EXPECT_TRUE(ClientSessionInstance().RunAheadArmed());
ClientSessionInstance().Stop();
MG_Remote::Server::ServerLoopInstance().Stop();
std::fflush(nullptr);