refactor(cache): restructure cache lookup and update around the task's fs story - #601
Open
wan9chi wants to merge 1 commit into
Open
refactor(cache): restructure cache lookup and update around the task's fs story#601wan9chi wants to merge 1 commit into
wan9chi wants to merge 1 commit into
Conversation
…s fs story Give the filesystem side of a task run one seam: TaskFs::pre_run (before the task executes: validate io config, snapshot the listed inputs, and report the first input changed since a previous run's fingerprints) and TaskFs::post_run (after: judge the traced accesses and conclude InputModified or Cacheable with the run's fingerprints and outputs). The seam makes the read-write-overlap policy and its filters drivable with synthetic traces on temp directories — the new unit tests in task_fs/task_run.rs do exactly that. Lookup flips to fetch-first so pre_run can compare against the stored fingerprints, and — since that makes the entry fetch and the old-key miss classification adjacent — both now run in one deferred read transaction under a single lock hold (fetch_entry), closing the window where a concurrent run could break the classifier's the-key-just-missed assumption. The cache module shrinks to storage primitives; FspyTracking dissolves into TaskFs. The task_fs module tree mirrors a standalone-crate layout on purpose: the follow-up moves it out of the engine wholesale. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This was referenced Aug 9, 2026
fspy benchmarklinuxmacoswindows |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation
The filesystem side of a task run — snapshotting inputs, judging traced accesses, the read-write-overlap verdict — is spread across the lookup, update, and observation code, so the unsettled overlap policy can only be exercised by running a whole task through the engine.
This gives it one seam (stack: 2/3, on top of #600):
TaskFs::pre_run— before the task executes: validate the io configuration, snapshot the listed inputs, and report the first input changed since a previous run's fingerprints.TaskFs::post_run— after it finished: judge the traced accesses and concludeInputModified(caching unsound) orCacheablewith the run's fingerprints and outputs.The seam makes the overlap policy and its filters drivable with synthetic traces on temp directories — the new unit tests in
task_fs/task_run.rsdo exactly that, covering the verdict across all auto-tracking combinations, per-side gating, negative-glob/ignore filtering, access normalization, and fingerprint round-trips.Lookup flips to fetch-first so
pre_runcan compare against the stored fingerprints; since that makes the entry fetch and the old-key miss classification adjacent, both now run in one deferred read transaction under a single lock hold (fetch_entry), closing the window where a concurrent run of the same task could break the classifier's the-key-just-missed assumption. The cache module shrinks to storage primitives;FspyTrackingdissolves intoTaskFs.The
task_fsmodule tree deliberately mirrors a standalone-crate layout: #594 moves it out of the engine wholesale.🤖 Generated with Claude Code