Borrow annotation query rows with C++20 spans
Pass annotation row-query inputs as std::span<const Row> so BRWT, generic parallel batching, and Rainbow queries can borrow slices instead of allocating temporary vectors. Keep owned vectors where queued work needs shared ownership, and retain mutable vectors for operations that rewrite their input.
Existing vector callers convert implicitly. External matrix subclasses must update their overrides; this is a C++ API/ABI change and requires rebuilding consumers. Stored index formats are unchanged.
Tests cover empty and partial slices, unsorted repeated rows, batches around the 10,000-row boundary, both query modes, and one/four threads. All 48 real-index benchmark cases preserve query checksums. A 20,003-row query removes 160 KB of requested allocations in generic batching and about 536–755 KB in one-pass traversal. Longer controlled timings found no meaningful slowdown; these allocation figures are not peak RSS.
Depends on #649 for C++20.
Summary by cubic
Switches annotation row-query inputs from std::vector<Row> to std::span<const Row> so BRWT, generic parallel batching, and Rainbow query paths borrow slices instead of allocating temporary vectors. Owned vectors stay where queued work needs shared ownership, and mutable vectors stay where inputs are rewritten; stored index formats are unchanged.
Existing std::vector callers convert implicitly. Requires the C++20 build from the parent branch, with the updated SDSL dependency now merged in.
Migration
- External
BinaryMatrix,IntMatrix, andMultiIntMatrixsubclasses must update their overrides to accept spans; consumers must rebuild.
Validation
- Tests cover empty and partial slices, unsorted repeated rows, batches around the 10,000-row boundary, both query modes, and one/four threads.
- A 20,003-row query removes 160 KB of requested allocations in generic batching and 536–755 KB in one-pass traversal, with all 48 real-index benchmark queries preserving checksums and no meaningful slowdown.