Skip to content

refactor(fspy_shared): type IPC channel and own wincode deserialization - #1053

Merged
wan9chi merged 1 commit into
fspy-loss/3-shm-io-gate-bitsfrom
fspy-loss/4-typed-ipc-channel
Dec 2, 2026
Merged

wan9chi merged 1 commit into
fspy-loss/3-shm-io-gate-bitsfrom
fspy-loss/4-typed-ipc-channel

Conversation

@wan9chi

@wan9chi wan9chi commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

Motivation

fspy_shared::ipc::channel previously owned wincode serialization on the sender side (Sender::send<T>) while leaking shm_io::ShmReader (FrameReader) and raw byte deserialization up into fspy. That split codec ownership across crates and allowed mismatched record types at compile time.

Changes

  • Introduce ChannelProtocol to bind ChannelConf, Sender, Receiver, and RecordReader to a single record schema at compile time while keeping both wincode serialization and deserialization inside fspy_shared::ipc::channel.
  • Remove the leaked FrameReader type alias and split RecordsLost into CloseError::{Capacity, Reported} with domain-neutral documentation.
  • Define AccessProtocol and typed aliases (AccessChannelConf, AccessSender, AccessReceiver, AccessReader, AccessCloseError) in fspy_shared::ipc, updating callers across fspy, fspy_shared_unix, fspy_client_unix, and fspy_preload_windows.

Stack created with GitHub Stacks CLI • Give Feedback 💬

Introduce ChannelProtocol to bind Sender, Receiver, ChannelConf, and
RecordReader to a single record schema at compile time, keeping both
wincode serialization and deserialization inside fspy_shared::ipc::channel.
Remove the leaked shm_io::ShmReader FrameReader alias and split
RecordsLost into CloseError::{Capacity, Reported} with accurate error
messages and domain-neutral docs.

Co-authored-by: Gemini 4 Neon <noreply@google.com>
@wan9chi
wan9chi added this pull request to stack #1057 December 2, 2026 10:19
@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown

fspy benchmark

linux

dynamic/launch             change  +0.45%  [ -4.98% ..  +6.85%]  overhead   +60.23%
dynamic/access             change  -0.44%  [ -6.79% ..  +5.18%]  overhead   +18.92%
dynamic/access-relative    change  +0.62%  [ -3.19% ..  +4.26%]  overhead   +72.92%
dynamic/access-contended   change  +2.56%  [ -4.13% .. +13.26%]  overhead   +50.20%
static/launch              change  +0.06%  [ -3.51% ..  +3.23%]  overhead  +201.70%
static/access              change  +0.06%  [ -0.72% ..  +1.12%]  overhead +1461.29%
static/access-relative     change  +0.94%  [ -1.40% ..  +2.51%]  overhead +1998.68%
static/access-contended    change  -0.02%  [ -1.20% ..  +1.58%]  overhead +1976.80%

macos

dynamic/launch             change  -0.42%  [ -2.91% ..  +2.42%]  overhead  +229.89%
dynamic/access             change  +0.66%  [ -2.06% ..  +3.85%]  overhead    +5.32%
dynamic/access-relative    change  +0.66%  [ -2.63% ..  +3.96%]  overhead  +260.53%
dynamic/access-contended   change  -0.48%  [ -3.23% ..  +1.47%]  overhead    +3.98%

windows

dynamic/launch             change  +0.61%  [ -3.09% ..  +4.47%]  overhead   +26.96%
dynamic/access             change  -0.51%  [ -3.59% ..  +6.48%]  overhead    +2.32%
dynamic/access-relative    change  +0.17%  [ -1.69% ..  +2.66%]  overhead    +1.37%
dynamic/access-contended   change  +0.00%  [ -1.31% ..  +1.12%]  overhead    +2.91%

@wan9chi
wan9chi merged commit 7d80538 into main Dec 2, 2026
23 checks passed
@wan9chi
wan9chi deleted the fspy-loss/4-typed-ipc-channel branch December 2, 2026 10:34
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