[MG_Backend, MG_Impl] (P7): the two Magma allocator debt scopes go, because the objects they were about are never built off the monolith arm

CONTRACT-P7 §5.2's "the two MagmaP7AllocatorDebtScope are deleted with it (prove
first, with a temporary assert, that they never arm under a non-monolith
transport)".

WHAT THE DEBT WAS. The hidden blit program, its two samplers and the hidden depth
-mipmap program are FRONTEND objects. Under an active transport the server backend
created them on the apply thread and destroyed them on it, where their destructors
run the client death helper and its lifetime-id probe - so P5c gave the two
teardowns a named exemption and P5e ruling 12 renamed it after the debt.

WHAT RETIRES IT IS NOT AN EXEMPTION BUT AN ABSENCE. P5f fv already gave
InitializeBlitResources and InitializeDepthMipmapResources an early return for
every non-monolith transport, so off the monolith arm neither resource ever holds
anything and `m_blitResources = {}` destroys nothing. The scopes have been
markers over a path that cannot run since that day.

PROVED, NOT ARGUED. A temporary probe in both teardowns failed the session by name
if either resource was non-null under a non-monolith transport. With it armed:
integration-magma-split 93, -spawn 72, -tcp 74, integration-magma-full-split 524,
-full-spawn 524, integration-split 187 and integration-magma-buffers 21 all green -
it never fired. The negative control is what makes that a measurement: dropping the
probe's transport test killed EVERY monolith `DirectVulkan.` entry at teardown
(8/8 aborted, after the case itself passed) while the split entries stayed green.
integration-magma-full-tcp's one red under the probe is the documented StreamLink x
Magma exposure texel (CONTRACT-P7 §2.5's named tcp entry,
IterationRPProgram203Scenario), not a probe death - it fails, it does not abort.

THE COUNT AGAINST P5e RULING 12. That ruling named FOUR Magma sites
(VulkanRenderer.cpp x3 and ResourceTracker.h x1). Two had already gone before P7
began - `git log -S` puts the ResourceTracker.h site's removal in P5f fv (4f3d2d6b)
and the third VulkanRenderer site's in P5f fm (036c3a3d) - so the P7 baseline
78b7d6be carried TWO, which are the two this commit deletes. Magma's apply-thread
allocator debt is now ZERO sites.

THE TYPE STAYS, and its comment now says why: MG_Test/Wire/RemoteClientTest's
RemoteGuards.BarrieredLegacyScopesCannotExemptAllocator and
.BarrieredFrontendRegistryMembersRefuseBothLegacyScopes construct it on the apply
thread and assert the allocator refuses ANYWAY. That is a negative control for the
property P5f (fr) established, and deleting the class would delete the only case
that pins it. No backend use remains.

