COSMIT: rng.permutation rather than rng.shuffle