4 ms·
I don't trust your random number generator. It takes some effort to get extreme speeds out of them.
by orangepurple 3y ago
I don't trust your random number generator. It takes some effort to get extreme speeds out of them.
- modeless 3y agoThe speed comes from running thousands of simulations in parallel on the GPU. The random number generator doesn't have to be any faster for this to be a huge speedup. It's possible to use any one you like. I did validate the one I'm using against various others and found equivalent results. I also have the simulation implemented on the CPU as well to validate the correctness of the results.
- orangepurple 3y agoAre you suggesting you compared the result using Math.random() on CPU to the accelerated hash functions from https://www.shadertoy.com/view/XlGcRh https://www.shadertoy.com/view/XlGcRh (linked from your source code comments)?
- modeless 3y agoI believe that was one of the tests that I ran, yes. It was a long time ago. Obviously the results are not numerically identical when different RNGs are used but they converge as the number of iterations is increased. That said, I think you are right that the RNG could be improved, even if it doesn't affect the results right now.