Skip to content

Add frame codec for length-prefixed nested values#4

Merged
bavulapati merged 1 commit into
mainfrom
frame-codec
Jul 10, 2026
Merged

Add frame codec for length-prefixed nested values#4
bavulapati merged 1 commit into
mainfrom
frame-codec

Conversation

@bavulapati

Copy link
Copy Markdown
Contributor

Adds a frame(codec) primitive: a uint length-prefixed wrapper around an inner codec, byte-for-byte compatible with JS compact-encoding's exports.frame. Wire form is uint(len(inner_bytes)) followed by the inner encoding, with the inner encoded inline (length computed via a throwaway state, matching the JS reference).

This is the runtime layer for encoding non-compact nested structs, which are length-prefixed on the wire. A later hyperschema-python change will emit c.frame(...) for framed nested struct fields.

Additive: no existing codec is touched. Re-exported from __init__.py. 227 tests pass (9 new frame tests + 1 roundtrip row), ruff clean.

@bavulapati bavulapati requested a review from a team July 10, 2026 10:46
@bavulapati bavulapati merged commit 528f77b into main Jul 10, 2026
8 checks passed
@bavulapati bavulapati deleted the frame-codec branch July 10, 2026 10:52
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.

2 participants