v1.2.0 — Granular cache invalidation and up to 87% faster re-execution #59
ericodx
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Re-execution times drop by up to 80% when only a subset of test files change. The cache now tracks which test file killed each mutant and invalidates only the affected entries when tests are added, modified, or removed.
What's new
Granular cache invalidation
TestFileDifftracks three change categories: added, modified, and removed test files between runsKillerTestFileResolvermaps killer test names back to their source file paths, supporting both XCTest class names and Swift Testing function namesCacheStore.invalidate(diff:)applies status-aware rules:.killedand.survivedentries are invalidated when their associated test file changes;.unviableand.killedByCrashare permanent and never invalidated.survivedentries — a new test might kill a previously surviving mutant.killedentries whose killer was in the deleted file.killedand.survivedentries linked to that fileCache metadata persistence
CacheStorenow storeskillerTestFilealongside each cached resultTestFilesHasher.hashPerFileproduces a[String: String]dictionary of relative paths to SHA256 content hashesTestFileDiffInvalidation pipeline in MutantExecutor
prepareCacheStoreloads the cache, computes current test file hashes, detects changes viachangedTestFiles(current:), and triggers granular invalidation before execution beginsArchitecture changes
Cache layer — expanded from simple key-value storage to a metadata-aware invalidation system:
TestFileDiffTestFilesHasherKillerTestFileResolverCacheStoreinvalidate(diff:),changedTestFiles(current:), andkillerTestFilemetadataExecution layer —
ExecutionDepsnow includeskillerTestFileResolver.TestExecutionStage,IncompatibleMutantExecutor, andFallbackExecutorall resolve and storekillerTestFilewith each result.Cache key format —
MutantCacheKeyno longer includes a global test files hash. The key is now derived solely from the mutant's source file content and operator, making it stable across test-only changes.Performance
Measured on the project's own codebase (1145 mutants, SPM mode):
The 87% reduction on cache-hit runs comes from skipping build and test execution entirely for cached mutants — only mutants with invalidated cache entries are re-executed.
Bug fixes
TestExecutionStage— extracted sharedrecordResultmethodInternal improvements
MutantDescriptor,ExecutionResult,MutantCacheKey,RunnerConfiguration,BuildArtifact, and stage-specific fixtures)TestFilesHashercovers edge cases: external symlinks, non-existent paths, non-test file exclusionRequirements
Installation
See the Installation Guide for Homebrew, pre-built binary, and build from source instructions.
What's Changed
Full Changelog: v1.1.0...v1.2.0
This discussion was created from the release v1.2.0 — Granular cache invalidation and up to 87% faster re-execution.
All reactions