Skip to content

refactor(fspy): return resolved paths without callbacks - #607

Merged
wan9chi merged 1 commit into
agent/sigsafe-cstr-pathsfrom
agent/sigsafe-fs-wrappers
Aug 9, 2026
Merged

refactor(fspy): return resolved paths without callbacks#607
wan9chi merged 1 commit into
agent/sigsafe-cstr-pathsfrom
agent/sigsafe-fs-wrappers

Conversation

@wan9chi

@wan9chi wan9chi commented Aug 9, 2026

Copy link
Copy Markdown
Member

Motivation

to_absolute_path still exposes each resolved path through a callback even though every intercepted call can provide a signal-safe arena. Accept that allocator directly and return the resolved path instead.

The return type is sigsafe::CStr<Fat> rather than a plain BStr, because execveat forwards the result to a real exec, which needs a terminator. Carrying that in the type means an implementation cannot hand the exec unterminated bytes; callers wanting the path without the NUL use as_bytes.

Descriptor resolution continues to produce a vector, so relative pathnames and the trailing NUL are appended to that same storage before it is left in the arena. Already-absolute inputs return their original C string with no allocation at all. execveat resolves once and makes one handle_exec call.

@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown

fspy benchmark

linux

dynamic/launch             change  +0.52%  [ -4.11% ..  +5.23%]  overhead   +53.96%
dynamic/access             change  +0.77%  [-10.47% ..  +3.18%]  overhead    +8.19%
dynamic/access-relative    change  -0.20%  [ -1.26% ..  +0.88%]  overhead   +47.17%
static/launch              change  +0.87%  [ -5.86% ..  +8.23%]  overhead  +152.71%
static/access              change  +0.44%  [ -1.38% ..  +1.57%]  overhead  +833.04%
static/access-relative     change  +0.08%  [ -1.39% ..  +1.61%]  overhead +1340.79%

macos

dynamic/launch             change  -0.08%  [ -1.73% ..  +1.82%]  overhead  +214.04%
dynamic/access             change  +0.00%  [ -1.54% ..  +1.96%]  overhead    +2.76%
dynamic/access-relative    change  +0.89%  [ -1.19% ..  +2.63%]  overhead  +262.37%

windows

dynamic/launch             change  -0.08%  [ -2.21% ..  +2.46%]  overhead   +28.19%
dynamic/access             change  +0.00%  [ -0.20% ..  +0.79%]  overhead    +1.40%
dynamic/access-relative    change  +0.19%  [ -0.39% ..  +0.58%]  overhead    +1.35%

@wan9chi
wan9chi force-pushed the agent/sigsafe-fs-wrappers branch 16 times, most recently from 7c259c6 to d676f77 Compare August 9, 2026 11:05
@wan9chi wan9chi changed the title feat(sigsafe): add filesystem wrappers refactor(fspy): return arena-backed absolute paths Aug 9, 2026
@wan9chi
wan9chi force-pushed the agent/sigsafe-fs-wrappers branch from d676f77 to 6149e3a Compare August 9, 2026 11:26
@wan9chi
wan9chi changed the base branch from agent/extract-sigsafe-alloc to agent/sigsafe-cstr-paths August 9, 2026 11:29
@wan9chi wan9chi changed the title refactor(fspy): return arena-backed absolute paths refactor(fspy): return resolved paths without callbacks Aug 9, 2026
@wan9chi
wan9chi force-pushed the agent/sigsafe-fs-wrappers branch from 6149e3a to 74fbd2d Compare August 9, 2026 11:37
@wan9chi
wan9chi force-pushed the agent/sigsafe-fs-wrappers branch 2 times, most recently from 341c727 to f4b901d Compare August 9, 2026 11:59
@wan9chi
wan9chi force-pushed the agent/sigsafe-fs-wrappers branch from f4b901d to d312055 Compare August 9, 2026 12:04
@wan9chi
wan9chi force-pushed the agent/sigsafe-fs-wrappers branch from 08b8519 to 959ba48 Compare August 9, 2026 13:03
@wan9chi
wan9chi force-pushed the agent/sigsafe-fs-wrappers branch from 959ba48 to 439c770 Compare August 9, 2026 13:28
@wan9chi
wan9chi force-pushed the agent/sigsafe-fs-wrappers branch from 439c770 to 3e03ebf Compare August 9, 2026 13:36
@wan9chi
wan9chi force-pushed the agent/sigsafe-fs-wrappers branch 2 times, most recently from f5d66b3 to c92665e Compare August 9, 2026 14:09
@wan9chi
wan9chi force-pushed the agent/sigsafe-fs-wrappers branch from c92665e to 965bc90 Compare August 9, 2026 14:46
@wan9chi
wan9chi force-pushed the agent/sigsafe-fs-wrappers branch from 965bc90 to 2c739d4 Compare August 9, 2026 15:21
@wan9chi
wan9chi force-pushed the agent/sigsafe-fs-wrappers branch 2 times, most recently from 2639a29 to cf8c38c Compare August 9, 2026 15:38
@wan9chi
wan9chi force-pushed the agent/sigsafe-fs-wrappers branch 5 times, most recently from 32b29b5 to dc7a94e Compare August 9, 2026 16:03
@wan9chi
wan9chi force-pushed the agent/sigsafe-fs-wrappers branch from dc7a94e to 8846fa8 Compare August 9, 2026 16:26
Co-authored-by: GPT-5 Codex <codex@openai.com>
@wan9chi
wan9chi force-pushed the agent/sigsafe-fs-wrappers branch from 8846fa8 to 9370275 Compare August 9, 2026 16:39
@wan9chi
wan9chi marked this pull request as ready for review August 9, 2026 16:40
@wan9chi
wan9chi merged commit d8195a6 into main Aug 9, 2026
19 checks passed
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