MatrixSpiral optimization