`return distribution(gen)` is a data race between a read and a write in two threads, reported by TSan. Remove static random number generators so they aren't using the same generator.