Skip to content

Add Smithy Model Format (SMF) binary model format - #3305

Open
sugmanue wants to merge 2 commits into
smithy-lang:mainfrom
sugmanue:sugmanue/compact-binary-model-format-take-two
Open

sugmanue wants to merge 2 commits into
smithy-lang:mainfrom
sugmanue:sugmanue/compact-binary-model-format-take-two

Conversation

@sugmanue

Copy link
Copy Markdown
Contributor

Background

  • What do these changes do?
    Add the Smithy Model Format (SMF), a compact binary serialization of a fully resolved Smithy model, as a developer preview. SMF replaces generic JSON parsing with a symbol table, positional shape layouts, a single-byte shape-type enum, a deduplicated trait-value table, and a binary-searchable shape index whose neighbor lists allow computing the closure of a service plus specific operations without parsing unrelated shapes. Includes the reader, writer, LEB128/CRC-32C support, a shared prelude symbol table, a transform CLI command, the spec, and the design document.

  • Why are they important?
    SMF loads 2 to 5 times faster than the JSON AST for a full model and up to about 30 times faster for a selective read of one operation. Selective-read cost is bounded by the operation's closure, not the file size: one operation out of a single file holding all 424 AWS services (405,258 shapes) reads in a median of 3.3 ms versus 826 ms for the whole file. The value is a specified, documented, multi-language binary model format with lower repeated and cold-start load cost and selective loading, for dynamic clients and frequently-invoked command-line tools. It is a load-time format, not a wire format and not a composable build dependency, and it targets Smithy 2.0 semantics.

Testing

  • Unit tests for all components, round-trip coverage, and malformed-input
    rejection tests.
  • Jazzer fuzzing across all reader entry points (full, streaming, selective).
  • AWS model corpus integration tests (-PawsModelsTests): round-trip and
    hot/cold-split fidelity across all 424 models (424/424 pass), plus an aggregate-corpus size and selective-read harness.
  • JMH benchmarks comparing JSON and SMF (assembler, direct, and selective).

Links


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

A compact binary serialization for fully resolved Smithy models,
optimized for fast loading and selective loading of model subsets.
Includes the reader, writer, LEB128/CRC-32C support, selective loading,
hot/cold trait splitting, symbol-referenced dynamic values, a 'transform'
CLI command, the spec and design docs, and tests/benchmarks.
Comment thread .changes/next-release/feature-88d53675f679c90f14d345127809756dbe7447c0.json Outdated

This branch has not been deployed

No deployments
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