-
Notifications
You must be signed in to change notification settings - Fork 31
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
Take testing seriously #73
Conversation
ForwardDiff and TaylorSeries are also sources of tests since we have and want to explicitly support forward mode. |
Good point. Ideally as many as possible of these would run all ways. The extent of my attempt at this so far is these lines , which ran into #70 . Edit: All of ForwardDiff's tests are copied here, and have loops set up to run them with all combinations of reverse jacobain over forward Hessian, etc. But the exotic combinations mostly don't work at the moment. |
fe14fa2
to
bfef4f6
Compare
These tests really want a different |
I looked into this a while back for an unrelated issue, but it seems the functionality behind those macros is not terribly extensible. Perhaps worthy of creating a TestMacros or TestExtras package if one doesn't already exist? |
7f06b80
to
b72f72b
Compare
Codecov Report
@@ Coverage Diff @@
## main #73 +/- ##
==========================================
+ Coverage 55.54% 57.96% +2.42%
==========================================
Files 21 21
Lines 2157 2172 +15
==========================================
+ Hits 1198 1259 +61
+ Misses 959 913 -46
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
should this be updated and merged? |
Will circle back, but last time I tried to update this, so many things were broken that I stopped. |
makes sense. Right now first order scalar forward mode is probably the thing that is most reliable. |
For what it's worth, this was fixed in JuliaLang/julia#47804, which will ship in Julia v1.10 |
Thanks. But this isn't quite what's wanted here, which is to prioritise silently wrong answers. It does this: julia> @test_broken error() # this I want to accept -- broken functionality
Test Broken
Expression: error()
julia> @test_broken false # this I would like to fail -- it's a silently wrong gradient
Test Broken
Expression: false
julia> @test_broken 1 # this changed in 47804, ok
Error During Test at REPL[832]:1
Expression evaluated to non-Boolean |
You don't want
|
Maybe. My hope was that an upgrade which changes an error to a correct answer would cause warnings (to fix at leisure) not failure, but changing an error to false would cause warnings (as now you have silently wrong answers). Maybe describing that as a variant of |
This adds many tests from Zygote. I've done some filtering to leave out the most repetitive ones, things which clearly don't apply (like Params), and things testing rules for external packages.
All which didn't pass are marked broken...
with (the local version of) #68. Thus many will fail.Some have the error copied next to them. Exactly two have SILENTLY WRONG ANSWER in the comment (and should probably become issues) but this is not automatically distinguished from just an error.Probably we should move the existing tests here into another file or two, to be a bit more organised.(done)I also had somewhere a few test cases of rules in ChainRules which are meant to support higher derivatives, but not very well tested there to do so.(some added)Closes #67, by adding the minimal piracy needed to allow Pairs to have a NamedTuple gradient (since many others tests failed without this).