replace std::shuffle with version using prefetch rng; improve unit test