GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — refactor(fspy): simplify shm_io to a plain frame arena by wan9chi · Pull Request #578 · voidzero-dev/vite-task

Conversation

@wan9chi

@wan9chi wan9chi commented Jul 28, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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 in shm_io existed 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_slice goes away with its last caller, which leaves fspy_shm without unsafe API.

write_encoded enters the gate before it sizes the value, so a post-close call reports Claim(Closed) for any value, including one that encodes to zero bytes.

No public API change: GatedShmWriter, GatedShmReceiver, GatedShmReader, FrameMut, ClaimError and StillWriting keep their signatures. The channel layer, the fspy crate and both preload clients are untouched.

🤖 Generated with Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
This was referenced Jul 28, 2026
fix(fspy): unify shared memory on a sparse temp file across all platforms #576
Merged
fix(fspy): replace the IPC file lock with an in-mapping close gate #577
Closed
@wan9chi
wan9chi force-pushed the fspy-plain-frame-arena branch from b03e50b to 9485184 Compare July 28, 2026 11:06
@github-actions

github-actions Bot commented Jul 28, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

fspy benchmark

linux

dynamic/launch             change  +0.64%  [ -6.76% ..  +8.56%]  overhead  +288.50%
dynamic/access             change  +1.18%  [ -6.61% .. +12.48%]  overhead    +9.79%
dynamic/access-relative    change  +1.84%  [ -7.34% .. +10.01%]  overhead   +45.76%
static/launch              change  +0.35%  [ -6.44% ..  +7.33%]  overhead  +646.36%
static/access              change  -0.70%  [ -7.58% ..  +5.74%]  overhead  +819.38%
static/access-relative     change  +0.71%  [ -9.72% ..  +9.33%]  overhead +1130.59%

macos

dynamic/launch             change  +0.41%  [ -3.70% ..  +4.00%]  overhead  +224.63%
dynamic/access             change  -0.34%  [ -2.66% ..  +1.38%]  overhead    +6.14%
dynamic/access-relative    change  -0.21%  [ -2.22% ..  +3.22%]  overhead  +264.51%

windows

dynamic/launch             change  +0.32%  [ -3.60% ..  +3.66%]  overhead   +26.60%
dynamic/access             change  +0.00%  [ -1.28% ..  +1.12%]  overhead    +1.69%
dynamic/access-relative    change  -0.18%  [ -0.73% ..  +0.55%]  overhead    +1.46%
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chatgpt-codex-connector[bot]
chatgpt-codex-connector Bot reviewed Jul 28, 2026
View reviewed changes

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

💡 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".

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread crates/fspy_shared/src/ipc/channel/gated.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

@wan9chi
wan9chi force-pushed the fspy-plain-frame-arena branch from 9485184 to a815712 Compare July 28, 2026 11:18
@wan9chi
wan9chi force-pushed the fspy-plain-frame-arena branch 2 times, most recently from 98eff10 to 4deba7a Compare July 29, 2026 01:22
@wan9chi
wan9chi force-pushed the fspy-plain-frame-arena branch from 4deba7a to d5fee65 Compare July 29, 2026 02:14
@wan9chi
wan9chi force-pushed the fspy-plain-frame-arena branch 2 times, most recently from 43075cc to b8e397b Compare July 30, 2026 02:14
@wan9chi
wan9chi force-pushed the fspy-plain-frame-arena branch from b8e397b to b6e4c6e Compare July 30, 2026 03:24
@wan9chi
wan9chi force-pushed the fspy-plain-frame-arena branch from b6e4c6e to fb46de4 Compare July 30, 2026 03:43
@wan9chi
wan9chi force-pushed the fspy-plain-frame-arena branch 2 times, most recently from d341ace to b5602be Compare July 30, 2026 03:51
@wan9chi
wan9chi force-pushed the fspy-plain-frame-arena branch from b5602be to 2ecce74 Compare July 30, 2026 04:11
@wan9chi
wan9chi force-pushed the fspy-plain-frame-arena branch from 2ecce74 to 7c7e5c2 Compare July 30, 2026 04:36
@wan9chi
wan9chi force-pushed the fspy-plain-frame-arena branch from a37218d to d27bdce Compare July 30, 2026 08:18
@wan9chi
wan9chi force-pushed the fspy-plain-frame-arena branch 2 times, most recently from d4ac10b to 000892d Compare July 30, 2026 09:03
@wan9chi
wan9chi force-pushed the fspy-plain-frame-arena branch from 000892d to befccd8 Compare July 30, 2026 09:07
@wan9chi
wan9chi force-pushed the fspy-plain-frame-arena branch from befccd8 to 4a6f37a Compare July 31, 2026 06:31
@wan9chi
wan9chi force-pushed the fspy-plain-frame-arena branch 2 times, most recently from 1bb2940 to e052585 Compare August 4, 2026 10:17
@wan9chi
wan9chi force-pushed the fspy-plain-frame-arena branch from e052585 to cc1597c Compare August 4, 2026 10:21
@wan9chi
wan9chi force-pushed the fspy-plain-frame-arena branch from cc1597c to f22bcdd Compare August 10, 2026 06:59
@wan9chi
wan9chi force-pushed the fspy-plain-frame-arena branch 2 times, most recently from 94c32e9 to c314777 Compare August 10, 2026 07:07
@wan9chi
wan9chi force-pushed the fspy-plain-frame-arena branch from c314777 to 000a881 Compare August 10, 2026 07:26
@wan9chi @claude
refactor(fspy): simplify shm_io to a plain frame arena
2bf69b4
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 <[email protected]>
@wan9chi
wan9chi force-pushed the fspy-plain-frame-arena branch from 000a881 to 2bf69b4 Compare August 10, 2026 07:32
@wan9chi
wan9chi marked this pull request as draft August 10, 2026 07:32
@wan9chi

wan9chi commented Nov 4, 2026

Copy link
Copy Markdown
Member Author

Superseded by #675.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@wan9chi wan9chi closed this Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@chatgpt-codex-connector chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@wan9chi
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.