~/bend-docscommunity

traversal_cells.bend checks

raw source on the hub · import stelliferous@0.0.2.0/traversal_cells.bend as Traversal_cells

Owned inputs move through cells holding width consecutive output values. Each round gathers a cell, stores it in scratch, reads it back and scatters it into the owners. Storing the whole cell lets the compiler compute its elements together. The Array specialization refines Traversal.map_in_place.

2 imports
import Base
import ./traversal_loop.bend as Loop

Types

type State source · line 8 · raw

@-Owner:Type -> @-Cell:Data -> @-Context:Data -> Type

Templates

template scattered source · line 11 · raw

@-Owner:Type -> @-Cell:Data -> @-Context:Data -> @-scatter:(@_:Owner -> @_:U32 -> @_:Cell -> Owner) -> @-width:U32 -> @+position:U32 -> @+slot:U32 -> @context:Context -> @values:Owner -> @read:Pair(Array<Cell>, Cell) -> State<Owner, Cell, Context>

template stored source · line 16 · raw

@-Owner:Type -> @-Cell:Data -> @-Context:Data -> @-scatter:(@_:Owner -> @_:U32 -> @_:Cell -> Owner) -> @-width:U32 -> @+position:U32 -> @+slot:U32 -> @context:Context -> @scratch:Array<Cell> -> @gathered:Pair(Owner, Cell) -> State<Owner, Cell, Context>

template step source · line 21 · raw

@-Owner:Type -> @-Cell:Data -> @-Context:Data -> @-gather:(@_:Owner -> @_:U32 -> @_:Context -> Pair(Owner, Cell)) -> @-scatter:(@_:Owner -> @_:U32 -> @_:Cell -> Owner) -> @-width:U32 -> @state:State<Owner, Cell, Context> -> State<Owner, Cell, Context>

template output source · line 26 · raw

@-Owner:Type -> @-Cell:Data -> @-Context:Data -> @state:State<Owner, Cell, Context> -> Owner

template map source · line 31 · raw

@-Owner:Type -> @-Cell:Data -> @-Context:Data -> @-gather:(@_:Owner -> @_:U32 -> @_:Context -> Pair(Owner, Cell)) -> @-scatter:(@_:Owner -> @_:U32 -> @_:Cell -> Owner) -> @-width:U32 -> @cells:Nat -> @position:U32 -> @context:Context -> @values:Owner -> @scratch:Array<Cell> -> Owner

cells rounds from position; the scratch array holds 64 cells.