int residualDim(Grid g) { final c = gridCells(g); if (c == 1) return 32; if (c == 8) return 16; return 8; }