Skip to content

Replace pickle with msgspec for IPC serialization#8713

Draft
manzt wants to merge 1 commit intomainfrom
manzt/msgpack-ipc
Draft

Replace pickle with msgspec for IPC serialization#8713
manzt wants to merge 1 commit intomainfrom
manzt/msgpack-ipc

Conversation

@manzt
Copy link
Collaborator

@manzt manzt commented Mar 16, 2026

Pickle serialization across the ZeroMQ IPC boundary is fragile because any change to the command types (renaming, adding/removing fields) can silently break deserialization between the host and kernel processes. msgspec.msgpack gives us a proper (binary) wire format with well-defined schema evolution rules tied to the existing Command struct definitions.

Each Pull channel now constructs a msgspec.msgpack.Decoder[T] from its known message type at creation time. The receiver thread uses this decoder to deserialize incoming messages back into their correct types, leveraging the discriminated union tags already on Command subclasses.

@manzt manzt added the enhancement New feature or request label Mar 16, 2026
@vercel
Copy link

vercel bot commented Mar 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview, Comment Mar 16, 2026 7:18pm

Request Review

Pickle serialization across the ZeroMQ IPC boundary is fragile because
any change to the command types (renaming, adding/removing fields) can
silently break deserialization between the host and kernel processes.
msgspec.msgpack gives us a proper wire format with well-defined schema
evolution rules tied to the existing `Command` struct definitions.

Each Pull channel now constructs a `msgspec.msgpack.Decoder[T]` from its
known message type at creation time. The receiver thread uses this
decoder to deserialize incoming messages back into their correct types,
leveraging the discriminated union tags already on `Command` subclasses.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant