I've got a program which makes heavy use of random numbers to decide what it needs to be doing, and has many many execution paths based on the output of the PRNG. After pulling my hair out trying to debug it, I decided to make all PRNG calls reference the same Random instance, which has been seeded to a hard coded number at instantiation. That way, every time I run the program, the same bug should appear. Unfortunately, I still get different bugs each time I run it (though it seems to behave almost the same way).
I've searched the code many many times for any missed calls to Math.random() and I assure you there are none.
Any ideas?
Edit: I have confirmed that numbers being generated are the same, yet behaviour is still non-deterministic. This program is not multi-threaded. Still completely baffled.
So the PRNG is behaving as expected, but I still have non-determinism. What are some ways that non-determinism might inadvertently be brought into a program?