I think I've hit a wall. The ai-array is too complex. The trouble is that this all requires a lot of local bookkeeping, while using an object-oriented approach would avoid that. Maybe it's time to look at it in a different way. - Every node is a grid - Grids can be constructed from grids (transposes?) - The whole thing can be compiled to a stateless update function + explicit state objects.