Skip to content

feat(gen)!: replace serde generator with zero-copy codec - #5

Merged
NathanFlurry merged 21 commits into
mainfrom
zero-copy-codec
Oct 19, 2026
Merged

NathanFlurry merged 21 commits into
mainfrom
zero-copy-codec

Conversation

@NathanFlurry

@NathanFlurry NathanFlurry commented Oct 18, 2026 •

Copy link
Copy Markdown
Member
  • Vendor the BARE schema parser from bare_proc 0.2.0 through a pinned regenerate script and checked-in patch, with MIT attribution
  • Support explicit union tags and enum values, and report schema errors instead of panicking
  • Validate schemas against the BARE specification's invariants
  • Add a zero-copy runtime: verify-once views, Bytes/Str-backed owned values, list and map views, Encode/Sink, and a Versioned trait
  • Replace the serde/serde_bare generator with a from-scratch generator emitting views, borrowed refs, and owned types
  • Follow the BARE spec where the previous generator diverged: explicit enum values, data[N] and list<T>[N] longer than 32
  • Decode strictly: reject invalid bools and optional tags, non-minimal varints, duplicate map keys, and trailing bytes
  • Add a conformance suite checking byte identity against bare_proc + serde_bare and bare-ts, the spec's example vectors, rejection cases, allocation counts, differential fuzzing, and benchmarks
  • Bump the Rust crates to 0.2.0 (breaking API change; wire format unchanged except for the spec fixes above)
  • Decode owned values in a single pass over the input
  • Add opt-in serde derives on generated owned types
  • Add Versioned slice helpers under the 0.1 names, void message encoding, and envelopes whose latest value is not a schema type
  • Seal versioned messages into caller-provided buffers
  • Detach decoded strings and messages from their source buffer so small fields do not keep large inputs alive
  • Compile the example schemas in compiler tests and drop the indoc dependency

@NathanFlurry
NathanFlurry marked this pull request as ready for review October 19, 2026 03:28
@NathanFlurry
NathanFlurry merged commit 119b7b8 into main Oct 19, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant