Certified parallel output assembly #
Large concrete einsums may compute any ordered partition of the outer output axis concurrently. This module proves that task execution followed by source-order assembly produces the same row-major array as sequential traversal.
Parallelism never enters a scalar contraction. Every output value therefore uses the original reduction order, including for floating-point scalars.
Run an arbitrary number of independent physical-buffer producers and append their results in source order.
The first producer runs on the calling thread and may reserve capacity for the complete result. Every remaining producer enters Lean's task pool before the first chunk is evaluated.
Instances For
Task execution has the same value as evaluating and appending all chunk producers sequentially.
Folding one contiguous range of the outer axis constructs the corresponding contiguous range of the full row-major output.
Any certified ordered partition, evaluated through parallelBuffer,
reconstructs the original finite-function array.