Making a falling sand simulator
If you want more performance, falling sand simulators can further be made parallel by implementing them using Margolus Neighbourhoods, as in Falling Turnip: <a href="https:&#x2F;&#x2F;github.com&#x2F;tranma&#x2F;falling-turnip" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;tranma&#x2F;falling-turnip</a><p>The idea is that a single iteration divides the world into 2x2 squares and then applies effects sequentially within each square, but not <i>between</i> the squares.  This means each square can be processed independently.  In the next iteration, the division into squares shifts right and down by one cell each direction.  This does mean you need more steps than in a sequential implementation, but I found it to be quite a principled approach to parallelizing cellular automata when I first read about it.  One interesting side effect of this design is that falling particles end up being separated by blank space, as shown here: <a href="https:&#x2F;&#x2F;futhark-lang.org&#x2F;static&#x2F;falling-sand-2016.12.04.webm" rel="nofollow">https:&#x2F;&#x2F;futhark-lang.org&#x2F;static&#x2F;falling-sand-2016.12.04.webm</a>  I wonder if that is fixable.  (Although at larger scale it&#x27;s not particularly visible: <a href="https:&#x2F;&#x2F;sigkill.dk&#x2F;junk&#x2F;diving-beet.webm" rel="nofollow">https:&#x2F;&#x2F;sigkill.dk&#x2F;junk&#x2F;diving-beet.webm</a>)