Skip to content

refactor(fspy): own macOS shared-memory mapping - #526

Merged
wan9chi merged 18 commits into
mainfrom
macos-shm-backend
Jul 11, 2026
Merged

refactor(fspy): own macOS shared-memory mapping#526
wan9chi merged 18 commits into
mainfrom
macos-shm-backend

Conversation

@wan9chi

@wan9chiwan9chi commented Jul 9, 2026

Copy link
Copy Markdown
Member

Motivation

Replace the last shared_memory backend and remove the dependency from the workspace.

Changes

  • Implements macOS shared memory with POSIX shm_open and memmap2.
  • Uses the full POSIX object name as the identifier passed to open.
  • Derives the mapping length from the opened POSIX object.
  • Generates names from URL-safe UUIDs and retries name collisions.
  • Unlinks the name when the owner is dropped or creation fails.
  • Keeps existing views valid after unlink while rejecting later opens.
  • Removes shared_memory and its unused transitive dependencies.

@wan9chiGraphite App

wan9chi commented Jul 9, 2026

Copy link
Copy Markdown
MemberAuthor

@wan9chi
wan9chiforce-pushed the windows-sparse-shm branch from 2ee5a9c to a7e9506CompareJuly 9, 2026 05:13
@wan9chi
wan9chiforce-pushed the macos-shm-backend branch 2 times, most recently from 53d767e to fe06fe8CompareJuly 9, 2026 05:23
@wan9chi
wan9chiforce-pushed the windows-sparse-shm branch from a7e9506 to 41e4c55CompareJuly 9, 2026 05:23
@wan9chi
wan9chiforce-pushed the macos-shm-backend branch from fe06fe8 to dfa0cdeCompareJuly 9, 2026 05:29
@wan9chi
wan9chiforce-pushed the windows-sparse-shm branch 2 times, most recently from 4190b5e to b38ebb3CompareJuly 9, 2026 05:36
@wan9chi
wan9chiforce-pushed the macos-shm-backend branch from dfa0cde to c681ad5CompareJuly 9, 2026 05:36
@wan9chi
wan9chi marked this pull request as ready for review July 9, 2026 05:42
@wan9chi
wan9chiforce-pushed the windows-sparse-shm branch from b38ebb3 to daf99c3CompareJuly 9, 2026 07:58
@wan9chi
wan9chiforce-pushed the macos-shm-backend branch from c681ad5 to 3b57093CompareJuly 9, 2026 07:58
@wan9chi
wan9chiforce-pushed the windows-sparse-shm branch from daf99c3 to a9b45dcCompareJuly 9, 2026 14:17
@wan9chi
wan9chiforce-pushed the macos-shm-backend branch from 3b57093 to e37f423CompareJuly 9, 2026 14:18
@wan9chi
wan9chi marked this pull request as draft July 10, 2026 01:16
@wan9chi
wan9chiforce-pushed the windows-sparse-shm branch from a9b45dc to 0de39b7CompareJuly 10, 2026 06:03
@wan9chi
wan9chiforce-pushed the windows-sparse-shm branch from 0de39b7 to 6df5e61CompareJuly 10, 2026 06:57
@wan9chi
wan9chiforce-pushed the macos-shm-backend branch 2 times, most recently from 502b269 to e3b0be7CompareJuly 10, 2026 07:04
@wan9chi
wan9chiforce-pushed the windows-sparse-shm branch 2 times, most recently from 91edb14 to fd848aaCompareJuly 10, 2026 07:14
@wan9chi
wan9chiforce-pushed the windows-sparse-shm branch from fd848aa to c21af71CompareJuly 10, 2026 07:27
@wan9chi
wan9chiforce-pushed the windows-shm-backend branch 2 times, most recently from d9c88f3 to e476b9cCompareJuly 11, 2026 00:45
@wan9chi
wan9chi changed the base branch from windows-shm-backend to graphite-base/526July 11, 2026 00:48
wan9chiand others added 17 commits July 11, 2026 00:49
Co-authored-by: GPT-5.6 <gpt-5.6@openai.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: GPT-5 Codex <codex@openai.com>
Co-authored-by: GPT-5 Codex <codex@openai.com>
Co-authored-by: GPT-5 Codex <codex@openai.com>
Co-authored-by: GPT-5 Codex <codex@openai.com>
Co-authored-by: GPT-5 Codex <codex@openai.com>
Co-authored-by: GPT-5 Codex <codex@openai.com>
Co-authored-by: GPT-5 Codex <codex@openai.com>
Co-authored-by: GPT-5 Codex <codex@openai.com>
Co-authored-by: GPT-5 Codex <codex@openai.com>
Co-authored-by: GPT-5 Codex <codex@openai.com>
Co-authored-by: GPT-5 Codex <codex@openai.com>
Co-authored-by: GPT-5 Codex <codex@openai.com>
Co-authored-by: GPT-5 Codex <codex@openai.com>
Co-authored-by: GPT-5 Codex <codex@openai.com>
Co-authored-by: GPT-5 Codex <codex@openai.com>
Co-authored-by: GPT-5 Codex <codex@openai.com>
@graphite-app
graphite-appBot changed the base branch from graphite-base/526 to mainJuly 11, 2026 00:49
Co-authored-by: GPT-5 Codex <codex@openai.com>
@wan9chi
wan9chi merged commit 049f3f0 into mainJul 11, 2026
16 checks passed
@wan9chiGraphite App

