Builtin Library
README.md
geometry.offsets
Turn a count per element into the place each element's run starts: the exclusive prefix sum of the counts, and the sum of them all.
Inputs
counts(Column<Int>). How many slots each element takes.capacity(Number, optional). The most the counts can add up to. Given,totalis a live count with that capacity and nothing is read back; a total above it is an overflow.
Outputs
offsets(Column<Int>). For each element, the sum of the counts before it.total(Column<Int>). A one-element column holding the sum of every count; withcapacity, a live count.
local runs = g.geometry.offsets({ counts = g.math.to_int(g.field.index({ domain = 4 }) + 1) })