mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-11-07 18:13:23 +09:00
[MG_Backend, MG_Impl, MG_Util, MG_Test, MG_IntegrationTest, docs] (P7): the server publishes kCapResidentSubData off its own wire resource table
CONTRACT-P7 §5.4, OQ-10. InitServerRoleCommon computes the whole capability mask and
never ORed this bit, so MGPipeResourceOpsHaveSubDataResident answered false under every
transport and BOTH backends were pinned to the ordered in-place host memcpy - which made
Magma's SubDataResident arm (VkBufferManager.cpp's g_vulkanWireResourceOps) dead code on
the wire even though the arm has been there since P5f.
The bit is derived from g_resourceOpsAtStep2->SubDataResident, i.e. from the pointer this
function already pinned at step 2 and that step 5 already refuses to see swapped - never
from ActiveBackendType. That is ID-39's lesson and not a style preference: a mask is a
statement about THIS backend's registered table, and a bit derived from the enum would
keep claiming the capability for a build, a flavour or a future backend whose table does
not carry the arm.
`rsd=` joins the emit[] bracket on the PipeStats summary line, counted at the emitter once
per buffer_subdata_resident record rather than once per call, because a write past the
content chunk cap is cut into several records. It is the only observable that separates
the resident arm from the memcpy beside it: the bytes in the buffer are identical either
way, which is exactly how the capability stayed unpublished for a phase with every lane
green.
WHAT THIS DOES NOT YET PROVE, and R-6 is the reason rather than an omission. §5.4 asks for
a white-box case showing opcode 49 on the wire. None can exist at this tree: the resident
arm is reached only from a GPU-RESIDENT store, residency comes only from
AdoptPersistentMap, and every persistent-map acquisition declines under split by R-6
(PipeApply.cpp:2331 "A SPLIT BUILD RUNS AT TIER T2 AND DECLINES EVERY ACQUISITION,
ALWAYS"; T0/T1 are P11's and AdoptTierIsEmulate is a named Fatal for them). So the
capability is wired AHEAD of its consumer, deliberately, and `rsd=` is what will show the
records the day P11 lands a tier that adopts. Filed for the integrator in
notes/p7/magma-c.md.
What IS proved is both halves of the bit itself. RemoteClientTest's Magma bootstrap case
now asserts the published bit EQUALS `ops->SubDataResident != nullptr` - the two compared
to each other rather than both to true, so the case also covers a backend without the arm
on the day one exists - and a new CtWireScenario case reads the bit out of the client's
own caps mirror, through the same accessor the frontend reads, on both backends and all
three transports.
RED-ONCE, both levels. Deleting the OR reds
CapsMirrorTest.MagmaTransportPublishesRealBufferConsumersWithoutRunAhead
(RemoteClientTest.cpp:692, "Which is: false / Which is: true") and all SIX arms of
DirectGLES/DirectVulkan x {Split,Spawn,Tcp} Ct.TheServerPublishesTheResidentSubData
CapabilityFromItsOwnTable ("the client's caps mirror did not receive
kCapResidentSubData"). Restored: green.
Also carries the P4a death-helper comment from the previous commit's sweep: it no longer
says Magma installs no death table, because it now does and still frees no slot.
This commit is contained in:
@@ -705,6 +705,15 @@ TEST(CapsMirrorTest, TheReadAccessorsStillAnswerFromThePlaceholder) {
|
||||
CapsMirror mirror;
|
||||
EXPECT_FALSE(mirror.Valid());
|
||||
EXPECT_EQ(mirror.Generation(), 0u);
|
||||
// (F1 made ServerConsumes on a placeholder a refusal, so the two decision reads that used to
|
||||
// sit here belong to the case above; the READ accessors below are what this case pins.)
|
||||
// P7 wave 2 package C, OQ-10: the NEGATIVE half of the resident-sub-data pair. It used to
|
||||
// be vacuous - nothing in the tree ever set kCapResidentSubData, so every reading of it was
|
||||
// false - and MagmaTransportPublishesRealBufferConsumersWithoutRunAhead below is the
|
||||
// positive half that makes this one mean "a mirror with no snapshot withholds the bit"
|
||||
// rather than "the bit does not exist". Withholding is the SAFE direction: the client then
|
||||
// keeps the ordered in-place host write (BufferObject::LandBytesIntoResidentStore) instead
|
||||
// of emitting opcode 49 at a server that might have no arm for it - ID-39 in miniature.
|
||||
EXPECT_FALSE(mirror.HasCap(kCapResidentSubData));
|
||||
EXPECT_EQ(mirror.CallMask(), 0u);
|
||||
EXPECT_EQ(mirror.Backend(), BackendType::Unknown);
|
||||
@@ -789,6 +798,24 @@ TEST(CapsMirrorTest, MagmaTransportPublishesRealBufferConsumersWithoutRunAhead)
|
||||
EXPECT_NE(ops->MapPersistent, nullptr);
|
||||
if (ops->MapPersistent) EXPECT_EQ(ops->MapPersistent({7, 1}, 64, nullptr), nullptr)
|
||||
<< "Magma must not donate a server address as a client persistent map";
|
||||
// P7 wave 2 package C, OQ-10 (CONTRACT-P7 §5.4): THE TABLE DECIDES THE BIT, and
|
||||
// this is the assertion that says so rather than asserting a constant. Magma
|
||||
// registers a SubDataResident arm (VkBufferManager.cpp's g_vulkanWireResourceOps),
|
||||
// so the published mask must carry kCapResidentSubData - and it must carry it
|
||||
// BECAUSE of the arm, which is why the two sides are compared to each other
|
||||
// instead of both to `true`. Written this way the case also covers the backend
|
||||
// that does NOT have the arm, on the day one exists: no enum is consulted here,
|
||||
// and deleting the `|=` in MG_Backend/Init.cpp reds exactly this line (red-once).
|
||||
EXPECT_EQ((server.CallMask() & static_cast<Uint64>(kCapResidentSubData)) != 0,
|
||||
ops->SubDataResident != nullptr)
|
||||
<< "kCapResidentSubData must be published from the server's own wire resource "
|
||||
"table (ID-39: never from the backend enum). Without it "
|
||||
"MGPipeResourceOpsHaveSubDataResident answers false under every transport "
|
||||
"and both backends fall back to the in-place memcpy, which makes Magma's "
|
||||
"SubDataResident arm dead code on the wire";
|
||||
EXPECT_NE(ops->SubDataResident, nullptr)
|
||||
<< "Magma's wire resource table lost its resident sub-data arm; the bit above "
|
||||
"would then correctly go dark and opcode 49 would stop crossing";
|
||||
}
|
||||
EXPECT_TRUE(ClientSessionInstance().RunAheadArmed());
|
||||
ClientSessionInstance().Stop();
|
||||
|
||||
Reference in New Issue
Block a user