-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
MAINT: random: Follow-up to PR 14458. #14465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* The comment about casting to long is no longer relevant. * The conversion of the arrays to int64 immediately before calling `discrete_broadcast_iii` is no longer necessary, because they are created as int64 arrays.
I'm traveling at the moment, so I can't give this the review it deserves.
My apologies if the following isn't relevant. Please keep in mind NEP 19.
We do not fix correctness bugs in mtrand anymore. Segfaults can be fixed
though. If this is a regression from 1.16, we can also restore 1.16
results. Thanks.
|
OK, I am fine with that. If we specifically do not fix this, I suppose we should add it to the notes section (assuming we do not support a bugs section, I am not sure) in the documentation. |
Unless this is a bug in a branch that would (practically) crash before? In which case fixing it does not matter. |
@rkern wrote
The bug reported in #14457 is a regression from 1.16. The fix in #14458 fixes the bug, but also appears to introduce a change in behavior on systems where a C long int is 32 bits for inputs that are outside the range of a 32 bit integer. |
I think it is fairly clear there is no NEP-19 problem here:
|
Because of the delicacy of our back-compat guarantees on mtrand, it may be worth adding a release note though, even though I don't think we are breaking code that did anything useful before. (I checked: inputting args > 2**32 gave The note can go in |
Pretty clearly, gh-14458 did not change any useful behavior. If we want to be severely strict about not changing any behavior, however, we could revert gh-14458, and make the one-line fix that I mentioned in the comments to that PR. Then there would be no need for any mention in the release notes. |
Just to make sure, 1.16.x also works? |
I don't think it is worth hassling over the new behavior. If an error was previously raised it is unlikely that anyone was depending on that behavior, but it might be good to have a note in case someone runs a new program on an old release. |
Confirmed that 1.16.5 works, it gives an overflow error only (no bug). |
I'll allow it since it's incidentally fixing a 1.17 regression (which crashes, to boot), but a similar enhancement would not fly otherwise. |
@WarrenWeckesser could you add a release note which includes the changes in both this PR and gh-14458 |
discrete_broadcast_iii
is no longer necessary, because they arecreated as int64 arrays.