From ed60c06b9841da1c54fd2314f444bf8e3e543bd2 Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Fri, 11 Sep 2026 15:04:54 -0400 Subject: [PATCH] [Fix] (MG_Remote, Protocol): mark CapsSnapshot's four retired fields deprecated instead of deleting them - a deletion FREES the vtable slot, so callMask took slot 14 from an [int] vector as an 8-byte ulong with no ABI-major bump and a fingerprint that mixes struct sizes rather than the schema --- .../Protocol/generated/protocol_generated.h | 4 ++-- MobileGL/MG_Remote/Protocol/protocol.fbs | 22 ++++++++++++++++--- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/MobileGL/MG_Remote/Protocol/generated/protocol_generated.h b/MobileGL/MG_Remote/Protocol/generated/protocol_generated.h index 8324e1be..d11f5c37 100644 --- a/MobileGL/MG_Remote/Protocol/generated/protocol_generated.h +++ b/MobileGL/MG_Remote/Protocol/generated/protocol_generated.h @@ -822,8 +822,8 @@ struct CapsSnapshot FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table { VT_FORMATCAPS = 8, VT_EXTENSIONS = 10, VT_APIVERSION = 12, - VT_CALLMASK = 14, - VT_BACKENDTYPE = 16 + VT_CALLMASK = 22, + VT_BACKENDTYPE = 24 }; const ::flatbuffers::Vector *dynamicParameters() const { return GetPointer *>(VT_DYNAMICPARAMETERS); diff --git a/MobileGL/MG_Remote/Protocol/protocol.fbs b/MobileGL/MG_Remote/Protocol/protocol.fbs index 0e9d52c3..04402962 100644 --- a/MobileGL/MG_Remote/Protocol/protocol.fbs +++ b/MobileGL/MG_Remote/Protocol/protocol.fbs @@ -98,8 +98,8 @@ table Welcome { // (plan B appendix A, `get_caps`). The three blobs are byte-for-byte images of // the corresponding POD structs; they are versioned by structSize-first // discipline, not by this schema. -// The four fields this table used to end with are DELETED (CONTRACT-P5 table 0, -// "CapsSnapshot redundancy"), not renamed and not deprecated: +// The four fields this table used to end with are RETIRED (CONTRACT-P5 table 0, +// "CapsSnapshot redundancy"): // // maxComputeWorkGroupCount / maxComputeWorkGroupSize - they ride inside // `dynamicParameters` already (BackendObject.h:392-393), and two spellings of @@ -112,13 +112,29 @@ table Welcome { // prefersCpuXfbPrimitiveAccounting - answered by kCapCpuXfbPrimitiveAccounting // in `callMask` below. // -// They were the LAST four fields, so nothing before them moved a vtable slot. +// THEY ARE `(deprecated)`, NOT DELETED, AND THAT IS NOT A STYLE CHOICE. In +// FlatBuffers a table field's id IS its vtable slot, and REMOVING a field FREES +// that slot for the next field appended to the table - so plainly deleting these +// four would have handed slots 14 and 16, which used to carry `[int]` vectors +// (4-byte uoffsets), to `callMask` (an 8-byte inline ulong) and `backendType` (a +// 4-byte inline uint). Two peers straddling that edit both still announce +// abiMajor 1, and the ABI fingerprint mixes struct sizes and a git stamp, not the +// schema, so neither the handshake nor the fingerprint could see it: the reader +// would parse a uoffset as a ulong. `(deprecated)` keeps 14/18/20 burned, pushes +// the two new fields to 22/24, generates no accessor for the retired names so +// nothing can read or write them, and costs zero bytes on the wire. The +// alternative - bumping MOBILEGL_PROTOCOL_ABI_MAJOR - is a real break for a +// change that does not need to be one. table CapsSnapshot { dynamicParameters: [ubyte]; rendererInfo: [ubyte]; formatCaps: [ubyte]; extensions: [string]; apiVersion: string; + maxComputeWorkGroupCount: [int] (deprecated); + maxComputeWorkGroupSize: [int] (deprecated); + tableSlotMask: ulong (deprecated); + prefersCpuXfbPrimitiveAccounting: bool (deprecated); // MGPCaps::CallMask (MGPipeTypes.h:127). Bits 0..8 are MGPCapBit; bits 32..47 // are the CONSUMER MASK - bit (32+n) means "the server has a consumer for // MGPipe subsystem bit n" - and MG_Remote/CapsCodec.h holds the four constexprs