Skip to content

refactor(fspy-shared): make the channel allocator-generic - #673

Draft
wan9chi wants to merge 1 commit into
agent/fspy-pooled-bump-renamefrom
agent/fspy-alloc-generic-channel
Draft

refactor(fspy-shared): make the channel allocator-generic#673
wan9chi wants to merge 1 commit into
agent/fspy-pooled-bump-renamefrom
agent/fspy-alloc-generic-channel

Conversation

@wan9chi

@wan9chi wan9chi commented Aug 14, 2026

Copy link
Copy Markdown
Member

Motivation

The end goal is a fully std-free preload, and fspy_shared hardcoding its allocators stands in the way: channel() built its C strings with the global allocator, and sender() reached for a pooled bump internally — an infrastructure crate deciding what memory its callers should use.

channel(), Receiver, and sender() are now generic over an allocator-api2 allocator. The supervisor instantiates with Global; the preloads pass sender() a pooled bump at the call site, keeping the choice of preload-safe memory where the constraint lives. This also sets up the payload-view PR on top, where the preload's allocator choice becomes load-bearing for payload lifetimes.

The lock file path is also generated absolute now: temp_dir() reflects TMPDIR verbatim, which may be relative, and the path travels to processes with other working directories — fixing a latent relative-TMPDIR hazard the shm backing path already handled.

🤖 Generated with Claude Code

@wan9chi wan9chi changed the title agent/fspy alloc generic channel refactor(fspy-shared): make the channel allocator-generic Aug 14, 2026
@github-actions

github-actions Bot commented Aug 14, 2026

Copy link
Copy Markdown

fspy benchmark

linux

dynamic/launch             change  +1.02%  [ -3.18% ..  +6.51%]  overhead   +52.56%
dynamic/access             change  +0.40%  [ -0.67% ..  +1.25%]  overhead    +5.71%
dynamic/access-relative    change  +0.09%  [ -1.02% ..  +1.02%]  overhead   +46.28%
static/launch              change  +0.29%  [ -4.49% ..  +7.15%]  overhead  +143.07%
static/access              change  +0.05%  [ -1.11% ..  +1.33%]  overhead  +809.29%
static/access-relative     change  +0.30%  [ -1.66% ..  +2.36%]  overhead +1318.55%

macos

dynamic/launch             change  -0.16%  [ -4.83% ..  +4.39%]  overhead  +238.06%
dynamic/access             change  +1.07%  [ -6.94% .. +27.51%]  overhead    +6.42%
dynamic/access-relative    change  +0.46%  [ -7.90% ..  +7.94%]  overhead  +215.38%

windows

dynamic/launch             change  -0.00%  [ -4.23% ..  +4.86%]  overhead   +26.66%
dynamic/access             change  -0.54%  [ -2.39% ..  +1.09%]  overhead    +1.31%
dynamic/access-relative    change  +0.18%  [ -1.61% ..  +1.13%]  overhead    +1.12%

channel(), Receiver, and sender() are now generic over an
allocator-api2 allocator instead of hardcoding the global allocator and
an internal pooled bump:

- channel() threads the caller's allocator through the shared-memory
  backing path and the ShmKeeper; the supervisor instantiates with
  Global.
- sender() takes the allocator for its transient shm-path decode from
  the caller, so the choice of preload-safe memory — the preloads pass
  a pooled bump — lives at the call site instead of inside fspy_shared.
- The lock file path is now generated absolute: temp_dir() reflects
  TMPDIR verbatim, which may be relative, and the path travels to
  processes with other working directories.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@wan9chi
wan9chi force-pushed the agent/fspy-alloc-generic-channel branch from e67af66 to a1a77c5 Compare August 14, 2026 08:04
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