Skip to content

feat(fspy_shared): carry opaque abort payload in shm_io - #1055

Merged
wan9chi merged 1 commit into
fspy-loss/5-tracking-incomplete-reasonfrom
fspy-loss/6-shm-io-abort-payload
Dec 2, 2026
Merged

wan9chi merged 1 commit into
fspy-loss/5-tracking-incomplete-reasonfrom
fspy-loss/6-shm-io-abort-payload

Conversation

@wan9chi

@wan9chi wan9chi commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

Motivation

Carrying structured diagnostic reasons (such as why a traced process fell back to running untracked) through the shared-memory channel requires shm_io to transport an opaque abort payload without allocating, blocking, or scanning the frame descriptor table at seal time.

Changes

  • Add an atomic abort_slot descriptor to shm_io's header counters (AbortSlotState, with a dedicated sentinel for 0-byte payloads so empty aborts reserve no payload bytes).
  • Replace ShmWriter::abort with ShmWriter::claim_abort(len) and AbortFrameMut::finish(), publishing the winning payload via Release/Acquire synchronization (rule 4) and falling back to GATE_OVERFLOW if the region has no space left.
  • Return a zero-copy AbortFrame<M> inside SealError::Aborted on ShmReader::seal.
  • Update shm_io/README.md with the abort-path soundness argument and add unit and concurrent tests covering abort payloads, 0-byte aborts, gate precedence, and abort/seal races.

Stack created with GitHub Stacks CLI • Give Feedback 💬

@wan9chi
wan9chi added this pull request to stack #1057 December 2, 2026 10:19
Extend shm_io with an atomic abort_slot descriptor, AbortSlotState
(supporting 0-byte payloads without reserving payload space), wait-free
ShmWriter::claim_abort / AbortFrameMut::finish with Release/Acquire
synchronization (rule 4), and zero-copy AbortFrame<M> returned on
SealError::Aborted.

Update shm_io's README (including the abort-path soundness argument) and
add Miri-verified concurrent abort and abort/seal race tests that read
the payload bytes before joining writer threads.

Co-authored-by: Gemini 4 Neon <noreply@google.com>
@wan9chi
wan9chi force-pushed the fspy-loss/6-shm-io-abort-payload branch from ba9811a to d25463a Compare December 2, 2026 10:20
@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown

fspy benchmark

linux

dynamic/launch             change  +0.27%  [ -5.22% ..  +6.02%]  overhead   +63.33%
dynamic/access             change  +1.17%  [ -6.81% .. +11.66%]  overhead   +20.61%
dynamic/access-relative    change  +0.00%  [ -3.70% ..  +3.15%]  overhead   +72.14%
dynamic/access-contended   change  +0.73%  [ -7.13% ..  +8.81%]  overhead    +2.82%
static/launch              change  +1.57%  [ -3.31% ..  +7.83%]  overhead  +205.96%
static/access              change  +0.09%  [ -2.76% ..  +5.06%]  overhead +1430.38%
static/access-relative     change  +0.58%  [ -2.96% .. +14.89%]  overhead +1938.45%
static/access-contended    change  +0.18%  [ -4.34% ..  +1.88%]  overhead +1859.88%

macos

dynamic/launch             change  -0.26%  [ -3.15% ..  +2.67%]  overhead  +228.48%
dynamic/access             change  +0.01%  [ -1.57% ..  +1.60%]  overhead    +3.59%
dynamic/access-relative    change  +0.21%  [ -3.55% ..  +3.06%]  overhead  +265.84%
dynamic/access-contended   change  +0.37%  [ -2.57% ..  +3.70%]  overhead    +4.12%

windows

dynamic/launch             change  -0.23%  [ -4.09% ..  +2.86%]  overhead   +30.77%
dynamic/access             change  -0.21%  [ -1.61% ..  +0.42%]  overhead    +1.27%
dynamic/access-relative    change  -0.40%  [ -1.22% ..  +1.20%]  overhead    +1.21%
dynamic/access-contended   change  +0.84%  [ -4.20% ..  +3.64%]  overhead    +1.84%

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit d25463a. Configure here.

@wan9chi
wan9chi merged commit d2edc80 into main Dec 2, 2026
22 of 23 checks passed
@wan9chi
wan9chi deleted the fspy-loss/6-shm-io-abort-payload 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