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
{{ message }}
Repository navigation
np.random.binomial produces inconsistent output with same seed in 1.16 -> 1.17 #14522
Looks like a regression, the call sequence of the old code should not have been changed unless the values resulted in a hang, in which case it probably wouldn't matter since no one would use those values.
We do test the generated sequences for many things, but it seems that doesn't catch changes in corner cases. Good thing we no longer make that guarantee :)
Activity
WarrenWeckesser commentedon Sep 16, 2019
Simpler example:
WarrenWeckesser commentedon Sep 16, 2019
This appears to be the result of an explicit check for
p = 0in the new code:numpy/numpy/random/src/distributions/distributions.c
Line 908 in e4de01d
The old code did not have this shortcut, so it would make at least one more call to
rk_double(state)than is made in the new code.charris commentedon Sep 16, 2019
Looks like a regression, the call sequence of the old code should not have been changed unless the values resulted in a hang, in which case it probably wouldn't matter since no one would use those values.
WarrenWeckesser commentedon Sep 16, 2019
@charris, I'm looking into fixing the regression.
charris commentedon Sep 16, 2019
@WarrenWeckesser Great, I was just starting to investigate.
We do test the generated sequences for many things, but it seems that doesn't catch changes in corner cases. Good thing we no longer make that guarantee :)
BUG: random: Create a legacy implementation of random.binomial.
BUG: random: Create a legacy implementation of random.binomial.
dburkhardt commentedon Sep 23, 2019
Thank you all for looking into this! I really appreciate the work you put into Numpy.