mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-11-16 14:33:24 +09:00
[MG_Pipe, MG_Remote, MG_Backend, MG_Impl, MG_IntegrationTest] (Disaggregated): P5c ct - the applier_reset and object_death control records
Two appended wire records replace the two cross-role control bypasses:
applier_reset (opcode 77, MGPApplierReset{Uint64 ContextSerial}, kScreen) is emitted by
the GL thread at the FreshlyPrimed make-current edge, before the client-side resets, so
the record's barrier orders the server's MGPipeApplierReset against every verb that
follows; a direct MGPipeApplierReset() from a non-apply thread with a live session is
Fatal{RoleViolation, "g_applier"} (MGPipeApply.cpp carries the layer-2 guard; the
apply-thread and no-session bring-up shapes keep the direct call verbatim).
object_death (opcode 78, reuses MGPipeHandleOnly, kCtxObject) is the framebuffer
family's first wire delete opcode: the client thread resolves the dying object's handle
in its OWN allocator, emits nothing for a handle the server never saw, and EmitAndWaits
otherwise - the wait preserving the death's ordering against in-flight records that
name the handle, the only property the blocking mailbox hop provided. The sink releases
per-kind twins through a handle-keyed ReleaseTwinByHandle (seven kinds, SamplerViewCso's
idempotent second path kept); a null arriving handle is
Fatal{ProtocolCorruption, "ObjectDeath.Handle"}. A documented NoSession fallback arm
delivers a death to a server-only fixture's loop; monolith keeps the mailbox hop and
the FreshlyPrimed direct call character for character.
Evidence: gen_pipe --check/--self-test and gen_pipe_field_ownership --check/--self-test
green; unit 2155/2155; integration-split 111/111 (107 plus four new CtWireScenario
entries, all genuinely run, each with its own log path and an EXPECT_EXIT death case);
red-once - shorting the emission to the direct call turns the four Ct cases red with
Fatal{RoleViolation, "g_applier"} by name, then restores green verbatim.
CONTRACT-P5C sections 1, 5.1-5.2, 7.
This commit is contained in:
@@ -2690,8 +2690,38 @@ namespace MobileGL::MG_Pipe {
|
||||
// - what the server has is no longer what any suppressor slot last emitted;
|
||||
// - and the residual block owes a fresh publication whatever else moved.
|
||||
if (tracker.FreshlyPrimed()) {
|
||||
#if MOBILEGL_BUILD_DISAGGREGATED
|
||||
// P5c (ct), CONTRACT-P5C.md §5.1: with an active transport the server's reset
|
||||
// crosses AS A RECORD, ahead of every reset below - the client-side ones (the CSO
|
||||
// cache, the hash suppressor, the vertex-input emitter) and the emitters' latches
|
||||
// - because the record's barrier is what orders the server's MGPipeApplierReset()
|
||||
// against every verb that follows. The GL-thread direct call it replaces is
|
||||
// Fatal{RoleViolation, "g_applier"} inside MGPipeApplierReset itself (§6 layer 2),
|
||||
// so reverting this arm to the direct call goes red by name rather than rendering
|
||||
// stale. Monolith keeps the direct call, byte for byte (G1).
|
||||
//
|
||||
// THE APPLY THREAD IS EXCLUDED (M5's rule): a validate running on the server's own
|
||||
// thread produces no client record - EmitAndWait there would wait on the thread
|
||||
// that has to apply the record - and the direct call is exactly what the apply
|
||||
// thread is allowed to make (the sink's own path runs it there).
|
||||
//
|
||||
// AND A CONFIGURED-BUT-WIRELESS TRANSPORT TAKES THE DIRECT CALL TOO:
|
||||
// EmitApplierResetRecord answers false when no live session could carry the
|
||||
// record (the pre-Start bring-up window, a ServerLoop fixture with no client at
|
||||
// all), and in that shape this process IS the only place the reset can run.
|
||||
const Bool transportActive =
|
||||
MG_Config::Transport != MG_Config::TransportMode::Monolith &&
|
||||
!MG_Remote::Client::RunsAsTheServerRole();
|
||||
Bool resetCrossed = false;
|
||||
if (transportActive) {
|
||||
resetCrossed = MG_Remote::Client::EmitApplierResetRecord();
|
||||
}
|
||||
#endif
|
||||
MGPipeCsoCacheInstance().Reset();
|
||||
MGPipeApplierReset();
|
||||
#if MOBILEGL_BUILD_DISAGGREGATED
|
||||
if (!resetCrossed)
|
||||
#endif
|
||||
MGPipeApplierReset();
|
||||
MGPipeSetHashSuppressorInstance().InvalidateAll();
|
||||
// P3a: and the vertex-input emitter's latches. NOT because the applier dropped
|
||||
// its vertex-elements records - it does not, they are share-group object state
|
||||
|
||||
Reference in New Issue
Block a user