From 571cbabb5310b42c0cd2ca3d5be83708ddee229d Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Wed, 16 Sep 2026 05:54:33 -0400 Subject: [PATCH] [Fix] (MobileGL/Init, MG_Backend): ShutdownSplitRoles exists only under MOBILEGL_BUILD_DISAGGREGATED - G1 admits no new pull symbol and the unconditional call moved DestroyImpl by 32 bytes --- MobileGL/Init.cpp | 8 ++++++-- MobileGL/MG_Backend/BackendObjects.h | 8 +++++--- MobileGL/MG_Backend/Init.cpp | 4 ++-- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/MobileGL/Init.cpp b/MobileGL/Init.cpp index dde56bdd..2436d792 100644 --- a/MobileGL/Init.cpp +++ b/MobileGL/Init.cpp @@ -43,11 +43,15 @@ namespace MobileGL { if (logLifecycle) { MGLOG_I("MobileGL closing..."); } +#if MOBILEGL_BUILD_DISAGGREGATED // P5: the split roles come down FIRST - ARCHITECTURE.md:537's order puts the whole // of it before MobileGL::Destroy(), and this function IS MobileGL::Destroy. A no-op - // in a monolith build and in a monolith run; see BackendObjects.h for why the - // position rather than the call is the load-bearing part. + // in a monolith RUN; absent from a monolith BUILD, because G1 admits no new pull + // symbol and no resized one (the first version called it unconditionally and moved + // DestroyImpl by 32 bytes). See BackendObjects.h for why the position rather than + // the call is the load-bearing part. MG_Backend::ShutdownSplitRoles(); +#endif // Before any subsystem the counters name goes away, and before the last frame's // numbers can be lost: emits the final summary line and, when // MOBILEGL_PIPE_STATS_FILE is set, the JSON dump. A no-op when the counters are diff --git a/MobileGL/MG_Backend/BackendObjects.h b/MobileGL/MG_Backend/BackendObjects.h index fcff0086..8d71c674 100644 --- a/MobileGL/MG_Backend/BackendObjects.h +++ b/MobileGL/MG_Backend/BackendObjects.h @@ -16,9 +16,10 @@ namespace MobileGL::MG_Backend { extern UniquePtr& pActiveBackendObject; extern GlobalBackendFunctionsTable gBackendFunctionsTable; - // P5 v1. The counterpart of Init()'s single split hook, and a NO-OP in every build and - // every run that is not split - which is why MobileGL/Init.cpp can call it unconditionally - // without a second #if in a file no package owns. +#if MOBILEGL_BUILD_DISAGGREGATED + // P5 v1. The counterpart of Init()'s single split hook, and a NO-OP in every run that is + // not split. It exists ONLY in a split build: G1 admits no new symbol in the pull build, + // so MobileGL/Init.cpp's call sits under the same #if rather than calling a no-op. // // IT MUST RUN FIRST, BEFORE ANYTHING ELSE IN DestroyImpl. ARCHITECTURE.md:537's order is // publish -> the server drains and acks -> stop the apply thread (Kill, then join) -> close @@ -38,4 +39,5 @@ namespace MobileGL::MG_Backend { // client-minted and needs no backend call, which is P10's. CONTRACT-P5 4 flags this as a // KNOWN OPEN ITEM and asks v1 to record which way it went: P5 keeps today's order. void ShutdownSplitRoles(); +#endif } // namespace MobileGL::MG_Backend diff --git a/MobileGL/MG_Backend/Init.cpp b/MobileGL/MG_Backend/Init.cpp index 6e09bbe9..e3d7f9ab 100644 --- a/MobileGL/MG_Backend/Init.cpp +++ b/MobileGL/MG_Backend/Init.cpp @@ -170,8 +170,8 @@ namespace MobileGL::MG_Backend { } // namespace #endif - void ShutdownSplitRoles() { #if MOBILEGL_BUILD_DISAGGREGATED + void ShutdownSplitRoles() { if (MG_Config::Transport == MG_Config::TransportMode::Monolith) return; // ClientSession::Stop IS table 3's whole order and it is idempotent: publish and wait // for the server to drain (bounded - a lost record must be a red lane, not a hung @@ -181,8 +181,8 @@ namespace MobileGL::MG_Backend { // owns. A var-tail still named by an unapplied record is a use-after-free the join is // what prevents, which is why the order is not a preference. MG_Remote::Client::ClientSessionInstance().Stop(); -#endif } +#endif void Init() { MGLOG_D("Initializing MobileGL Backend...");