-
Notifications
You must be signed in to change notification settings - Fork 4
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
Compute the number of dimensions N in build_solution
#28
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #28 +/- ##
==========================================
+ Coverage 95.12% 95.13% +0.01%
==========================================
Files 8 8
Lines 328 329 +1
==========================================
+ Hits 312 313 +1
Misses 16 16 ☔ View full report in Codecov by Sentry. |
Hm indeed SciML does (for me) a bit too many breaking changes in non-breaking releases. Should we maybe also bump the compat entry then? (raise the version on the |
Hm, I will try to fix this soon. Apart from SciML sometimes doing breaking changes in non-breaking releases, ManifoldDiffEq.jl hooks into some of their internals so they can justifiably feel free to change them as they see fit. |
This dimension was added in 2016. What's the right time interval for such changes? |
@@ -224,7 +224,8 @@ function build_solution( | |||
interp.cache, | |||
prob.manifold, | |||
) | |||
return ODESolution{T,1}( |
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.
Unless your solutions were scalar valued this was never correct.
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.
If ndims
is required to be defined to use ODESolution
then we can't use it here.
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.
And it looks like if we can't use ODESolution
, SciMLBase
has almost nothing that can be used in ManifoldDiffEq
.
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.
I am not sure, whether maybe the solution in this PR is enough, but I also could not find what N
actually refers to by looking at either https://docs.sciml.ai/DiffEqDocs/stable/types/ode_types/#SciMLBase.ODESolution or (had to look for that manually since it was not linked) https://docs.sciml.ai/SciMLBase/stable/interfaces/Solutions/#SciMLBase.AbstractODESolution or (same manual search) https://docs.sciml.ai/SciMLBase/stable/interfaces/Solutions/#SciMLBase.AbstractTimeseriesSolution ... (and then I got a bit tired).
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.
Any solution that uses ndims
is at best a workaround since ndims
is not a valid concept for points on a manifold or tangent vectors.
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.
I do agree.
What breaking change? Please help me understand what you are asking for here and I can help out. But this dimension parameter has not changed in 8 years so I do not understand what's being asked for. |
I am not sure, I did not write this code, for now my main experience and interaction with SciML was sudden failures on CI – maybe because we used internals, I am not sure; so this looked like the same area, and I am not sure how the got to the parameter being |
No the parameter did not change, but how you handle it and how it is documented. I did not work with SciML for the last year or so, but when I did, e.g. implementing this function ManifoldDiffEq.jl/src/frozen_solvers.jl Lines 30 to 46 in 4f283a0
I have no clue (today) what any of the parameter is, I just copied that from an example. back then I could maybe figure out 20% of what the parameters mean because none of them are documented anywhere (and I am not a differential equations guy much). So when we do such guesswork, we maybe also guessed, the parameter |
Thank you for offering help but everything except this issue has already been resolved. SciML folks help resolve any issues quite quickly but still, our CI failures caused by upstream changes or bugs mostly originate in SciML. At the same time SciML most likely has more development than other dependencies, so per commit you may even be more reliable than other libraries but it's hard to tell. |
That code is a little scary 😅.
I would highly recommend sticking to public APIs if you want stability. There are no guarantees to the outside that internal functions will not change any arguments or behavior. If that was the case then every release would have to be a breaking release! For information on Julia's public interfaces, I would recommend reading: https://discourse.julialang.org/t/what-does-the-new-public-keyword-actually-do/108975 As a matter of style, we always define our public APIs in the top level file. You can see the public APIs of OrdinaryDiffEq here: https://github.com/SciML/OrdinaryDiffEq.jl/blob/v6.85.0/src/OrdinaryDiffEq.jl#L236-L469 The public APIs of a solver package are simply the algorithms. The functions used to define the stepping behavior of the algorithms are generally not meant to be documented public API.
It corresponds to the dimension of the solution object through its indexing definition. The indexing interface is defined here:
Yes, sorry about that. We have been solidifying our interfaces over the last year but it seems like you found a place that's not well-defined in the docs. The solution types boil down to acting as an AbstractVectorOfArray, and we are missing a full definition of that interface. https://docs.sciml.ai/RecursiveArrayTools/stable/array_types/#RecursiveArrayTools.VectorOfArray I'll see if I can get around to it in the JuliaCon time frame. But basically, The issue of course is that strict enforcement of interfaces which were previously loosely enforced causes a few hiccups in the edge cases, and that is exactly what we're seeing here.
Is there a more general interface function that should be considered here? I don't know of one in ArrayInterface.jl but I'd be interested to hear what the correct generalization is if it helps. I would think that the tensor dimensionality of a manifold object would be well-defined as that's more a definition of what kind of operator/vector an object is. The tensor dimensionality "are you a vector or matrix" is not the dimensionality of the manifold, i.e. the length of a state representation of an object in the vector space. And this would allow for example different charts/representations, because it's not the length of the data, and this would then use the ragged AbstractVectorOfArray structure as above. If I'm misunderstanding though, I'd be happy to learn how this needs to be generalized for manifold cases. |
Thanks for this very detailed answer. Concerning
I tried my best to do that ;) For the |
One additional comment on the tutorial you mentioned
There I have exactly the problem with for example
I am missing a bit what all the parameters of the function are. I think for the above-mentioned Manifold-Explicit-Eurer I (or Metusz) took exactly that tutorial and tried to make sense of the parameters and what they mean for the algorithm to use the DiffEq framework, but I probably understand far too less (still) about the rest of the framework. |
IIRC I needed to overload some internals (specifically,
The thing is, there are (to my knowledge) no generic and useful operations for arbitrary manifolds that generalize We have charts and representations figured out here and it works perfectly fine without |
The issue was fixed by #33 . |
My code got broken with (probably) a recent version of
SciML
. Possibly related to commit SciML/SciMLBase.jl@55d81afThis is my quickfix to the problem, devoid of testing or understanding.