Repository navigation
perf(synth): shard near-duplicate signing across the resolver pool - #609
Merged
Merged
Conversation
…ails Review of #609: a rejected pool/worker signing task left the stale bodies unsigned and the pairs stale. Catch the rejection and run the same in-process loop the no-pool path uses, logging under SYNTH_TIMINGS. The new test forces a rejecting signer and asserts the rows and pairs match the in-process result.
Review of #609: the post-synthesis hook set the instance field true and a later indexAll on the same CodeGraph instance skipped the fallback even when the hook did not run (no refs, no pool, resolver skipped). Reset it at the start of each full index.
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 changed
refreshNearDuplicatesis async and accepts asigndependency. A full index now signs bodies on the resolver pool after synthesis, while the pool is still open and idle, instead of on the main thread.ResolverPool.signNearDuplicatesworker task: workers read the bodies from disk, compute shingles/signatures and return both the MinHash bytes and the shingle set.resolveAndPersistBatched, before the pool is destroyed;indexAllskips its separate near-dup pass. Sync keeps the in-process path (no pool, small changes).Uint32Arrays and aSetis built only for a body that actually lands in a candidate pair, avoiding 36k main-thread Set rebuilds.near-duplicates.test.ts(in-process signer stores the same signatures and pairs).Measured (interleaved, admission passed)
nearDuplicatesScope / risk
CODEGRAPH_NO_PARALLEL_RESOLVE=1) falls back to the in-process loop.indexAll,sync, the tests) and adds a worker message; the parity test and full suite cover the result.Tests
near-duplicates.test.ts: 9/9, including the fake-signer parity case.npx vitest run: 958 files, 11,345 passed, 46 skipped, 0 failed.README impact
The README measured-results table predates this change; supabase's 17.37 s row will move. Re-measuring the corpora is heavy and is recorded as a follow-up rather than hand-editing one row.