mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-11-20 00:11:56 +09:00
[MG_Remote, MG_Impl, MG_Backend] (Disaggregated): P5c ev - SEG_EVENT is the only reverse channel
The three reverse MGPipeCallbacks entries become the SERVER session's producer callbacks
(Reserve + fill the head + copy the payload inline + PublishEvents; the host pointer never
reaches the wire), installed at Accept and uninstalled at Close, a second installation
over a claimed entry being Fatal{RoleViolation, callback-double-install}. Producers wired:
buffer writeback (the mapped bytes are copied into the record's inline tail instead of a
raw pointer in MGPBlobRef::Offset), GPU-written (Magma's three direct MarkGpuWritten
bypasses are routed through the callback), surface-changed (the backend posts
MGPSurfaceInfo; the client consumer replays the allocate/format writes against
pDefaultFramebufferInfo on the GL thread, where R3's ownership always was), and
kEventGlError = 4 for PipeInputs::RecordError (ordering stays P9's).
PipeInputs::InvalidateCompileEnv's forward is deleted with an active transport - R-12's
caps re-publication already does its job. The consumer's monolith guard is replaced by
the three segment arms (kSegEvent resolves through the session's SegmentTable;
kMGHostSpanSegNone is monolith-only and Fatal{ProtocolCorruption} on the wire; anything
else the same), and DrainEventRing calls the client consumers BY NAME, never through the
global table. Overflow is Fatal{EventRingOverflow} - P5c's events are lossless, P9 owns
the drop policy. Monolith arms keep the pre-P5c expressions character for character.
Evidence: unit 2139/2139 (incl. the new kEventGlError round-trip), integration-split
107/107, monolith GPU subset 24/24; negative control executed - a writeback blobref
reverted to the raw-pointer shape turns DirectGLES.Split.AtomicCounterScenario.
SubDataAfterDispatchSurvivesAnImmediateReadback red with Fatal{ProtocolCorruption,
OnBufferWriteback.Seg}. CONTRACT-P5C sections 1, 4.
This commit is contained in:
@@ -42,12 +42,14 @@
|
||||
namespace MobileGL::MG_Remote::Transport {
|
||||
|
||||
// Record kinds on SEG_EVENT. 0 is kRingPadRecordKind and can never be an
|
||||
// event, which is why the list starts at 1.
|
||||
// event, which is why the list starts at 1. APPEND-ONLY, for the same reason
|
||||
// the opcode space is (CONTRACT-P5C §7.7): kEventGlError is the first addition.
|
||||
enum EventKind : std::uint16_t {
|
||||
kEventNone = 0,
|
||||
kEventBufferWriteback = 1, // MGPipeCallbacks::OnBufferWriteback
|
||||
kEventGpuWritten = 2, // MGPipeCallbacks::OnGpuWritten
|
||||
kEventSurfaceChanged = 3, // MGPipeCallbacks::OnSurfaceChanged
|
||||
kEventGlError = 4, // PipeInputs::RecordError, posted by the server session
|
||||
};
|
||||
|
||||
// The 8-byte {slot, gen} pair, mirrored (MGPipeHandles.h:54-65).
|
||||
@@ -97,6 +99,21 @@ namespace MobileGL::MG_Remote::Transport {
|
||||
};
|
||||
static_assert(sizeof(EventSurfaceChangedHead) == 24, "MGPSurfaceInfo is 24 bytes on the wire");
|
||||
|
||||
// PipeInputs::RecordError(code, info) (CONTRACT-P5C §1). The NUL-terminated
|
||||
// message follows this head INSIDE THE RECORD: MessageBytes = strlen + 1 and
|
||||
// the NUL travels, so MessageBytes == 0 is the corrupt shape, never "no
|
||||
// message". A longer message is TRUNCATED AT THE PRODUCER to the cap; the cap
|
||||
// is a static_assert here, not a runtime check, because it is part of the
|
||||
// wire's shape rather than a policy a peer may disagree about.
|
||||
struct EventGlErrorHead {
|
||||
std::uint32_t Code; // the frontend ErrorCode, widened
|
||||
std::uint32_t MessageBytes; // strlen + 1, the NUL included
|
||||
};
|
||||
static_assert(sizeof(EventGlErrorHead) == 8, "wire shape");
|
||||
inline constexpr std::uint32_t kEventGlErrorMaxMessageBytes = 1024;
|
||||
static_assert(kEventGlErrorMaxMessageBytes == 1024,
|
||||
"CONTRACT-P5C §1 caps an inline GL-error message at 1024 bytes, NUL included");
|
||||
|
||||
// The server's end. One producer: the apply thread, by construction.
|
||||
class EventRingProducer {
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user