Files
MobileGL/MobileGL/MG_Pipe/SubsystemDeps.def
T
swung0x48 1c36987e84 [MG_Backend, MG_Pipe, MG_Impl] (P7): D-K2's dependency rule has one statement, and every reader reads it
P3b/P4b wave 2-D package D3, slice 2 - D2's two loose ends, now in-partition because D1 has
landed on feat/disaggregated and MG_Backend/DirectGLES/ is free.

THE STALE PROSE, in the header of the file that implements the refusal.
MG_Backend/DirectGLES/Managers.h's resolver block said "THREE OF THEM CARRY A DEPENDENCY"
(there are six rows; bits 8 and 13 were the two it did not know about) and listed
"10 without 11" among the mirror pairs that are FINE - when 10-without-11 is precisely D-K2's
fourth row (ID-14/ID-15), refused twenty lines below by ResolveTextureResourceSubsystemArm and
withheld by the client. MGPipe.h lost the identical pair of defects with R-5; this copy was
left behind because the file belonged to a package in flight. It does not restate the rows
again: the file that states them is the file the code reads.

BOTH READERS NOW READ MG_Pipe/SubsystemDeps.def. More than the two one-line changes D2
estimated, because the rule had six statements and the estimate counted two:

  PipeFill.cpp P4aFamilyDependencyBits   its own four-row kMGPipeP4aFamilyDependencies[]
                                         -> MGPipeSubsystemRequires(); table deleted
  PipeFill.cpp P5eFamilyIsLive           hand-coded (pushMask & bit 7) == 0
                                         -> MGPipeSubsystemDependenciesAreSet(bit 13, mask)
  Managers.cpp PipeSubsystemDependencyMissing   took a literal dependency BIT per call site
                                         -> takes the FAMILY and asks the table
  Managers.cpp the four resolvers        five calls, five hand-written sentences
                                         -> four calls, one per family, naming only the family
  Managers.cpp ResolveVertexInputSubsystemArm    hand-rolled bitSet && !resourcesBitSet
                                         -> the table
  DirectGLES.cpp ResolveBufferBindingSubsystemArm  the same hand-rolled pair -> the table

MGPipe.h gains one accessor, MGPipeSubsystemDependencyWhy(), so a reader that refuses prints
the ROW'S OWN sentence instead of a copy of it. The .def has carried a Why column since R-5
and nothing read it; its "WHO READS IT" section is rewritten because "THEY ARE NOT SWITCHED
OVER IN THIS COMMIT" is no longer true of anything.

THE CLIENT'S ARGUMENT IS MASKED TO kMGPipeP4aFamilySubsystems, and that mask is the whole
difference between a rewrite and a behaviour change. The .def carries SIX rows; the table
deleted from PipeFill.cpp carried FOUR, and that predicate is wants()'s fourth conjunct for
P4a's families only. Reading all six unmasked makes the CLIENT withhold bit 8's vertex-input
emissions at a mask with bit 7 clear, which is P3a's own rule and not this gate's - caught,
not reasoned about, by TextureEmitTest's
EveryDKTwoDependencyRowGatesItsOwnFamilyAndTheMirrorPairsStayLive going red on exactly that
assertion ("bit 8 alone, with bit 7 clear: P3a's own rule, which this table must not touch").
Bit 13 is not narrowed there either; it asks the table for itself in P5eFamilyIsLive, because
bit 13's conjunct is bit 13's own. The ROWS come from one place; WHO each gate speaks for is
still each gate's.

ONE BEHAVIOUR IMPROVEMENT FALLS OUT rather than being designed in: the texture family is the
only row with two required bits and used to be two guarded calls, so a mask missing bit 11 but
carrying bit 7 was reported with the bit-7 sentence. One call now computes required & ~mask
from the row, so the refusal names whichever bit is actually missing.

WHAT THIS COSTS, said out loud. SubsystemDepsTest used to compare two COPIES of the rule; it
now compares two READERS of one table and cannot catch a typo in a row. It is kept and the
.def says why: both sides still fold in reasons of their own - the server's own family bit and
D-C3's wire-caps refusal, the client's consumer and wired conjuncts - and those can still
disagree at a mask. The compile-time half of D2's red-once (drop the fourth row from the .def
-> MGPipe.h:225/:230 fail) is untouched and is now the load-bearing one.

SubsystemDepsTest 5/5, TextureEmit's D-K2 case green, unit lane 2418/2418.
G1: .text 0xa52203, nm --defined-only 30570 symbols, 0 added / 0 removed, -D 0/0. Every line
is inside #if MOBILEGL_PIPE_PUSH or #if MOBILEGL_BUILD_DISAGGREGATED, and MGPipe.h's new
accessor is inline constexpr and unreferenced in the pull build.
2026-09-22 18:10:56 -04:00

85 lines
6.8 KiB
Modula-2

