Re:Challenge to scientists: does your ten-year-old code stil...
by chrchang523 on Monday August 24, 2020 @11:59AM
(#24261894)
Nit: implementations of Monte Carlo methods are not necessarily nondeterministic. Whenever I implement one, I always aim for a deterministic function of (input data, RNG seed, parallelism, workspace size).
[ Parent
| on HN ]
Re:Challenge to scientists: does your ten-year-old code stil...
by petschge on Monday August 24, 2020 @12:02PM
(#24261925)
It really helps with debugging if your MC code is deterministic for a given input seed. And then you just run for a sufficient number of different seeds to sample the probability space.
Re:Challenge to scientists: does your ten-year-old code stil...
by vngzs on Monday August 24, 2020 @12:16PM
(#24262102)
Alternatively: seed the program randomly by default, but allow the user to specify a seed as a CLI argument or function argument (for tests).
In the common case, the software behaves as expected (random output), but it is reproducible for tests. You can then publish your RNG seed with the commit hash when you release your code/paper, and others may see your results and investigate that particular code execution.
Re:Challenge to scientists: does your ten-year-old code stil...
by petschge on Monday August 24, 2020 @12:22PM
(#24262163)
Sure that works too. But word of advice from real life: Print the random seed at the beginning of the run so you can find out which seed caused it to crash or do stupid things.
Re:Challenge to scientists: does your ten-year-old code stil...
by jnxx on Monday August 24, 2020 @12:31PM
(#24262264)
And it seems that the people from Imperial College have done that with their epidemiological simulation. What critics claim is that their code produces non-deterministic results when given deterministic input and random seeds, i.e. that their code is seriously broken. Which would be a serious issue if true.