mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-11-17 06:53:22 +09:00
[MG_Pipe, MG_Backend, MG_Remote, MG_Test, scripts] (P7): the Magma wire fatals and the two Staged aborts go through Session::Fail
Five deaths in the split server image raised their own std::abort(). Three of them are funnels - MagmaWireFatal (Renderer/WireFramebuffer.inc), WireDescriptorFatal (Renderer/UniformManager.cpp) and WireBufferLegacyFatal (Renderer/WireDraw.inc) - and the fifteen `@P7` refusals on the tree (8 in UniformManager.cpp, 4 in WireFramebuffer.inc, 2 in WireDraw.inc, 1 in VulkanRenderer.cpp; plan section 1.3's count confirmed) all die through two of them. Every one of those deaths published NO SessionFault frame, so the peer read a bare EOF; bumped NO SessionFaultCount(), so exit gate S8 could neither confirm nor falsify it; and carried a hand-typed family word with no path to FatalFamilies.def's projection. MG_Backend may not name an MG_Remote symbol on its own account, so the route is a seam in MG_Pipe with MGP_TRIP_WIRE_REPORT's shape (PipeApply.cpp:66, and the new code sits beside it): MG_Pipe/PipeSessionFail.h declares MGPipeSessionFail, PipeApply.cpp defines it inside `#if MOBILEGL_BUILD_DISAGGREGATED`, the DEFAULT behaviour is byte-identical to what the three funnels did on their own, and MG_Remote::InstallPipeSessionFailHook() points it at SessionFail. The install is in InitServerRoleCommon (MG_Backend/Init.cpp), step 0, because that is the one function BOTH server roles run - the inproc role and the spawn/TCP session child - so there is no per-transport install to get wrong. MGPipeFatalFamily is a two-value boundary enum, NOT MGFatalFamily cast to an integer: the .def's enumerators are positional and a row inserted in its middle would silently re-point every hook call at a different family. FatalFunnel.cpp's adapter is the one place the two vocabularies meet, as a switch with a named default. The family word stays UnmigratedVerb rather than becoming a new MagmaWireRefusal. Three reasons: the message strings are required to stay byte-identical (5.2), and the retrace refusal censuses recorded since P5b count these deaths by that word - a rename invalidates every `@P7` measurement taken against them; `Magma:` in the detail already separates the Magma arm from the GLES UnmigratedVerb deaths, so a new word adds no discrimination a grep does not have; and its wire projection would be ProtocolCorruption, exactly UnmigratedVerb's. Recorded for the integrator. Ph slice (2) in the same commit: Server/StagedShadow.h's RequireCovered and Server/StagedTextureStore.h's RequireLevelBytes were MGLOG_F + bare abort. Both are inside MG_Remote already, so they call SessionFail directly, message verbatim; check_include_closure.py's four probes do not reach either header and the gate is green. Census: 83 abort sites -> 79 over 20 files (five sites retired, one gained for the seam's no-hook default, which is argued into FUNNEL_SITES), baseline rewritten in this commit - the downward ratchet's notice is what asked for it. Two gate bugs the widening exposed and this commit fixes: the SessionFail call regex also matched `MGPipeSessionFail(` (a lookbehind now), and a funnel's anchor needed a wider window than a marker's (kFunnelAnchorWindow). Red-once, three ways. Pointing MagmaWireFatal back at its own abort reds the census naming WireFramebuffer.inc 0 -> 1. Making the seam skip the hook reds both new death cases - `TheMagmaWireVerbDeathReachesSessionFailAndBumpsTheFaultCount` on the exit code, because it reads SessionFaultCount() out of a SIGABRT handler and gets 0 instead of 1, and `TheSeamHandsTheInstalledHookItsFamilyAndItsLineVerbatim` on the line the hook echoed.
This commit is contained in:
@@ -33,6 +33,9 @@
|
||||
#endif
|
||||
|
||||
#if MOBILEGL_BUILD_DISAGGREGATED
|
||||
// P7 wave 0: the seam the Magma wire funnels in MG_Backend die through. Declared in MG_Pipe and
|
||||
// DEFINED below, so MG_Backend names no MG_Remote symbol of its own to reach Session::Fail.
|
||||
#include <MG_Pipe/PipeSessionFail.h>
|
||||
// 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.
|
||||
@@ -51,6 +54,8 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <cstdarg>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <utility>
|
||||
@@ -108,6 +113,49 @@
|
||||
X(ProgramPointSize)
|
||||
|
||||
namespace MobileGL::MG_Pipe {
|
||||
|
||||
#if MOBILEGL_BUILD_DISAGGREGATED
|
||||
// ----------------------------------------------------------------------------
|
||||
// THE BACKEND-SIDE SESSION-FAIL SEAM (P7 wave 0). PipeSessionFail.h holds the argument;
|
||||
// this is the whole implementation.
|
||||
//
|
||||
// It lives in this file for the reason MGP_TRIP_WIRE_REPORT does, forty lines up: this is
|
||||
// where MG_Pipe already states "the verdict of every trip wire, in one place", and a seam
|
||||
// whose default is an abort belongs next to the other one rather than in a file of its own
|
||||
// that a reader has to be told about. Split-only, so a pull build gains nothing (G1) and a
|
||||
// push-monolith build - where the three Magma wire funnels are not compiled either - gains
|
||||
// nothing to call.
|
||||
namespace {
|
||||
MGPipeSessionFailHook g_sessionFailHook = nullptr;
|
||||
} // namespace
|
||||
|
||||
void MGPipeInstallSessionFailHook(MGPipeSessionFailHook hook) { g_sessionFailHook = hook; }
|
||||
|
||||
MGPipeSessionFailHook MGPipeSessionFailHookInstalled() { return g_sessionFailHook; }
|
||||
|
||||
void MGPipeSessionFail(MGPipeFatalFamily family, const char* fmt, ...) {
|
||||
// The same 512-byte buffer and the same fallback SessionFail and WireLogFatal use, so a
|
||||
// death that travels this seam reads identically to one that did not.
|
||||
char line[512];
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
const int written = std::vsnprintf(line, sizeof(line), fmt, args);
|
||||
va_end(args);
|
||||
if (written < 0) {
|
||||
std::snprintf(line, sizeof(line),
|
||||
"MGPipe: unformattable Fatal diagnostic (format=%s)", fmt);
|
||||
}
|
||||
if (g_sessionFailHook != nullptr) g_sessionFailHook(family, line);
|
||||
// NO HOOK: exactly what the three funnels did before this seam existed - the line, then
|
||||
// the abort. Reached in a server image whose role init has not run (a unit case that
|
||||
// drives the applier headless) and in the client process, where there is no session to
|
||||
// fail. The abort carries no `Fatal{` of its own because `line` already does;
|
||||
// fatal_census.py's FUNNEL_SITES names this function for that reason.
|
||||
MGLOG_F("%s", line);
|
||||
std::abort();
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
// ----------------------------------------------------------------------------
|
||||
// WHICH CHUNKS EACH DERIVATION READS.
|
||||
|
||||
Reference in New Issue
Block a user