Skip to content

fix(cache): ignore built-in volatile paths in directory listings - #1014

Merged
wan9chi merged 3 commits into
mainfrom
fix/ignore-volatile-listing-entries
Nov 25, 2026
Merged

wan9chi merged 3 commits into
mainfrom
fix/ignore-volatile-listing-entries

Conversation

@wan9chi

@wan9chi wan9chi commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Motivation

Remote-caching dogfooding surfaced repeated spurious cache misses for tasks that list node_modules:

  • node_modules/.pnpm-workspace-state-v1.json appearing or disappearing caused misses even though tracked_accesses.rs already skips direct reads and writes of node_modules/.pnpm-workspace-state-*.json (fix(cache): stop tracking pnpm's workspace state files #825).
  • node_modules/.vite-temp (created by Vite when bundling vite.config.* and left behind) caused misses for unrelated tasks that list node_modules because Vite's runtime ignoreInput call only applies to the Vite task itself.
  • Similarly, .git (at the workspace root) and the task cache root (node_modules/.vite/task-cache, skipped for direct accesses in fix(cache): skip the task cache in tracked file accesses #937) were not excluded from directory listing fingerprints.

Changes

  • Add crates/vt/src/session/execute/ignored_paths.rs (IgnoredDirEntries, is_ignored_workspace_path, relative_cache_root) as a single source of truth for built-in ignored workspace paths (.DS_Store, root .git, node_modules/.pnpm-workspace-state-*.json, node_modules/.vite-temp, and the workspace-relative task cache root), compiled on all platforms, and add RelativePath::file_name in vt_path.
  • Use is_ignored_workspace_path in tracked_accesses.rs (skipping direct accesses under node_modules/.vite-temp and .DS_Store alongside .git, pnpm workspace state files, and the task cache).
  • Use IgnoredDirEntries in both fingerprint.rs's leave_out_excluded_entries (during fingerprint creation and cache validation) and rebuildable.rs (holds, is_empty_folder, and add_files_under).
  • Bump CACHE_SCHEMA_VERSION from 23 to 24 to avoid first-run misses and mixed-version remote cache churn against v23 entries that recorded these names in DirListing.entries.
  • Document the built-in exclusions in docs/inputs.md, update CHANGELOG.md, and add unit tests plus a cross-platform synthetic e2e snapshot test (node_modules_listing_ignores_volatile_entries).

Note

Medium Risk
Changes cache fingerprint semantics and bumps the schema version, which invalidates existing local caches but is required for correct hit/miss behavior.

Overview
Fixes spurious cache misses when tasks list directories (especially node_modules, the workspace root, or node_modules/.vite) because volatile entries were still fingerprinted even though some direct accesses were already skipped.

Introduces ignored_paths as the shared rules for built-in ignored workspace paths: .DS_Store, root .git, node_modules/.pnpm-workspace-state-*.json, node_modules/.vite-temp, and the workspace-relative task cache root. Those rules now apply consistently to fspy tracked reads/writes, directory listing fingerprints (create + validate), and rebuildable-folder scans, with relative_cache_root passed through cache validation and post-run fingerprinting.

CACHE_SCHEMA_VERSION is bumped to 24 so older entries that recorded these names in listings are not compared against the new semantics. Adds RelativePath::file_name, updates inputs docs, and an e2e snapshot confirming real node_modules changes still miss while volatile entries do not.

Reviewed by Cursor Bugbot for commit ac51599. Bugbot is set up for automated code reviews on this repo. Configure here.

wan9chi added a commit that referenced this pull request Nov 25, 2026
Co-authored-by: Gemini 4 Neon <noreply@google.com>
@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

fspy benchmark

linux

dynamic/launch             change  -4.64%  [-20.14% .. +16.02%]  overhead   +70.13%
dynamic/access             change  +0.36%  [ -6.65% ..  +8.28%]  overhead   +17.25%
dynamic/access-relative    change  +0.81%  [-17.99% .. +16.19%]  overhead   +69.24%
dynamic/access-contended   change  -2.55%  [-14.53% .. +15.33%]  overhead   +10.62%
static/launch              change  -0.26%  [ -5.82% ..  +5.67%]  overhead  +204.67%
static/access              change  +0.00%  [-13.25% .. +10.31%]  overhead +1273.65%
static/access-relative     change  +0.73%  [ -5.96% ..  +7.89%]  overhead +1629.84%
static/access-contended    change  +3.21%  [ -4.67% .. +13.78%]  overhead +1205.98%

macos

dynamic/launch             change  -0.25%  [ -2.55% ..  +2.90%]  overhead  +223.69%
dynamic/access             change  -0.40%  [ -4.05% ..  +4.14%]  overhead    +2.60%
dynamic/access-relative    change  +0.24%  [ -2.47% ..  +2.85%]  overhead  +261.18%
dynamic/access-contended   change  +0.84%  [ -2.54% ..  +4.51%]  overhead    +2.90%

windows

dynamic/launch             change  +0.02%  [ -3.04% ..  +2.85%]  overhead   +26.68%
dynamic/access             change  +0.54%  [ -0.55% ..  +1.30%]  overhead    +1.31%
dynamic/access-relative    change  +0.00%  [ -0.89% ..  +0.89%]  overhead    +1.10%
dynamic/access-contended   change  -0.17%  [ -1.19% ..  +0.87%]  overhead    +1.23%

wan9chi and others added 3 commits November 25, 2026 18:58
Unify built-in ignored workspace paths across direct fspy tracking and
directory listing fingerprints so `.pnpm-workspace-state-*.json`,
`.vite-temp`, `.git`, `.DS_Store`, and the task cache root are left out
consistently during both fingerprint creation and cache validation.

Co-authored-by: Gemini 4 Neon <noreply@google.com>
Co-authored-by: Gemini 4 Neon <noreply@google.com>
…ine matcher

Address review feedback:
- Use `IgnoredDirEntries` in `Rebuildable` (`holds`, `is_empty_folder`,
  `add_files_under`) so `.vite-temp`, `.pnpm-workspace-state-*.json`, and
  the task cache root are treated consistently with directory listings and
  never block rebuildability or leak into output archives.
- Add `RelativePath::file_name` in `vt_path` and precompute per-directory
  built-in filters in `IgnoredDirEntries` with an O(1) fast path for normal
  directories.
- Scope `expect(dead_code)` on `is_ignored_workspace_path` to
  `all(not(fspy), not(test))` and remove dead `.DS_Store` directory check.
- Document built-in auto-inference exclusions in `docs/inputs.md` and
  clarify the `CHANGELOG.md` entry.

Co-authored-by: Gemini 4 Neon <noreply@google.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@wan9chi
wan9chi force-pushed the fix/ignore-volatile-listing-entries branch from 58f93f0 to ac51599 Compare November 25, 2026 10:58
@wan9chi
wan9chi merged commit 2015987 into main Nov 25, 2026
22 checks passed
@wan9chi
wan9chi deleted the fix/ignore-volatile-listing-entries branch November 25, 2026 11:04
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