mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-11-19 07:51:57 +09:00
F1. `MG_State::Init()` runs before `MG_Backend::Init()`, and the second is what
starts the session - so `GLContext`'s `TextureState` constructor materialised its
eleven default texture objects, each of them emitted `resource_create` through
`FamilyIsLive`, and `CapsMirror::ServerConsumes(0x400)` answered every one of them
from a generation-0 placeholder with `callMask=0`. All eleven records were dropped
and the whole event was one WARN line:
MG_Remote client: the server does not consume MGPipe subsystem 0x400 - this
family emits NOTHING and the legacy pull path runs for it (R-8). callMask=0x0,
caps generation 0
It is NOT a race. The line reproduces byte-for-byte on lavapipe and on the Adreno
830, because the two Init calls are two statements on one thread. And "the legacy
pull path runs for it" is false on the client under split: there is no pull path
on this side of the wire, so withholding is not a fallback, it is a drop that only
a later respecify's self-healing create ever undoes.
Two of the three options the brief offered do not apply, and both facts are worth
recording. (b) "extend the P6.5 fix to inproc" is already the tree: `FinishStartup`
step 7 is the one funnel every transport reaches and it will not return without a
real snapshot. (a) "a bounded wait in Consumes()" cannot work alone and would
deadlock: at `MG_State::Init()` no handshake is in flight, and the one that will
land is started later BY THE SAME THREAD.
So the fix is the ORDER, with the rule behind it as the gate:
* `MobileGL::Initialize` calls `MG_Backend::InitSplitRolesBeforeState()` before
`MG_State::Init()`. `Init()`'s split arm becomes one body, `InitSplitBackend()`,
shared with the direct callers that still reach `Init()`; the monolith arm keeps
its place after `MG_State::Init()`, because moving it would move pull `.text`.
* `CapsMirror::ServerConsumes()` refuses to answer from a placeholder. It waits,
bounded, when a bring-up is genuinely in flight on ANOTHER thread, and otherwise
dies as `Fatal{CapsBeforeFirstSnapshot, "<family>"}` through `SessionFail` -
a new family word, one row in `FatalFamilies.def`, no new abort site.
* Two arms are exempt and say why in place: the server arm (`MGPipeServerArm()` -
the apply thread and the spawn server, where the client's mirror is the wrong
object rather than a late one), and a process whose own configuration never
asked for a split transport (`MG_Config::SplitTransportRequestedByConfig`, set
by `MG_ConfigLoader::InitTransport`, which is what tells a real run apart from a
fixture that assigns `MG_Config::Transport` by hand).
The read accessors keep P5's ruling untouched: `LogBackendInfo` reads
`GetRendererInfo()` during `MG_Backend::Init()` and an abort there is a process that
cannot start. Only the DECISION changed. The warning was not made quieter and the
callMask was not defaulted to all-ones.
`MOBILEGL_TEST_DELAY_FIRST_CAPS_MS` (server side, disaggregated builds, inert unless
set) holds back the FIRST CapsSnapshot. On spawn/tcp that is a genuinely late
snapshot in another process and it exercises the client's step-7 wait; on inproc it
only makes `Start` slower, which is itself the proof that the only window a client
can read a placeholder in is the one before `Start` is called.
G1: `.text` 0xa52203 and the 30570-symbol list identical to p7-before/pull-syms.txt.
Census: 79 abort sites unchanged, 44 family words (was 43). Link ratchet: 186,
unchanged.
112 lines
9.8 KiB
Modula-2
112 lines
9.8 KiB
Modula-2
// MobileGL - MobileGL/MG_Remote/FatalFamilies.def
|
|
// 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
|
|
|
|
// P6 `dl` (CONTRACT-P6 5.2, D2 ruling). THE INTERNAL FATAL VOCABULARY, and its projection onto
|
|
// the SEVEN-value wire FatalCode.
|
|
//
|
|
// a6 censused 30 distinct family words against a 7-value wire enum, so Session::Fail(FatalCode,
|
|
// detail) cannot carry the vocabulary in its first argument - the word would collapse to one of
|
|
// seven and the log would say "ProtocolCorruption" where the code said "UnmigratedVerb". So the
|
|
// family is an INTERNAL enum, generated from this file, and the wire keeps FatalCode. Each row
|
|
// carries the coarse code the PEER is told when this family kills the session; the rich word
|
|
// stays in the local log and in the SessionFault frame's `family` string.
|
|
//
|
|
// THE PROJECTION IS A TOTAL TABLE, NOT A SWITCH WITH A DEFAULT. This build has no -Werror
|
|
// anywhere (measured: CMakeLists, every *.cmake, both workflows), so a gate premised on -Wswitch
|
|
// catching a missing arm is fiction. A row here IS the arm; a family with no row does not
|
|
// compile a call that names it.
|
|
//
|
|
// WHY EACH CODE. The wire FatalCode answers one question for the peer: what KIND of end was
|
|
// this. The buckets:
|
|
// ProtocolCorruption - the peer sent, or the session reached, something that cannot be
|
|
// honoured correctly: a malformed record, an unimplemented verb/surface,
|
|
// an invariant the roles must hold, a reply that does not fit its
|
|
// contract. The peer's takeaway is "we disagree about the protocol".
|
|
// RingOverrun - a shared ring or event channel overran. A transport-capacity fact.
|
|
// SegmentMismatch - a shared SEGMENT's geometry could not hold what a role needed to put
|
|
// in it. Distinct from a ring overrun: the segment is the wrong SIZE,
|
|
// not merely full this instant.
|
|
// AbiMismatch - the two builds do not agree on layout or protocol version.
|
|
// ServerCrashed - a liveness end the WAITING side attributes to the other: a drain that
|
|
// never completed, an apply thread that is gone or never started, a native
|
|
// resource the server had to have and could not obtain. The device-lost
|
|
// latch is armed from the doorbell, never from these, but the peer that
|
|
// was waiting is told the server is gone.
|
|
// DeviceLost - reserved: set by the latch (5.3), never raised as a Fatal family, so no
|
|
// row projects onto it.
|
|
//
|
|
// P7 WAVE 0 ADDED ELEVEN ROWS, for the eleven words the widened census gate found in the server
|
|
// image outside MG_Remote/ (scripts/ci/fatal_census.py rule 3). Ten are ProtocolCorruption for
|
|
// the reason that bucket already states - a record, a mask or a reply that cannot be honoured
|
|
// correctly. The eleventh, ResourceUnavailable (Managers.cpp's three image-promotion sites and
|
|
// VkBufferManager.cpp's eight), is ServerCrashed rather than SegmentMismatch: SegmentMismatch
|
|
// means a SHARED SEGMENT was the wrong size, and telling a peer that when a VkBuffer allocation
|
|
// or a native readback failed would be a lie about whose geometry was wrong. The honest thing to
|
|
// tell a waiting peer is the one ServerCrashed already says. The wire enum has no "the server
|
|
// could not obtain a resource" value and adding one would move `wireFingerprint`, which is a
|
|
// protocol change no wave-0 instrument is entitled to make (recorded for the integrator).
|
|
//
|
|
// Two words were NOT given rows, they were collapsed instead: `InitialBytesNotCarried`
|
|
// (MG_Impl/Pipe/PipeFill.cpp) said the same thing as `UncarriedInitialBytes` (Client/
|
|
// WireTables.cpp) about the same record - a respecify that crossed with no initial bytes - and
|
|
// two words for one family is exactly the drift a6 censused. PipeFill now uses the older word.
|
|
//
|
|
// clang-format off
|
|
|
|
// X(Family, WireFatalCode, Why)
|
|
#define MGL_FATAL_FAMILY_LIST(X) \
|
|
X(ProtocolCorruption, ProtocolCorruption, "a record's bounds or self-describing length was violated") \
|
|
X(UnmigratedVerb, ProtocolCorruption, "a wire verb slot P5/P6 does not implement was reached") \
|
|
X(UnmigratedSurface, ProtocolCorruption, "a surface op named a client-process handle that means nothing here (P12)") \
|
|
X(UnmigratedPipeInput, ProtocolCorruption, "a PipeInputs field with no field-ownership row was read across the boundary") \
|
|
X(UnmigratedEmulation, ProtocolCorruption, "an emulation path the applier has no migrated arm for was reached") \
|
|
X(RoleViolation, ProtocolCorruption, "a call ran on the wrong role/thread - an invariant the two roles must hold") \
|
|
X(UnsetCallMask, ProtocolCorruption, "the CallMask was consulted before either half was published") \
|
|
X(CapsBeforeFirstSnapshot, ProtocolCorruption, "a record family's liveness was asked of a placeholder caps mirror (F1)") \
|
|
X(ConsumerMaskLie, ProtocolCorruption, "the server published a consumer bit for a family whose op table is absent") \
|
|
X(ClientTablesUninstalled, ProtocolCorruption, "the applier ran before the client installed its tables") \
|
|
X(NoClientSession, ProtocolCorruption, "a path that needs the client session ran without one") \
|
|
X(UnnamedIdentity, ProtocolCorruption, "a per-context memo was consulted with a null context identity") \
|
|
X(PipeLegacyMemosDisabled, ProtocolCorruption, "a subsystem bit is clear and this build compiles no legacy arm to fall back to") \
|
|
X(PipeVerifyBadKnob, ProtocolCorruption, "a MOBILEGL_PIPE_VERIFY/POISON knob named a verb or field that does not exist") \
|
|
X(PipeVerifyDiffer, ProtocolCorruption, "the verify comparator found a pushed field differing from the live one") \
|
|
X(UnexpectedMapAccept, ProtocolCorruption, "a persistent-map accept arrived where the protocol permits none") \
|
|
X(UncarriedInitialBytes, ProtocolCorruption, "a producer's initial bytes were required on the wire and absent") \
|
|
X(ReplyStatusInvalid, ProtocolCorruption, "a reply carried a status outside the defined set") \
|
|
X(ReplyError, ProtocolCorruption, "a reply-owning verb saw an error status it cannot represent") \
|
|
X(ReplyMissing, ProtocolCorruption, "a reply slot the protocol requires was empty") \
|
|
X(ReplyMismatched, ProtocolCorruption, "the reply mailbox held an answer for a different slot than the one waited on") \
|
|
X(ReplyOverrun, ProtocolCorruption, "an answer was posted while a previous one was still unread") \
|
|
X(ReplyToNoSlot, ProtocolCorruption, "an answer was posted against reply slot 0, which means \"no record\"") \
|
|
X(ReplyTooLarge, ProtocolCorruption, "an answer exceeded the size its verb's contract allows") \
|
|
X(ResidualBlockSize, ProtocolCorruption, "a fixed-size residual block arrived at a size that is not its own") \
|
|
X(ReadbackDeclined, ProtocolCorruption, "a readback that cannot return without complete pixels was declined") \
|
|
X(ReadbackReplyShort, ProtocolCorruption, "a readback reply carried fewer bytes than its shape requires") \
|
|
X(UnsizedReadback, ProtocolCorruption, "a readback arrived with no declared size") \
|
|
X(BlobMissing, ProtocolCorruption, "a record named a blob that was never staged") \
|
|
X(BlobNotStaged, ProtocolCorruption, "a blob was referenced before its staging completed") \
|
|
X(ArtefactsMissing, ProtocolCorruption, "a program create arrived with no artefacts") \
|
|
X(ArchiveEmpty, ProtocolCorruption, "a create_*_state archive carried no payload") \
|
|
X(BarrierViolation, ProtocolCorruption, "a field was pulled across a verb boundary the barrier forbids") \
|
|
X(UnimplementedAdoptTier, ProtocolCorruption, "MOBILEGL_IPC_ADOPT_TIER named a tier P5 does not implement") \
|
|
X(UnimplementedWritebackWait, ProtocolCorruption, "a writeback wait shape P5 does not implement was requested") \
|
|
X(UnimplementedRemoteBackendObject, ProtocolCorruption, "a BackendObject_Remote entry point P5 does not implement was called") \
|
|
X(UnimplementedClientSession, ProtocolCorruption, "a ClientSession entry point P5 does not implement was called") \
|
|
X(RingOverrun, RingOverrun, "a shared ring refused a record after sufficient space had retired") \
|
|
X(EventRingOverflow, RingOverrun, "the reverse event ring overflowed") \
|
|
X(StageSnapshotTooNarrow, SegmentMismatch, "SEG_STAGE was too small for a snapshot a verb had to place in it") \
|
|
X(AbiMismatch, AbiMismatch, "the two builds disagree on struct layout or protocol version") \
|
|
X(BarrierTimeout, ServerCrashed, "appliedSeq did not reach the target within the bounded wait") \
|
|
X(PresentCreditTimeout, ServerCrashed, "a present credit did not return within the bounded wait") \
|
|
X(RetirementWaitFailed, ServerCrashed, "a wait for the server to retire staging did not complete") \
|
|
X(ApplyThreadJoinTimeout, ServerCrashed, "the apply thread did not join within its bound at teardown") \
|
|
X(ApplyThreadNotRunning, ServerCrashed, "an operation needed the apply thread and it was not running") \
|
|
X(ResourceUnavailable, ServerCrashed, "the server could not obtain a native GL/Vulkan resource it had to have")
|
|
|
|
// clang-format on
|