Skip to content

Add splitfdstream crate for binary streaming format#229

Merged
cgwalters merged 1 commit intocomposefs:mainfrom
cgwalters:splitfdstream-only
Feb 13, 2026
Merged

Add splitfdstream crate for binary streaming format#229
cgwalters merged 1 commit intocomposefs:mainfrom
cgwalters:splitfdstream-only

Conversation

@cgwalters
Copy link
Copy Markdown
Collaborator

Add a new crate implementing the splitfdstream binary format, which enables streaming tar archives with external file references.

The format uses an 8-byte LE signed prefix followed by optional data:

  • Negative prefix: inline data of size |prefix|
  • Non-negative prefix: external file descriptor reference by index

Key types:

  • SplitfdstreamWriter: Build splitfdstreams with inline/external chunks
  • SplitfdstreamReader: Parse splitfdstreams back into chunks
  • SplitfdstreamTarReader: Read adapter that reconstructs byte streams

This enables zero-copy tar reconstruction from containers-storage's tar-split metadata by streaming headers inline while referencing file content via fd.

Assisted-by: OpenCode (Opus 4.5)

Add a new crate implementing the splitfdstream binary format, which
enables streaming tar archives with external file references.

The format uses an 8-byte LE signed prefix followed by optional data:
- Negative prefix: inline data of size |prefix|
- Non-negative prefix: external file descriptor reference by index

Key types:
- SplitfdstreamWriter: Build splitfdstreams with inline/external chunks
- SplitfdstreamReader: Parse splitfdstreams back into chunks
- SplitfdstreamTarReader: Read adapter that reconstructs byte streams

This enables zero-copy tar reconstruction from containers-storage's
tar-split metadata by streaming headers inline while referencing
file content via fd.

Assisted-by: OpenCode (Opus 4.5)
Signed-off-by: Colin Walters <walters@verbum.org>
@cgwalters
Copy link
Copy Markdown
Collaborator Author

cc @giuseppe

@cgwalters cgwalters requested a review from giuseppe February 13, 2026 13:27
Copy link
Copy Markdown
Collaborator

@giuseppe giuseppe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am fine with the code, but do we want to merge even without consensus on the c/storage side?

LGTM

@cgwalters
Copy link
Copy Markdown
Collaborator Author

This PR just adds new internal crate that has zero impact here unless enabled, it's dead code.

But I think you and I are making the call on splitfdstream right? Unless someone else shows interest or opinion... The higher level IPC is IMO a distinct topic.

@cgwalters cgwalters merged commit b9163a8 into composefs:main Feb 13, 2026
15 checks passed
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