$ the-wire · showcase
Buffa wires shared descriptor pools, cuts codegen token blow-up
By RepoJournal · Filed · About Anthropic
Buffa's shared descriptor pool mechanism now spans codegen and build, while a new warning catches ungenerated type references.
The shared_descriptor_pool work lands its second and third crates: the plugin path wires the mechanism through codegen [1], and `buffa_build::Config::shared_descriptor_pool(bool)` makes build.rs emit the full-closure `FileDescriptorSet` as a binary sidecar via `include_bytes!` [2]. Land #369 before #370, since the plugin's rejection messages point users to buffa-build for unsupported combinations. Separately, a new `CodeGenWarning::ExcludedPackageFieldRef` flags fields referencing types that are ungenerated or unmapped, with type-granular detection that skips generated types in partially-generated packages [3]. Codegen also switches `FILE_DESCRIPTOR_SET_BYTES` from per-byte integer literals to a byte-string literal, cutting token generation during emission [4]. Finally, JSON serialization now handles message-valued oneof variants with custom `ProtoBox` types by serializing the pointee, and removes the workaround `Serialize` impl from the example [5].
Action items
- → Merge #369 before #370 or release both together anthropics/buffa [immediate]
- → Review the new ExcludedPackageFieldRef warning for false positives in your build anthropics/buffa [plan]
- → Watch byte-string literal change for compile-time impact on large descriptor sets anthropics/buffa [monitor]
References
- [1] codegen: wire shared_descriptor_pool through the plugins ↗ anthropics/buffa
- [2] buffa-build: shared_descriptor_pool with include_bytes! sidecar ↗ anthropics/buffa
- [3] codegen: warn when a kept file references an ungenerated or unmapped type (#292) ↗ anthropics/buffa
- [4] codegen: emit FILE_DESCRIPTOR_SET_BYTES as a byte-string literal ↗ anthropics/buffa
- [5] fix: serialize oneof message pointees for JSON ↗ anthropics/buffa