* fix: preserve input order with --no-sort
Workers grab 4096-item chunks from a shared queue, so the order in
which worker results are concatenated is nondeterministic. With
--no-sort the merged list was left in that arrival order, which
scrambles the display order once the item count exceeds
num_workers * chunk_size (~24k items on a 10-core machine) and makes
--filter output nondeterministic for large inputs.
Sort matched items by rank.index (the original input position) when
no_sort is set: each worker sorts its accumulator in prepare, and the
final merge exploits the k sorted runs, mirroring the sorted path.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* avoid extra sorts by exploiting the thread_pool stability
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Loric ANDRE <loric.andre@pm.me>