runSegments
fn
void runSegments(size_t n, size_t totalRows,
scope void delegate(size_t) compute) @trustedRuns compute(i) for every independent unit, in parallel above the row threshold and serially below. This is the determinism-preserving pattern of ADR-2026-10-19-02: each call writes only its own slot of the caller's preallocated buffers over immutable input, ordered combines stay on the calling thread, and worker exceptions rethrow here.
Parameters
n | how many independent units (segments, chunks) |
totalRows | the total rows across the units (the threshold input) |
compute | the per-unit computation |