Gates: integration-magma-split 93, -spawn 72, -tcp 74, integration-magma-full-split
524, ctest -L unit 2423, all green (one InitialCapsStartup death test flaked once
under -j 4 beside a sibling worktree's build and is green on re-run and on a second
full lane); fatal_census 79 abort sites / 44 family words / 0 unmarked;
link_ratchet --assert-monotone unchanged at 186; G1 pull .text 0xa52203, nm
--defined-only identical to p7-before/pull-syms.txt (30570 lines, 0 diffs).
This commit is contained in:
2026-09-22 18:29:22 -04:00
parent 51fa513d73
commit a50d50df60
2 changed files with 33 additions and 22 deletions
@@ -4598,22 +4598,28 @@ void main() {
}
void VulkanRenderer::ShutdownBlitResources() {
#if MOBILEGL_BUILD_DISAGGREGATED
// P5c (G6, CONTRACT-P5C §3.1's named exemption): the hidden blit program and samplers
// are FRONTEND objects the server backend created on the apply thread, and under an
// active transport they die here on that same thread. Their destructors run the client
// death helper, whose lifetime-id probe is the frontend-keyed registry family - it
// resolves to nothing (no handle was ever minted for these objects) and routes no
// delete, so the scope admits the probe as named debt rather than letting the guard
// Fatal at server teardown. P7 gives these resources storage that is not a frontend
// object.
// P7 wave 2-B2: TWO OF P5e RULING 12'S FOUR APPLY-THREAD ALLOCATOR DEBTS ARE GONE, and
// the scope that named them with them. The debt was real when it was written: the hidden
// blit program and its samplers are FRONTEND objects, and under an active transport the
// server backend created them on the apply thread and destroyed them here on it, where
// their destructors run the client death helper and its lifetime-id probe.
//
// P5e (id), ruling 12: one of Magma's FOUR apply-thread allocator debts, and the scope
// is now named after that debt rather than after the frontend-keyed registry - Espryt's
// half of which P5e is retiring, while this one waits for P7. The exemption is keyed on
// a DirectVulkan server, which is what this file always is.
const MG_Pipe::MagmaP7AllocatorDebtScope magmaP7AllocatorDebt;
#endif
// What retires it is not a new exemption but the absence of the objects. P5f fv gave
// InitializeBlitResources an early return for every non-monolith transport, so off the
// monolith arm `m_blitResources` never holds anything and this assignment destroys
// nothing - MEASURED, not argued: a temporary probe here and in
// ShutdownDepthMipmapResources failed the session if either resource was non-null under
// a non-monolith transport, and integration-magma-{split,spawn,tcp} (93/72/74),
// integration-magma-full-{split,spawn} (524/524), integration-split (187) and
// integration-magma-buffers (21) all stayed green with it armed. Dropping its transport
// test killed EVERY monolith `DirectVulkan.` entry at teardown and left the split
// entries green, which is what makes the first run evidence rather than an absence.
//
// The TYPE stays: MG_Test/Wire/RemoteClientTest's RemoteGuards
// .BarrieredLegacyScopesCannotExemptAllocator and
// .BarrieredFrontendRegistryMembersRefuseBothLegacyScopes use it as a NEGATIVE CONTROL -
// they construct it on the apply thread and assert the allocator still refuses, which is
// the thing P5f (fr) changed and the only remaining reason for it to exist.
m_blitResources = {};
}
@@ -4694,13 +4700,9 @@ void main() {
}
void VulkanRenderer::ShutdownDepthMipmapResources() {
#if MOBILEGL_BUILD_DISAGGREGATED
// Same shape as ShutdownBlitResources above: the hidden depth-mipmap program is a
// frontend object created and destroyed by the server backend on the apply thread, and
// its destructor's lifetime-id probe is admitted here as named debt - Magma's, P7's to
// retire, which is what the scope's P5e name says (ruling 12).
const MG_Pipe::MagmaP7AllocatorDebtScope magmaP7AllocatorDebt;
#endif
// P7 wave 2-B2: the second of the pair, retired for ShutdownBlitResources's reason and
// proved by the same probe. InitializeDepthMipmapResources carries the same non-monolith
// early return, so off the monolith arm this assignment destroys nothing.
m_depthMipmapResources = {};
}
+9
View File
@@ -186,6 +186,15 @@ namespace MobileGL::MG_Pipe {
// P5f (fr): these historical scope names remain greppable markers around
// monolith glue until P3b/P4b remove those bodies. They hold no state and grant
// no exemption: allocator and frontend-registry access always refuse apply.
//
// P7 wave 2-B2: MagmaP7AllocatorDebtScope has NO BACKEND USES LEFT. P5e ruling 12 named
// four Magma apply-thread allocator debts (VulkanRenderer.cpp x3, ResourceTracker.h x1);
// P5f fv and P5f fm retired two of them, and this package retires the surviving pair -
// ShutdownBlitResources and ShutdownDepthMipmapResources, where the objects the debt was
// about are simply never created off the monolith arm. The class stays because
// MG_Test/Wire/RemoteClientTest uses it as a NEGATIVE CONTROL: two RemoteGuards cases
// construct it on the apply thread and assert the allocator refuses anyway, which is the
// property P5f (fr) established and the only thing this name now asserts.
class MagmaP7AllocatorDebtScope {
public:
MagmaP7AllocatorDebtScope() = default;