Add worker-backed source scanning#26
Merged
Merged
Conversation
Document scoped implementation tasks for impact workflow, cache lifecycle, test recommendation, graph edge semantics, and CLI execution refactors.
Scan cache misses in worker pool when FS supports it, keep cache and graph main-thread-owned, and document/configure workers.
Drop tracked task markdown files from branch contents.
…-scanner # Conflicts: # src/impact/impact-command.ts
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.
What is this?
This PR adds worker-backed source scanning for cache misses. Sniffler now keeps cache lookup, diagnostics, and graph construction on the main thread, but can parallelize file reads, import/export parsing, content hashing, and metadata collection when the filesystem supports worker scanning.
It also adds a top-level
workersconfig option withautoas the default.workers: 0keeps the current serial path, while any positive value enables worker scanning when Sniffler chooses that path.How does it work?
selectImpactnow walks source files in order, reuses cached entries for hits, and collects only misses for scanning. Miss results are merged back into the original source-file order before graph build so output stays deterministic.Scanner selection now goes through a dedicated
source-scannerabstraction:The new
FileSystem.supportsWorkerScanningflag makes the filesystem contract explicit. Node FS reportstrue; memory and fallback/custom FS implementations reportfalse. If a worker scan is requested against an unsupported filesystem, Sniffler throws a clear error.Cache config hashing ignores
workers, so changing parallelism does not invalidate semantic cache data. Diagnostics now record scanner mode, worker count, job count, and worker failure count.Why is this useful?
workerschanges execution strategy, not analysis output.Benchmark Notes
On Expensify cold runs,
workers: autoreduced source scan time by about52%and total run time by about33%versusworkers: 0.