You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is just an idea / feature request, it's totally fine to close the issue if it does not spark any interest.
Currently check_determinism verifies that the randomness state after running the input function twice is the same.
If the input function is truly deterministic, it must return the same result.
Here is how I currently check that a function is deterministic:
Besides checking for determinism, we also want to locate the source as soon as possible when uncertainty occurs. Therefore, check_determinism records the entire sequence of random states, and it immediately panics if it finds inconsistencies during the second run. This allows developers to roughly locate the uncertainty source through the backtrace. In comparison, only comparing function return values might miss some cases and doesn't quickly reveal problems. Moreover, this method won't work if the user's function does not return a random number, which I believe is more common in practice.
However, it would be nice to add return value check to the current check_determinism.
This is just an idea / feature request, it's totally fine to close the issue if it does not spark any interest.
Currently
check_determinism
verifies that the randomness state after running the input function twice is the same.If the input function is truly deterministic, it must return the same result.
Here is how I currently check that a function is deterministic:
It would be nice to have less boilerplate, given that the function returns a value implementing
Debug
andPartialEq
The text was updated successfully, but these errors were encountered: