Greptile reproduced a race in the query thread pool: a worker kept the chunk count of a previous run in a local while the next run reset the cursor and swapped the callback, so a stale worker could invoke the new callback with an index beyond its range and undercount completion. The run is now published as one 64-bit word, chunk count above the next index. A worker claims with a single fetch-add on that word, so the index it gets is always paired with the count of the same run: a stale claim fails the bounds test and touches nothing, and a claim in range keeps the run alive until the chunk is done, so the callback it then reads belongs to that run. Runs above 2^31 chunks fall back to the caller thread. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Dara Adedeji committed on 9/19/2026, 11:51:31 PMparentf46a4a4
64 files changedLine totals unavailable