// MobileGL - MobileGL/MG_Pipe/SubsystemDeps.def
// Copyright (c) 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
//
// D-K2's SUBSYSTEM DEPENDENCY RULE, IN ONE PLACE (P3b/P4b R-5).
//
// WHAT WAS WRONG. The rule "bit X requires bit Y" was stated in SIX places, and the audit found
// two of them WRONG in the same direction:
//
// * MG_Pipe/MGPipe.h's comment said "THREE OF THEM HAVE A DEPENDENCY" (there are six rows) and
// "The mirror pairs (10 without 11, 10 without 9, 7 without 10) are all fine" - but 10
// without 11 is exactly D-K2's FOURTH row, refused by the server at
// Managers.cpp ResolveTextureResourceSubsystemArm and withheld by the client at
// PipeFill.cpp's table. PipeFill.cpp says so out loud: "The brief's original
// 'bit 10 without 11 is fine' is WITHDRAWN for P4a as built.";
// * MG_Backend/DirectGLES/Managers.h's header comment repeats both defects, in the header of
// the file that IMPLEMENTS the refusal.
//
// Neither wrong comment could fail anything, which is the whole argument for a table: the two
// EXECUTABLE statements of the rule are in different link units with no shared header, and the
// four PROSE statements drifted because nothing compared them to anything.
//
// WHAT THIS FILE IS. The rule, once, as rows. It is a preprocessor-only table like
// MG_Remote/FatalFamilies.def - no generator reads it - and it carries pure bit constants, so
// including it from MGPipe.h keeps check_include_closure.py's value-header rule satisfied.
//
// WHO READS IT. MGPipe.h turns it into kMGPipeSubsystemDependencies[],
// MGPipeSubsystemRequires(), MGPipeSubsystemDependenciesAreSet() and
// MGPipeSubsystemDependencyWhy(). The two executable statements of the rule read those, and as
// of wave 2-D package D3 they read NOTHING ELSE - every hand-written copy is gone:
//
// CLIENT dependency check MG_Impl/Pipe/PipeFill.cpp's P4aFamilyDependencyBits /
// P4aFamilyDependenciesAreSet (bits 9-12) and P5eFamilyIsLive
// (bit 13). The local kMGPipeP4aFamilyDependencies[] is deleted;
// what stays is the P4a-specific COVERAGE static_assert, because
// that gate answers for four of these six families and a fifth P4a
// family without a row here must still be a compile error.
// SERVER consumer gate MG_Backend/DirectGLES/Managers.cpp's four
// Resolve<Family>SubsystemArm() over PipeSubsystemDependencyMissing,
// which now takes the FAMILY rather than a literal bit (bits 9-12),
// plus ResolveVertexInputSubsystemArm (bit 8) and DirectGLES.cpp's
// ResolveBufferBindingSubsystemArm (bit 13). The texture family's
// two guarded calls collapse into one, and the refusal names
// whichever required bit is actually missing instead of always the
// first, because the missing set is computed from the row.
//
// The rows moved here one commit before the readers did (R-5 landed with PipeFill.cpp and
// Managers.cpp belonging to packages in flight), and the anti-drift property never waited for
// that: MG_Test/Backend/DirectGLES/SubsystemDepsTest.cpp drives BOTH readers at every
// interesting mask and compares them against these rows - a change to either side alone reds.
// It is now a comparison of two READERS rather than of two copies, which is strictly weaker as
// a drift detector and strictly stronger as a guarantee; it is kept because the two sides still
// fold in reasons of their own (the server's own family bit, D-C3's wire-caps refusal, the
// client's consumer and wired conjuncts) and those can still disagree.
//
// THE ROWS ARE NOT TRANSITIVE, and that is load-bearing rather than an oversight: each reader
// tests the required BITS against MOBILEGL_PIPE_PUSH alone, never the other family's liveness,
// because Espryt's resolvers classify their arms from that mask alone. Making the rows
// transitive here would make the two sides disagree at some mask, which is the failure the
// table exists to prevent. PipeFill.cpp:1576-1581 argues this at length and
// TextureEmitTest.cpp:1278-1283 pins it.
//
// THE MIRROR PAIRS THAT STAY FINE are stated in MGPipe.h beside the table rather than here,
// because an absence is not a row.
// clang-format off
// X(Family, Requires, Why)
// Family - exactly one kMGPipeSubsystem* bit
// Requires - the bits MOBILEGL_PIPE_PUSH must ALSO carry for that family to be live; 0 is a
// ROW and not an absence, so the table covers its families exhaustively
#define MGL_SUBSYSTEM_DEPENDENCY_LIST(X) \
X(kMGPipeSubsystemVertexInput, kMGPipeSubsystemResources, "a vertex buffer binding names a Buffer handle and only bit 7 puts one in the slot table (P3a's shipped shape; ResolveVertexInputSubsystemArm)") \
X(kMGPipeSubsystemFramebuffer, kMGPipeSubsystemTextureResources, "every MGPSurface::Res names a Texture or Renderbuffer handle and only bit 10 populates those two slot tables (ResolveFramebufferSubsystemArm)") \
X(kMGPipeSubsystemTextureResources, kMGPipeSubsystemResources | kMGPipeSubsystemSamplers, "a buffer texture's BufferForTexBuffer names a Buffer handle (bit 7); and MGPTextureParams::BuiltinSampler is a SamplerCso HANDLE only bit 11 mints, whose null the applier treats as Fatal{ProtocolCorruption} rather than a decline - D-K2's fourth row, ID-14/ID-15, which WITHDRAWS the brief's 'bit 10 without 11 is fine'") \
X(kMGPipeSubsystemSamplers, kMGPipeSubsystemTextureResources, "every MGPBoundView::Texture and MGPImageView::Res names a Texture handle and only bit 10 populates that slot table; with the row above this is SYMMETRIC - bits 10 and 11 are one arm with two switches (ResolveSamplerSubsystemArm)") \
X(kMGPipeSubsystemPrograms, 0, "a ShaderCso handle names no texture and no buffer, the archive rides beside the record as a companion pointer, and the server's extra specialisation inputs come from state the backend already holds (ResolveProgramSubsystemArm)") \
X(kMGPipeSubsystemBufferBindings, kMGPipeSubsystemResources, "every MGPBufferRange::Res names a Buffer handle and only bit 7 puts one in the slot table, so without it every server-side EnsureBufferResourceForHandle would mint a twin with no record behind it (P5e sb; ResolveBufferBindingSubsystemArm)")
// clang-format on