[MG_Remote] (Disaggregated): P5e ra - the run-ahead latch goes down with the session

- CONTRACT-P5E §1. The latch means "what THIS session's first caps adoption said", and
  ClientSession is a process singleton that Start/Stop can cycle. Left standing, a second
  Start would inherit a verdict about a server that is gone - and because a later
  snapshot may only turn run-ahead OFF, an inherited `true` could never be corrected by
  the honest answer arriving afterwards.
- The present serial resets with it: a credit's id space belongs to the session that
  paces on it, and a server that never saw frame 1 cannot return its credit.
This commit is contained in:
2026-09-18 08:27:00 -04:00
parent 6ee4c0979b
commit 48b2f56ef8
@@ -802,6 +802,14 @@ namespace MobileGL::MG_Remote::Client {
m_serverTransport.reset();
m_transport = nullptr;
m_started = false;
// P5e (ra, §1): the LATCH GOES DOWN WITH THE SESSION. It is "what the first caps
// adoption of THIS session said", and a session that starts again - the same singleton,
// a second Start - must take it again from that session's own first snapshot rather
// than inherit a verdict about a server that is gone. The present serial goes with it
// for the same reason: the credit's id space belongs to the session that paces on it.
m_runAheadArmed = false;
m_runAheadLatched = false;
m_presentsSent = 0;
if (g_active == this) {
g_active = nullptr;
}