From 40e342f2217bc9639751f258b76c36cdd1f0334f Mon Sep 17 00:00:00 2001 From: charles Date: Mon, 4 May 2026 23:12:20 -0700 Subject: [PATCH] Document Protobuf spec validation --- README.md | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7f99f06..9b0648b 100644 --- a/README.md +++ b/README.md @@ -283,6 +283,29 @@ after parsing is faster. For workloads that read every field the costs invert; for workloads that read a handful of fields from large messages roto wins. -## Literature +## Protobuf Spec Validation -https://protobuf.dev/programming-guides/encoding/ +The goal is to validate roto's implementation against the Proto3 specification. + +### Supported Features + +- **Scalar Types**: `double`, `float`, `int32`, `int64`, `uint32`, `uint64`, `sint32`, `sint64`, `fixed32`, `fixed64`, `sfixed32`, `sfixed64`, `bool`, `string`, `bytes`. +- **Messages**: Top-level and nested message definitions. +- **Enums**: Enum definitions with `from_i32` conversion. +- **Field Labels**: Singular and `repeated` fields. + +### Unsupported Features + +- **`oneof` Fields**: Not currently supported in code generation. +- **`map` Fields**: Not currently supported. +- **Packed Repeated Fields**: `roto` expects individual tags for all repeated elements; it does not support the packed encoding used for scalar numeric types in Proto3. +- **Reserved Fields**: `reserved` statements are ignored. +- **Services**: `service` and `rpc` definitions are ignored. +- **Options**: Field and message options are ignored. + +### Tasks + +- [x] Analyze `roto/codegen` to determine which protobuf constructs are supported during code generation. +- [x] Analyze `roto/runtime` to determine which wire types and protobuf types are supported during reading and writing. +- [x] Compare findings with the Proto3 spec (https://protobuf.dev/reference/protobuf/proto3-spec/). +- [x] Document supported and unsupported features in the README.