Skip to content

refactor(cache): extract filesystem fingerprinting into vt_fs_fingerprint crate - #594

Open
wan9chi wants to merge 2 commits into
mainfrom
claude/extract-filesystem-tracing-e49e4b
Open

refactor(cache): extract filesystem fingerprinting into vt_fs_fingerprint crate#594
wan9chi wants to merge 2 commits into
mainfrom
claude/extract-filesystem-tracing-e49e4b

Conversation

@wan9chi

@wan9chi wan9chi commented Aug 5, 2026

Copy link
Copy Markdown
Member

Motivation

The logic that turns traced filesystem accesses into cache decisions — fingerprinting inputs, collecting outputs, and the read-write-overlap verdict ("did the task modify its own input?") — lived inside the execution engine, interleaved with process spawning, IPC, SQLite storage, archiving, and reporting. The overlap policy is unsettled and will be rewritten several times; until now the only way to exercise any of it was to run a whole task through the engine.

This extracts the filesystem story into a new crates/vt_fs_fingerprint crate where it can be driven directly with synthetic traces and temp directories:

  • TaskFs::pre_run — before the task executes: validate the io configuration, snapshot the listed inputs, and (given a previous run's fingerprints) report the first input that changed.
  • TaskFs::post_run — after it finished: judge the traced accesses and return either Conclusion::InputModified (caching unsound) or Conclusion::Cacheable with the run's opaque InputFingerprints and its outputs.

The engine keeps storage, archiving, env-fingerprint tracking, and spawning; its cache module shrinks to storage primitives and the lookup orchestration moves next to execution (fetch-first: the entry is fetched, then pre_run compares against it).

Behavior is preserved — the full e2e snapshot suite passes untouched. Two deliberate exceptions: which error is reported when several things fail at once may differ in edge cases, and the cache entry layout is restructured around the opaque fingerprint record, so CACHE_SCHEMA_VERSION bumps 18 → 19 (existing caches are ignored once via the versioned cache directory).

🤖 Generated with Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

fspy benchmark

linux

dynamic/launch             change  +1.01%  [ -2.87% ..  +5.36%]  overhead   +64.07%
dynamic/access             change  +0.08%  [ -1.11% ..  +1.23%]  overhead   +48.11%
static/launch              change  +0.57%  [ -4.20% ..  +5.37%]  overhead  +165.63%
static/access              change  -0.40%  [ -4.30% ..  +1.12%]  overhead  +839.51%

macos

dynamic/launch             change  -0.22%  [ -3.77% ..  +4.33%]  overhead  +218.02%
dynamic/access             change  +0.28%  [ -6.86% ..  +4.88%]  overhead   +21.68%

windows

dynamic/launch             change  -1.55%  [ -6.00% ..  +3.19%]  overhead   +29.17%
dynamic/access             change  +0.18%  [ -1.40% ..  +1.04%]  overhead    +8.57%

@wan9chi
wan9chi force-pushed the claude/extract-filesystem-tracing-e49e4b branch from f6991a1 to 69a31cb Compare August 5, 2026 11:14
…rint crate

Move the filesystem story of task caching out of the execution engine into a
new crate so the unsettled read-write-overlap policy can be reasoned about and
tested with synthetic traces: pre-run input snapshot, traced-access judgment,
input fingerprints, produced outputs, and cache-entry validation.

The engine keeps storage, archiving, env tracking, and spawning. The cache
entry layout is restructured around the opaque InputFingerprints record
(CACHE_SCHEMA_VERSION 18 -> 19; old caches are ignored via the versioned dir).

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
@wan9chi
wan9chi force-pushed the claude/extract-filesystem-tracing-e49e4b branch from 69a31cb to 51f03f9 Compare August 5, 2026 11:17
…ction

The entry fetch and the old-key miss classification previously ran as two
separately-locked reads with the pre-run snapshot walk between them, leaving a
window where a concurrent run of the same task could store an entry and break
the classifier's "the current key just missed" assumption. Both reads now
share one deferred read transaction under a single lock hold, so they see the
same database snapshot; the classification arrives atomically with the fetch.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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