From ac4635f757b610ac082f2d4b968b331f90b2f555 Mon Sep 17 00:00:00 2001 From: "Benedicto Franco Jr." Date: Fri, 30 Oct 2026 18:50:15 -0700 Subject: [PATCH] check_decode: mirror Tree's branches and tags The corpus's Tree gained map branches and map tags (protowire#449). check_decode's PB leg decodes into a hand-written struct, so it skipped both as unknown and the pb/deep-map-101 and pb/deep-scalar-map-101 rows failed for that reason alone. With the fields added, every row passes: the decoders already count a map's { and every PB map entry. The Tree map holds unique_ptr so its value type is complete at the member's declaration, as the standard requires. Advances trendvidia/protowire#449 --- CHANGELOG.md | 8 ++++++++ cmd/check_decode/main.cc | 9 ++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c86ff8d..c827442 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,14 @@ format changes. ## [Unreleased] +### Fixed + +- **`check_decode`'s `Tree` has `branches` and `tags`** (protowire#449). + Without them the PB leg skipped both fields as unknown, so the corpus's + map-depth rows could not reach the decoder's map path. The decoders + needed no change: they already count a map's `{` and every PB map entry + toward `MaxNestingDepth`. + ## [1.1.0] — 2026-09-11 ### Added diff --git a/cmd/check_decode/main.cc b/cmd/check_decode/main.cc index b5a175b..7f65293 100644 --- a/cmd/check_decode/main.cc +++ b/cmd/check_decode/main.cc @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -111,10 +112,16 @@ struct Tree { std::unique_ptr child; std::string label; std::vector children; + // Held by pointer so the map's value type is complete here, where the + // standard requires it; the wire form is the same as map. + std::map> branches; + std::map tags; PROTOWIRE_FIELDS(Tree, PROTOWIRE_FIELD(1, child), PROTOWIRE_FIELD(2, label), - PROTOWIRE_FIELD(3, children)) + PROTOWIRE_FIELD(3, children), + PROTOWIRE_FIELD(4, branches), + PROTOWIRE_FIELD(5, tags)) }; struct StringHolder {