refactor(fspy): simplify shm_io to a plain frame arena - #578
Open
wan9chi wants to merge 1 commit into
Open
Conversation
Member
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced Jul 28, 2026
wan9chi
force-pushed
the
fspy-plain-frame-arena
branch
from
July 28, 2026 11:06
b03e50b to
9485184
Compare
fspy benchmarklinuxmacoswindows |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b03e50b979
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
wan9chi
force-pushed
the
fspy-plain-frame-arena
branch
from
July 28, 2026 11:18
9485184 to
a815712
Compare
wan9chi
force-pushed
the
fspy-close-gate
branch
2 times, most recently
from
July 28, 2026 11:20
2788743 to
e910409
Compare
wan9chi
force-pushed
the
fspy-plain-frame-arena
branch
2 times, most recently
from
July 29, 2026 01:22
98eff10 to
4deba7a
Compare
wan9chi
force-pushed
the
fspy-close-gate
branch
2 times, most recently
from
July 29, 2026 02:14
1d7e957 to
0f5db93
Compare
wan9chi
force-pushed
the
fspy-plain-frame-arena
branch
from
July 29, 2026 02:14
4deba7a to
d5fee65
Compare
wan9chi
force-pushed
the
fspy-plain-frame-arena
branch
2 times, most recently
from
July 30, 2026 02:14
43075cc to
b8e397b
Compare
wan9chi
force-pushed
the
fspy-plain-frame-arena
branch
from
July 30, 2026 03:24
b8e397b to
b6e4c6e
Compare
wan9chi
force-pushed
the
fspy-plain-frame-arena
branch
from
July 30, 2026 03:43
b6e4c6e to
fb46de4
Compare
wan9chi
force-pushed
the
fspy-close-gate
branch
2 times, most recently
from
July 30, 2026 03:48
4fb1a00 to
38d6107
Compare
wan9chi
force-pushed
the
fspy-plain-frame-arena
branch
2 times, most recently
from
July 30, 2026 03:51
d341ace to
b5602be
Compare
wan9chi
force-pushed
the
fspy-plain-frame-arena
branch
from
July 30, 2026 04:11
b5602be to
2ecce74
Compare
wan9chi
force-pushed
the
fspy-plain-frame-arena
branch
from
July 30, 2026 04:36
2ecce74 to
7c7e5c2
Compare
wan9chi
force-pushed
the
fspy-close-gate
branch
2 times, most recently
from
July 30, 2026 06:12
5d642d1 to
cdff4d6
Compare
wan9chi
force-pushed
the
fspy-plain-frame-arena
branch
from
July 30, 2026 06:12
7c7e5c2 to
37a65cf
Compare
wan9chi
force-pushed
the
fspy-plain-frame-arena
branch
from
July 30, 2026 07:12
37a65cf to
c43a320
Compare
wan9chi
force-pushed
the
fspy-plain-frame-arena
branch
2 times, most recently
from
July 30, 2026 07:41
394709d to
37f066a
Compare
wan9chi
force-pushed
the
fspy-close-gate
branch
2 times, most recently
from
July 30, 2026 07:50
cf1eb75 to
652efbd
Compare
wan9chi
force-pushed
the
fspy-plain-frame-arena
branch
from
July 30, 2026 07:50
37f066a to
23d95d9
Compare
wan9chi
force-pushed
the
fspy-plain-frame-arena
branch
2 times, most recently
from
July 30, 2026 08:18
a37218d to
d27bdce
Compare
wan9chi
force-pushed
the
fspy-close-gate
branch
2 times, most recently
from
July 30, 2026 08:45
13daf7e to
56c129b
Compare
wan9chi
force-pushed
the
fspy-plain-frame-arena
branch
2 times, most recently
from
July 30, 2026 09:03
d4ac10b to
000892d
Compare
The gated API reads shared memory only when the gate is closed and nothing was in flight, which proves every claimed frame was fully written and published. The three-state frame header (`0` / `+size` / `-size`), the atomic header stores and the release fences existed so a reader could tolerate crashed or in-flight writers — states that are unreachable through the gate. Delete them. A frame is now `| size: u32 | content | padding |`, written once at claim time with a plain store, and the arena keeps exactly one atomic: its end offset. Crash exclusion lives entirely in the gate, where a leaked count fails closed — the run is not cached — instead of being parsed around. The arena also stops being a surface of its own and becomes an internal of the gated module. No public API change: `GatedShmWriter`, `GatedShmReceiver`, `GatedShmReader`, `FrameMut`, `ClaimError` and `StillWriting` keep their signatures, so the channel layer, the fspy crate and both preload clients are untouched. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
wan9chi
force-pushed
the
fspy-plain-frame-arena
branch
from
July 30, 2026 09:07
000892d to
befccd8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Motivation
The gated API reads shared memory only when the gate is closed and nothing was in flight, which proves every claimed frame was written in full; the gate guard is released after the frame drops. The three-state frame header (
0/+size/-size), the atomic header stores and the release fences inshm_ioexisted so a reader could tolerate crashed or in-flight writers. Those states are unreachable through the gated API.This PR deletes them. The arena keeps one atomic, its end-offset word. A frame becomes
| size: u32 | content | padding |, written once at claim time with a plain store: the claim made the range exclusive, and the gate release publishes the content. Crash exclusion lives in the gate, where a leaked count means the run is not cached. The arena stops being a public surface and becomes an internal of the gated module.Mapping::as_slicegoes away with its last caller, which leavesfspy_shmwithout unsafe API.write_encodedenters the gate before it sizes the value, so a post-close call reportsClaim(Closed)for any value, including one that encodes to zero bytes.No public API change:
GatedShmWriter,GatedShmReceiver,GatedShmReader,FrameMut,ClaimErrorandStillWritingkeep their signatures. The channel layer, the fspy crate and both preload clients are untouched.🤖 Generated with Claude Code