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): record seccomp-intercepted accesses in the shared-memory channel by wan9chi · Pull Request #816 · voidzero-dev/vite-task

Conversation

@wan9chi

@wan9chi wan9chi commented Oct 7, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Motivation

fspy reports a run's file accesses as one stream, in the order they were made, and order-based classification of inputs and outputs (#571) relies on that. On Linux the seccomp supervisor broke it: the accesses it intercepted from static binaries were kept in their own arenas and reported after everything the preload library recorded, so a path touched by both a static binary and a dynamically linked process lost its order. Seccomp-only (musl) builds also collected into unbounded arenas, so unlike the other backends they could never report incomplete tracking.

Stacked on #817. Recording seccomp's accesses in the channel adds one fresh page to every static launch, which cost half a millisecond of fault read-ahead until #817 turned read-ahead off.

Changes

  • fspy_seccomp_unotify::supervisor::supervise takes a closure that creates each handler instead of requiring Default.
  • The channel Receiver in fspy_shared gains sender(), which maps the region again for a sender in the receiver's own process.
  • fspy's syscall handler sends each record through that sender before the supervisor lets the syscall continue, following the channel's publish-before-acting rule. The supervisor is still stopped before the channel closes, so the set of collected accesses is unchanged.
  • The channel is no longer compiled out on musl, and the fspy_shm_capacity e2e fixture now runs there too.
  • PathAccessIterable::iter documents that it yields accesses in the order they were made. On Unix, the program-resolution accesses made before the child is spawned now come first.

🤖 Generated with Claude Code

Sorry, something went wrong.

Uh oh!

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

All reactions
@wan9chi wan9chi added the ci: full Run the slow CI jobs (macOS x64, musl) on this pull request label Oct 7, 2026
@github-actions

github-actions Bot commented Oct 7, 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.14%  [ -8.72% ..  +9.42%]  overhead   +57.36%
dynamic/access             change  +0.76%  [ -5.99% .. +20.77%]  overhead   +25.82%
dynamic/access-relative    change  +0.00%  [-11.56% ..  +8.45%]  overhead   +66.65%
dynamic/access-contended   change  -2.55%  [-11.49% .. +16.03%]  overhead   +10.42%
static/launch              change  +1.80%  [ -3.77% .. +13.34%]  overhead  +186.66%
static/access              change  +0.73%  [-13.14% .. +10.87%]  overhead +1360.00%
static/access-relative     change  +0.03%  [-10.12% .. +16.40%]  overhead +1643.41%
static/access-contended    change  +1.65%  [ -5.45% ..  +9.37%]  overhead +1183.37%

macos

dynamic/launch             change  +0.18%  [ -5.98% ..  +6.10%]  overhead  +224.19%
dynamic/access             change  -0.34%  [ -2.78% ..  +2.20%]  overhead    +3.28%
dynamic/access-relative    change  +0.10%  [ -3.17% ..  +3.66%]  overhead  +269.94%
dynamic/access-contended   change  +0.13%  [-20.96% .. +20.36%]  overhead    +1.95%

windows

dynamic/launch             change  -0.23%  [ -4.60% ..  +5.21%]  overhead   +26.58%
dynamic/access             change  +0.18%  [ -1.91% ..  +3.28%]  overhead    +1.26%
dynamic/access-relative    change  +0.17%  [ -2.05% ..  +9.59%]  overhead    +1.59%
dynamic/access-contended   change  +0.68%  [ -2.43% ..  +5.05%]  overhead    +3.10%
All reactions

Sorry, something went wrong.

Uh oh!

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

@wan9chi wan9chi mentioned this pull request Oct 7, 2026
perf(fspy): turn off fault read-ahead in shared-memory mappings #817
Merged
@wan9chi
wan9chi force-pushed the claude/seccomp-unotify-shared-memory-672988 branch from 50c7ab4 to 5868e35 Compare October 7, 2026 13:33
@wan9chi
wan9chi changed the base branch from main to claude/fspy-shm-no-fault-readahead October 7, 2026 13:34
@wan9chi
wan9chi added this pull request to stack #818 October 7, 2026 13:34
@wan9chi
wan9chi force-pushed the claude/seccomp-unotify-shared-memory-672988 branch from 5868e35 to 2e34a86 Compare October 7, 2026 13:47
@wan9chi @claude
refactor(fspy): record seccomp-intercepted accesses in the shared-mem…
792565f
…ory channel

The seccomp supervisor kept intercepted accesses in per-listener arenas
that were reported after the preload library's records, so their order
relative to the accesses of dynamically linked processes was lost. The
supervisor now sends them through the same shared-memory channel, using
a sender the receiver creates in its own process.

The channel is now built on musl too, so seccomp-only builds share the
channel's capacity limit and its incomplete-tracking report. The path
access iterator documents that it yields accesses in the order they were
made, and now yields program-resolution accesses, made before the child
is spawned, first.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@wan9chi
wan9chi force-pushed the claude/seccomp-unotify-shared-memory-672988 branch from 2e34a86 to 792565f Compare October 7, 2026 13:51
@wan9chi
wan9chi merged commit 1651151 into main Oct 7, 2026
19 checks passed

Uh oh!

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

@wan9chi
wan9chi deleted the claude/seccomp-unotify-shared-memory-672988 branch October 7, 2026 14:01
wan9chi added a commit that referenced this pull request Oct 7, 2026
@wan9chi @claude
perf(fspy): turn off fault read-ahead in shared-memory mappings (#817)
b13fce1
## Motivation

On Linux, every tracked launch pays about half a millisecond for each
page of the shared-memory channel written for the first time. #675
recorded this as a known launch regression and put it down to
journalling. The cause is fault read-ahead: a fault in a shared file
mapping reads ahead the pages around it, and in the sparse backing file
those are holes the kernel fills with zeros. Removing the file then
costs as much again, to drop those zero pages.

#816 records the accesses that seccomp intercepts in the same channel,
which adds a fresh page to every static launch, and the fspy benchmark
showed it as a +75% `static/launch` regression.

In a Linux VM writing to ext4, a first write to a fresh page took about
470 µs and removing the file about 355 µs. With the mapping advised
`MADV_RANDOM`, they took about 2.5 µs and 8 µs, and the benchmark's
`dynamic/launch` and `static/launch` rows dropped by about half against
`main`. macOS first writes already take a few microseconds, and the
advice does not change them.

## Changes

- `fspy_nostd::mm::madvise` with `Advice::Random`: a raw syscall on
Linux, so it stays usable from the preload library, and libc on macOS.
- `fspy_shm` advises every Unix mapping `MADV_RANDOM`. The advice is
best effort: a refusal leaves a working mapping.
- The `shm_io` README explains the cost in place of the journalling
explanation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
@wan9chi wan9chi mentioned this pull request Nov 4, 2026
☂️ New Linux file tracking backend #932
Open
@wan9chi wan9chi added the linux backend The new Linux file tracking backend label Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

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

Assignees

No one assigned

Labels

ci: full Run the slow CI jobs (macOS x64, musl) on this pull request linux backend The new Linux file tracking backend

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.