Repository navigation
Fixed
pxf.Decimal.scaleandpxf.BigFloat.exponentare plain varints on the
PB wire (#55).Protowire.Pbread and wrote both with zigzag, but
bignum.protodeclares themint32, so it disagreed with every other
port on every non-zero value: a wire scale of 2 read as 1, and 4096 as
2048. Bytes written by earlier versions read back wrong. This is the
bug protowire-go fixed in protowire-go#96 (STABILITY.md § v1.13).- A zero magnitude is empty on the PB wire.
Protowire.Pbwrote a zero
BigInt,Decimal.unscaledorBigFloat.mantissaas one0byte, and
kept aBigFloatzero's exponent. A zero now has the one encoding
STABILITY.md § v1.13 describes. Earlier bytes still decode.
Changed
-
The vendored shared schemas are re-synced with trendvidia/protos v0.1.2 (trendvidia/protowire#447). They gain protos' file options, and
envelope.proto'sgo_packagenow names a published package. Declarations and field numbers are unchanged, and so is this port's public API. -
Proto bindings are regenerated by
tool/generate.sh, notbuf generate
(#24).buf generate protowrote tosrc/Pxf/,src/Envelopes/,
src/Sbe/— directories no project compiles — while the compiled
copies under each project'sGenerated/folder were left as they were,
and the SPDX header was lost on every run.buf.gen.yamlnow targets a
gitignored.generated/staging tree; the script moves each file to the
project that compiles it, prepends the header, and refuses output it
has no table row for.tool/generate.sh --checkruns in CI and fails on
drift, a missing header, or an orphaned binding. The four committed
stray copies are removed. -
A map's
{and every PB map entry count toward the nesting limit
(protowire#449, HARDENING.md § Recursion). The PXF decoder did not count
a map's own{, and PB counted neither a map entry nor anything about a
scalar-valued one, so maps could nest past the limit in both. This
narrows what decodes: a document nesting maps past 50 levels is now
rejected, as it is by the text parser here and by protowire-go.
check-decode'sTreegainsbranchesandtags. Without them the
corpus rows for this were skipped as unknown fields and tested nothing.
Added
-
Quoted entry names and keyed repeated fields (#15, trendvidia/protowire#116). The parser accepts a string as a field-entry name and the AST keeps the unquoted value plus
Assignment.KeyQuoted/Block.NameQuoted, soFormatreproduces the spelling.(pxf.key)= 1316 is back inproto/pxf/annotations.proto, and a repeated message field carrying it can be written as a block of named blocks: the entry name fills the key field and entry order is list order. The decoder rejects duplicate names (compared unquoted), an empty key in either surface form, an entry name that disagrees with an explicit key assignment, and a quoted name outside a keyed block, asKeyedExceptionwith aKeyedErrorKind. The encoder writes the keyed form whenever every key is present, non-empty and distinct, and the anonymous list form otherwise.Keyed.Canonicalizeis the schema-aware half of fmt; run it beforeFormat.FormatDocument.Schema.ValidateDescriptorandSchema.ValidateFilereport misplaced(pxf.key)annotations across the import closure, andDecoderrefuses such a schema. The pb and SBE wire outputs do not change. The cross-port fixtures from the spec repo'stestdata/keyedare vendored undertests/Protowire.Pxf.Tests/testdata/keyedand all run. -
dump-envelope --pb FDS MESSAGE DOCand--sbe FDS MESSAGE DOC(#26),
the two legs of protowire'scross_envelope_check.shthat prove a port
reads(pxf.required)= 1314,(pxf.default)= 1315 and the SBE
numbers 1319–1323 from a schema.Decoder.UnmarshalFullandSbe.Codec
already read them from the generated types' descriptors; the dumper maps
MESSAGEto those types (settings.v1.Settingsgenerated from a copy of
protowire'stestdata/annotations/settings.proto,bench.v1.Orderfrom
sbe-bench.proto) and reads FDS only to check it declaresMESSAGE.
Fixed
-
MaxNumericLiteralDigitsis enforced (#34, HARDENING.md § Mandatory
limits). The port had no digit cap, so a big-number literal of any length
reachedBigInteger.Parse, on generated messages, POCOs and
(pxf.default)strings alike. Apxf.BigInt,pxf.Decimalor
pxf.BigFloatliteral of exactly 4096 significant digits now decodes and
one digit more is rejected naming the limit. Leading zeros, the sign, the
point, an exponent and a precision suffix are not counted (protowire#410).
Apxf.Decimalliteral's scale is bounded by the same number.
check-decodelinksadversarial.v1.BigNumHolder. It did not, so
pxf/long-numericwas rejected as an unknown schema, never by a cap. -
uint32/uint64fields decode (#26). The reflection decode path
had no branch foruintorulong, so a generated message with either
was rejected withunsupported type System.UInt64; protowire's shared
sbe-bench.pxftripped it atorder_id. -
(pxf.required)with(pxf.default)on one field is refused when the
schema is bound (#57, draft -01 "Required and Default").Decoderused
to accept such a schema, and which option won depended on whether the
document omitted the field and on which engine read it.Unmarshaland
UnmarshalFullnow check the file declaring the bound message and its
transitive imports before reading the document, and
Schema.ValidateDescriptor/Schema.ValidateFilereport the same
violations.(pxf.required) = falsebeside a default stays accepted.
[PxfRequired]with[PxfDefault]on one property of a hand-written type
is refused the same way. -
Nesting depth counts every descent, from a root at depth 0 (#33,
HARDENING.md § Recursion). The PXF decoder did not count a[, so
children = [{ … }]nested twice as deep as the limit said, and it did
not bound a value skipped for an unknown field at all; both now count
from the enclosing body. AnAnybody written asdetails { @type … }
counted its one{twice, and so did the text parser for a directive
body, which rejected a document one level short of the limit. PB now
counts a map entry as a descent when its value is a message.
check-decode'sTreegains thechildrenfield the corpus rows
pxf/deep-nesting-lists-100/-101use. Without it those rows were
skipped as an unknown field and never reached the list decoder.