Repository navigation
[#643] Remove the protobuf extension ranges - #650
Merged
Merged
Conversation
Per the spec team decision. All 16 extension ranges are removed, along with the TypedValueExtension message, which existed only to host one, and the extension_value arm of the TypedValue oneof. They had never been used. There is no extend statement anywhere in the specification, Tahu 3.x, Tahu develop or the TCK, and no hand-written call to the extension API in any of them, after three major versions of being reserved. They were not free. Six changes in v4 development moved a floor - typed Commands, the metadata separation, the topic namespace change, the header/content split, TemplateList, and the ValueArray in eclipse-sparkplug#649 - each a theoretical break for any third party occupying the numbers being vacated, for no actual third party. They also did not work in the JSON encoding. The Protocol Buffers JSON Mapping is specified for proto3, which has no extensions, so eclipse-sparkplug#645 had to invent three statements defining the bracketed key form, and an extension still survived a binary round trip but not a JSON one. Those three statements are removed with the mechanism, and the rationales that rested on extension ranges are reworded to rest on the ordinary unknown-field rule instead. array_value takes field number 16, which the extension arm freed, rather than leaving a gap at 16 with the array at 17. Not a wire change for anything that exists: a payload exercising metrics, a DataSet and a null cell serializes byte-identically under both schemas, and each decodes the other's output.
ibinshtok
approved these changes
Nov 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #643. Per the spec team decision to remove them.
Stacked on #649 — it is based on that branch because #649 adds a
ValueArraywhose range wouldotherwise need removing separately, and both touch the same messages. Merge after it.
What is removed
TypedValueExtension, a message that existed only to host a rangeextension_valuearm of theTypedValueoneofarray_valuetakes field number 16, which the extension arm freed, rather than leaving a gap at16 with the array sitting at 17.
Why
Never used. No
extendstatement anywhere in the specification, Tahu 3.x, Tahu develop or theTCK, and no hand-written call to the extension API in any of them — after three major versions of
being reserved.
Not free. Six changes during v4 development moved a floor: typed Commands (#441/#442), the
metadata separation (#445/#448), the topic namespace change (#598), the header/content split (#622),
TemplateList (#450), and the
ValueArrayin #649. Each was a theoretical break for a third partyoccupying the numbers being vacated, for no third party that exists.
Did not work in JSON. The Protocol Buffers JSON Mapping is specified for proto3, which has no
extensions, so #645 had to invent
payloads-json-extension-key,-extension-valueand-extension-ignoreto define the bracketed[fully.qualified.name]form. Even then an extensionsurvived a binary round trip but not a JSON one, because an unrecognized key is dropped on output
and rejected on input — so a third party's field lived on spCv4.0 and vanished on spJv4.0.
Those three statements go with the mechanism. The rationales that leaned on extension ranges — in
the ignore-unknown comment and the self-contained note — are reworded to rest on the ordinary
protobuf unknown-field rule instead, which is what actually provides forward compatibility.
Not a wire change
For anything that exists. A payload exercising metrics, a DataSet and a null cell:
Extension ranges are declarations; removing them changes no encoded byte. The only source-visible
change is
array_valuemoving 17 → 16, which is free because spCv4.0 is unreleased.If a third party does need this later
Nothing is foreclosed. Field numbers can be reserved before any are consumed, and the options
measured on #643 remain available —
reserved N to maxto claim numbers, or a declaredgoogle.protobuf.Structfield, which unlike the ranges works in both encodings and round-trips.Neither needs to be decided now, which is the point of removing a mechanism nobody has asked for.
Verification
Build passes; schema compiles under
protoc. JSON Schema valid draft 2020-12, 22/22 examplepayloads validate, 15/15 negative tests behave as specified. Broken-anchor (10) and tck-id-anomaly
(7) baselines unchanged. No
extensionreference remains anywhere in the specification text.