[Refactor] (P13 W5 S4): the persistent-map tracker moves to MG_State as MG_Record; the adoption tier's verdict stays in MG_Remote.

This commit is contained in:
swung0x48 committed 2026-10-06 12:09:56 -04:00
1 parent 17e36589fa
commit 0f5658f56e
20 files changed
+194 -107

No files matched your search

+11 -1
View File
@@ -36,11 +36,13 @@
// DEFINED below, so MG_Backend names no MG_Remote symbol of its own to reach Session::Fail. P13 W5:
// in every build, for the record arm's fail / latch half.
#include <MG_Pipe/PipeSessionFail.h>
#include <MG_Pipe/PipeClientSeam.h>
#if MOBILEGL_BUILD_DISAGGREGATED
// R-6's tier gate. One spelling, asked at the one place the decline is decided. Outside the
// MOBILEGL_PIPE_VERIFY block above on purpose: the tier is a property of the BUILD, not of the
// comparator, and a split build without the comparator still declines every acquisition.
#include <MG_Remote/Client/PersistentMapTracker.h>
#include <MG_State/GLState/BufferState/PersistentMapTracker.h>
#include <MG_Remote/Client/AdoptTierChoice.h>
// P5c (ct), CONTRACT-P5C.md §6 layer 2: MGPipeApplierReset's role guard asks
// ServerLoop::OnApplyThread() - the one predicate that tells the GL thread from the thread
// that owns g_applier under an active transport - and ClientSession::Active(), which is what
@@ -182,6 +184,14 @@ namespace MobileGL::MG_Pipe {
MGPipeRecordLatchHook MGPipeRecordLatchHookInstalled() { return g_recordLatchHook; }
MGPipeRecordLatchedHook MGPipeRecordLatchedHookInstalled() { return g_recordLatchedHook; }
// P13 W5: the client session's device-loss answer (PipeClientSeam.h). Constant-initialized for
// the same static-init reason as the hooks above.
namespace {
constinit MGPipeClientDeviceLostProbe g_clientDeviceLostProbe = nullptr;
} // namespace
void MGPipeSetClientDeviceLostProbe(MGPipeClientDeviceLostProbe probe) { g_clientDeviceLostProbe = probe; }
Bool MGPipeClientDeviceLost() { return g_clientDeviceLostProbe != nullptr && g_clientDeviceLostProbe(); }
#if MOBILEGL_BUILD_RECORD_ARM
// ----------------------------------------------------------------------------
// THE BACKEND-SIDE SESSION-FAIL SEAM (P7 wave 0). PipeSessionFail.h holds the argument;
+25
View File
@@ -0,0 +1,25 @@
// MobileGL - MobileGL/MG_Pipe/PipeClientSeam.h
// Copyright (c) 2025-2026 MobileGL-Dev
// Licensed under the GNU Lesser General Public License v3.0:
// https://www.gnu.org/licenses/gpl-3.0.txt
// https://www.gnu.org/licenses/lgpl-3.0.txt
// SPDX-License-Identifier: LGPL-3.0-only
// End of Source File Header
// P13 W5: THE CLIENT SESSION'S ANSWERS THE RECORD ARM ASKS FOR, WITHOUT NAMING MG_Remote. The record
// arm's client half (the persistent-map tracker, the verb port) runs in a library without a
// transport too; there the answers are the monolith's (no session, so nothing was lost). With
// MG_Remote linked, ClientSession.cpp installs the real probe at static init.
#pragma once
#include <Includes.h>
namespace MobileGL::MG_Pipe {
// Has the calling process's client session latched a lost device (ClientSession::DeviceLost)?
using MGPipeClientDeviceLostProbe = Bool (*)();
void MGPipeSetClientDeviceLostProbe(MGPipeClientDeviceLostProbe probe);
Bool MGPipeClientDeviceLost();
} // namespace MobileGL::MG_Pipe