In my simulation, I make frequent use of random numbers. I want everything to be reproducible, so I explicitly seed a single RNG and pass it around as needed.
A few times now I’ve made the mistake of calling
rand(n) rather than
rand(rng, n). Because the former just falls back to the global RNG, it doesn’t produce errors and I don’t notice the problem until I look at my results closely and see small differences between runs.
To make it easier to catch these errors, is there any way to disable to the global RNG? Maybe replace it with something that fails when attempting to sample from it?