On 04.06.2021 03:45, Ichthyostega wrote: > Am 03.06.21 um 03:35 schrieb Ichthyostega: >> What is immediately clear from diffing these traces: we are drawing >> some values from some harmonic PRNG instances prior to re-seeding them >> with a reproducible value from the main-PRNG. And -- depending on the >> timings prior >> to starting the test, these values are thus nondeterministic. > > After investigating the call graphs in detail, I should add to the above > statement that this in itself is not a problem or "incorrect" in any way. > > Because, we have two PRNGs in each OscilGen, and the base-PRNG is only > reseeded > when a new instrument is loaded (or on parameter changes). While the second > one, the harmonicPRNG, is reseeded on each note again, but from one fixed > value, which is also only drawn on some events only (parameter change, new > instrument, rebuilding wavetable etc). > > At that point, it would be possible to argue that it is "unfortunate" > that the base prng happens to be reseeded on parameter changes /after/ > drawing > a new value for the harmonicPRNG. However, I am a bit hesitant to change > anything in this area, since it is so damn hard to understand all > ramifications. > > Another, far less risky solution IMHO would be to make our new reseed() > operation way more complete. It should not only reseed the main PRNG, > but also loop over all loaded instruments / kit items and over all > OscilGen instances embedded into these, and then reseed both of > those slave prngs, and, most importantly, do this in the right order. > > > The latter obviously requires some more coding work to be done properly, > but it seems less risky and more focussed to what we want to achieve > right now. So that's what I'll try next
May I suggest a different method: In RandomGen.h there is a NorandomPRNG class which can be switched with the real random generator (see the bottom). Now, that class is overly stupid, it's just returns a constant. But we could consider following a similar idea, just a bit closer to reality. For example, what about using the real generator, but with a compile option we make it reseed to the same value, always, regardless of what you actually pass it? Obviously, when using the method, test results would only be valid when compiling with this option. -- Kristian _______________________________________________ Yoshimi-devel mailing list Yoshimi-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/yoshimi-devel