-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Eliminate fallback reduce_empty
#41885
Conversation
We have done that many times so I think that is fair game |
I'll hold off on this until #41888---it seemed silly to implement type-agnostic error messages specifically for this one test, compared to implementing it in a way that it becomes easy to use for everyone. |
Ultimately I agree with this decision but I feel it requires more nuanced reasoning. This is how Julia project interprets SemVer: Lines 23 to 30 in 8cad32b
We do mention Lines 303 to 311 in 8cad32b
However, since (I do not enjoy playing the role of tight-ass programmer. But, considering that some users may search for the reasoning behind the change in observable behaviors, I think it's ideal that we record that we do follow the rules.) |
Codecov Report
@@ Coverage Diff @@
## master #41885 +/- ##
==========================================
+ Coverage 77.36% 78.04% +0.67%
==========================================
Files 351 351
Lines 74134 74091 -43
==========================================
+ Hits 57356 57824 +468
+ Misses 16778 16267 -511
Continue to review full report at Codecov.
|
Thanks, @tkf. Your point raises an interesting question: this PR (FYI I have more improvements locally, waiting in #41888) now advertises the option of extending Again, I don't think it's a big deal for this PR (it hasn't historically appeared in anything considered public API), but given the points you raise it seems to make sense to consider these implications before going ahead in this manner. The alternative is to avoid mentioning |
Yes, I agree that it's not nice to pointing users to overload a not-really-public API via the error messages. I think mentioning Arguably, it's also nice to point solutions for library authors. So, promoting I think the easiest way forward is to just not explicitly encourage overloading [1] Very tangential to this PR, but here's a part of why: Many |
d72913c
to
2efe112
Compare
The fallback definitions of `reduce_empty` and `mapreduce_empty` are big targets for invalidation, and the benefit they bring is questionable. Instead of having a dedicated error path, instead we print a custom `MethodError` hint that is more informative than the current message. This fixes ~500 invalidations from DiffEqBase
`arg_types_param` is known to be a `Core.SimpleVector`
2efe112
to
eb2435f
Compare
reduce_empty
reduce_empty
I know of one package, StaticArrays, that will break due to this change. (The fix: change |
Run a full PkgEval maybe? |
Sounds good. Remind me, can I trigger that? |
Yes, https://github.com/JuliaCI/Nanosoldier.jl#quick-start ( |
@nanosoldier |
Your package evaluation job has completed - possible new issues were detected. A full report can be found here. |
@nanosoldier |
Your package evaluation job has completed - possible new issues were detected. A full report can be found here. |
In preparation for JuliaLang/julia#41885
In preparation for JuliaLang/julia#41885
In preparation for JuliaLang/julia#41885
In preparation for JuliaLang/julia#41885
In preparation for JuliaLang/julia#41885
In preparation for JuliaLang/julia#41885
In preparation for JuliaLang/julia#41885
In preparation for JuliaLang/julia#41885
In preparation for JuliaLang/julia#41885
PRs (or in the case of one GitLab repo, a discourse message) submitted for all double-failures. From my perspective this is good to go, but do let me know of any other concerns. |
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.
Thank you so much for going through all the packages! I didn't think I didn't have to fix my package :)
LGTM!
In preparation for JuliaLang/julia#41885
In preparation for JuliaLang/julia#41885
@KristofferC - do you know why nanosoldier did not catch that this change breaks DataFrames.jl tests? (I will fix the tests on our side, but I am just curious why it has not been detected). Thank you! |
Likely because the DataFrames tests failed on master as well:
|
Thanks. It means that nanosoldier environment does not properly handle |
Interesting. Perhaps you can open an issue on the PkgEval repo and it can be further discussed there. |
Sorry I broke DataFrames @bkamins, let me know if you need any help resolving. In most cases it's just |
No problem - I have fixed it. Thank you for reducing invalidations. |
In preparation for JuliaLang/julia#41885
In the `:basic` mode, downgrade `MethodErrorReport` on call of `reduce_empty` or `mapreduce_empty` to `UncaughtExceptionReport` so that it can be filtered out in common cases. xref: <JuliaLang/julia#41885>
In the `:basic` mode, downgrade `MethodErrorReport` on call of `reduce_empty` or `mapreduce_empty` to `UncaughtExceptionReport` so that it can be filtered out in common cases. xref: <JuliaLang/julia#41885>
In the `:basic` mode, downgrade `MethodErrorReport` on call of `reduce_empty` or `mapreduce_empty` to `UncaughtExceptionReport` so that it can be filtered out in common cases. xref: <JuliaLang/julia#41885>
The fallback definitions of
reduce_empty
andmapreduce_empty
are big targets for invalidation, and the benefit they bring is questionable. Instead of having a dedicated error path, instead this prints a customMethodError
hint that is more informative than the current message.This fixes ~500 invalidations from DiffEqBase, or ~1500 from DifferentialEquations, CC @ChrisRackauckas.
It is, however, potentially breaking, and I can't remember if changing the type of an error is considered one of the "OK" forms of breakage. Perhaps we want to get a bit away from testing the exact error type and instead just test the contents of the printed message?
For good measure, the second commit removes a no-longer-needed
@nospecialize
for better inferrability in the "sister" method to this one. That gets a few more invalidations.