runSegments

fnvoid runSegments(size_t n, size_t totalRows, scope void delegate(size_t) compute) @trusted

Runs 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

nhow many independent units (segments, chunks)
totalRowsthe total rows across the units (the threshold input)
computethe per-unit computation