You can rake a pattern into dry sand and it will hold for a week. It holds because the grains are held in a network of frictional contacts, and the network can support a slope of thirty-odd degrees without moving at all. Rake too steep a face and the grains avalanche, and the pattern heals itself overnight.
The dry garden was not invented for decoration. Zen Buddhism took the Chinese idea of a scholar's rock and surrounded it with raked gravel so that the pattern would have to be made again and again, and the making of it — not the garden, the rake — was the practice. A monk sweeps the sand around the stones in the direction of the flow, and the pattern is removed at the end of the working day.
It is a machine for making a thing that cannot be finished, which is the entire point of it. The stones stand for mountains; the sand for water; and the raked lines for the water flowing round them.
The sand here is a height field on a grid, and the rake is a tool that displaces material sideways: dragging it lowers a line and pushes the displaced grains out to either side, which is exactly what the teeth of a real rake do.
After every stroke the field is relaxed: any neighbouring pair whose height differs by more than the tangent of the angle of repose passes sand downhill until it does not. That is the avalanche, and it is why a steep cut slowly fills in and a shallow one keeps its edges for days. The stones are impassable and the sand piles against them, as it should.