From 40e342f2217bc9639751f258b76c36cdd1f0334f Mon Sep 17 00:00:00 2001 From: charles Date: Mon, 4 May 2026 23:12:20 -0700 Subject: [PATCH 1/2] 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. From e5c2479985d4d7e46d3b1a28081ffd6b4754d4c5 Mon Sep 17 00:00:00 2001 From: charles Date: Mon, 4 May 2026 23:38:11 -0700 Subject: [PATCH 2/2] Document unsupported Proto3 features --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 9b0648b..0f1feb0 100644 --- a/README.md +++ b/README.md @@ -296,6 +296,8 @@ The goal is to validate roto's implementation against the Proto3 specification. ### Unsupported Features +- **Default Values**: Missing fields return `RotoError::FieldNotFound` instead of the Proto3 default value (e.g., `0` or `""`). +- **Field Presence**: No `has_field()` methods are generated to distinguish between a field being absent and a field being set to its default value. - **`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.