-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Wrong evaluation in sparse/higherorderfns.jl fix#23857 #24806
Conversation
Thanks @KlausC! Apologies in advance for not reviewing this pull request in the short term. (Time is short with feature freeze fast approaching, and I have been remiss in reviewing a number of higher priority items as it stands.) Best! |
@Sacha0 just a reminder - it's 30 days now |
Regrettably, work falling under the heading bugfix will need to wait till after proper feature freeze (and likely then some) :). |
Maybe it is time now to have a lock on this bug fix. The change was rather simple, as far as I remember. |
@mbauman , @andreasnoack , wouldn't it make sense to merge this minor bug fix as well. I fear it is getting lost after similar changes have been done to the same file(s). #26474 |
I'm so sorry that this has fallen through the cracks. The change here is indeed simpler than it looks — here's a better view: https://github.com/JuliaLang/julia/pull/24806/files?w=1 I'm hesitant here because a very similar structure is used in the other branches and functions here — do they need the same fix? I'd like to understand a bit more about why this is failing, but I'm not seeing it at the moment. |
It is nearly 4 month by now. I think, I understood it then, but have to recover now. I will try tomorrow, to explain the change. At least it did not break any tests and fixed the reported errors. |
@@ -719,23 +719,15 @@ function _broadcast_notzeropres!(f::Tf, fillvalue, C::SparseVecOrMat, A::SparseV | |||
Bk, stopBk = numcols(B) == 1 ? (colstartind(B, 1), colboundind(B, 1)) : (colstartind(B, j), colboundind(B, j)) | |||
Bx = Bk < stopBk ? storedvals(B)[Bk] : zero(eltype(B)) | |||
fzAvB = f(zero(eltype(A)), Bx) | |||
if _iszero(fzAvB) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having briefly refreshed my memory of these methods, I believe that the _iszero(fzAvB)
check (and similar _iszero(fvAzB)
check in the preceding branch where A
rather than B
expands vertically) should instead be something to the effect of fzAvB == fillvalue
in the methods for the not-zero-preserving-f case. These branches should stay around, however, as otherwise performance may degrade appreciably. Regrettably a nanosoldier suite for these methods remains a "one day" project. Best!
I think the
The bug is, that instead of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation and change. Makes sense, and this now matches the vararg _broadcast_notzeropres!
method below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for persisting with this @KlausC! :)
(Absent objections, requests for time, or someone beating me to it, I plan to merge these changes tomorrow morning PST or later. Best!) |
Division of a sparse matrix by row vector causes 0's to become NaN
#23857