Copy link
Copy Markdown
MemberAuthor

Merge activity

@wan9chi
wan9chi deleted the macos-shm-backend branch July 11, 2026 00:52
wan9chi added a commit to voidzero-dev/vite-plus that referenced this pull request Jul 15, 2026
Bumps the `vite-task` git dependency from `cb580c2` to `4003f65`.
## Changes
The delta is entirely internal `fspy` (file-access tracking)
shared-memory work — no user-facing CLI flags, config fields, or
behavior changes, so no docs updates were needed.
- **fix(fspy):** use `memfd` for Linux shared memory — automatic
file-access tracking on Linux now works in containers and Kubernetes
runners with limited `/dev/shm` space
([#523](voidzero-dev/vite-task#523),
[#353](voidzero-dev/vite-task#353))
- **perf(fspy):** use sparse Windows shared memory — Windows file-access
tracking now uses sparse temporary backing files where supported,
avoiding upfront allocation of the full backing file on disk
([#524](voidzero-dev/vite-task#524))
- **refactor(fspy):** own macOS shared-memory mapping
([#526](voidzero-dev/vite-task#526))
- **docs/test(fspy):** document shared-memory facade ownership semantics
([#521](voidzero-dev/vite-task#521)); reproduce
constrained dev shm failure
([#522](voidzero-dev/vite-task#522))
The lockfile change reflects this refactor: `fspy` now pulls in `memfd`
and drops `shared_memory`.
## Validation
- `cargo check --workspace` passes — the new `vite-task` compiles
cleanly, confirming no breaking changes on the consuming side (including
`vite_cli_snapshots`, which compiles against vite-task's PTY/snapshot
test crates).
- vite-plus crate tests pass. (One pre-existing, environment-specific
stack overflow in `vite_global_cli`'s
`unknown_argument_detected_with_pass_as_value_hint` clap-parsing test
reproduces identically on `main` and is unrelated to this bump.)
- PTY snapshot output is unchanged by the bump; the remaining local
snapshot diffs in this sandbox are all environmental (no built
`packages/cli/dist`, plus registry TLS/network restrictions), left to
CI, which builds the JS CLI and has registry access.
## Changelog
Full vite-task CHANGELOG diff:
``https://github.com/voidzero-dev/vite-task/compare/cb580c214bb2314fc1f633a3812782c9b3a1d956...4003f65a3e5e3d957ff81b157e85e6ee41cc59fc#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed``
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---
_Generated by [Claude
Code](https://claude.ai/code/session_01YERo1yECf81w37US2Gqnow)_
Co-authored-by: Claude <noreply@anthropic.com>
Sign up for freeto 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

@wan9chi