-
-
Notifications
You must be signed in to change notification settings - Fork 117
Tighten the interval returned by InternalITP when there's an exact zero crossing #1137
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
BTW, in that branch we assume that |
I do think this code is missing a branch for if right and left get within 1 ULP of each other. I think currently for a function like |
Shouldn't that case be covered by the DiffEqBase.jl/src/internal_itp.jl Line 84 in 0874ff4
|
This looks good to me. Would you object to either you adding the change from https://github.com/SciML/DiffEqBase.jl/actions/runs/14193284895/job/39762654888?pr=1137 or vice versa? There are some CI failures here that look potentially related (on both branches) so it would be nice to consolidate the changes so I can only investigate once. |
Either is fine by me, whatever is most convenient for you |
I've incorporated the change from #1136 here for convenience |
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.
Looks good to me! Let's see if CI agrees.
CI not too happy, it seems |
In this CI run, the only test failure that I can connect to callback rootfinding with LoadError: MethodError: no method matching exponent(::ReverseDiff.TrackedReal{Float64, Float64, Nothing}) |
I think the CI results might be bogus let's try again. We really don't want to be autodiffing the ITP so hopefully we aren't... |
First one looks relevant: https://github.com/SciML/DiffEqBase.jl/actions/runs/14233499341/job/39888542399?pr=1137 |
Yeah, I think I can reproduce it (from https://github.com/SciML/DelayDiffEq.jl/blob/master/test/integrators/events.jl#L8 ). It seems that the callback location is now shifted 1 ulp to the right compared to previous behaviour. So the test failure could be remediated by:
|
@ChrisRackauckas thoughts on the right approach here? |
Yeah if we are now better at stopping at the exact zero, that's better. We should accept that and change the test. Our goal has always been to get there, it just wasn't robust before. |
sounds good. In that case, I think this is ready to merge and we can fix the test. |
Background is here: https://github.com/SciML/DiffEqBase.jl/pull/1127/files#r2022436123
To summarize: inside the branch where the callback condition is evaluated to an exact zero, this PR fills the
left
andright
fields of the solution with the location of the zero crossing instead of the values at the start of that ITP iteration.