The Blocksorter

The blocksorter comes originally from a Tangram example. It is a pipeline of sort cells, each of which stores one value internally. Values moving down the pipeline are compared with the values stored in the blocks and swapped if necessary. With suitable processing for the start and end of blocks the pipeline as a whole sorts blocks of values.

The source code is in this file.

Here's an example screenshot from li: