Skip to content
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

Remove the hasmethod check #1095

Open
KristofferC opened this issue Oct 14, 2024 · 14 comments · May be fixed by #1098
Open

Remove the hasmethod check #1095

KristofferC opened this issue Oct 14, 2024 · 14 comments · May be fixed by #1098

Comments

@KristofferC
Copy link

KristofferC commented Oct 14, 2024

The hasmethod check in

if hasmethod(reeval_internals_due_to_modification!,
has been reported to have quite severe runtime penalty, at least on 1.10.2.

As far as I understand, this is some kind of compatibility check so moving that to top-level would be preferable.

@oscardssmith
Copy link
Contributor

I though as of JuliaLang/julia#48639, it should be done at compile time.

@KristofferC
Copy link
Author

Yes, but it has been reported not to happen apparently.

@oscardssmith
Copy link
Contributor

@vtjnash any idea why this would happen?

@vtjnash
Copy link

vtjnash commented Oct 14, 2024

kwarg matching is a runtime feature, so it doesn't have a compile time component

@KristofferC
Copy link
Author

@oscardssmith, in which SciMLBase version was this new way of calling reeval_internals_due_to_modification! introduced? We can just do a top-level check for that version instead.

@ChrisRackauckas
Copy link
Member

https://github.com/SciML/SciMLBase.jl/releases/tag/v2.53.0 is the scimlbase part, but it's actually a downstream requirement on SciML/OrdinaryDiffEq.jl#2467 existing (and figuring out what OrdinaryDiffEqCore version that's a part of is a doozy due to the issues with the tooling 😅)

@oscardssmith
Copy link
Contributor

can't we at this point just delete the hasmethod check since it only exists for compatibility with old versions of OrdinaryDiffEq?

@KristofferC
Copy link
Author

I deleted all apply_discrete_callback! from DiffEqBase and tests still pass... Wat.

@KristofferC
Copy link
Author

but it's actually a downstream requirement on SciML/OrdinaryDiffEq.jl#2467

Wow, that is very weird how another package extends a method with a new keyword like that.

@ChrisRackauckas
Copy link
Member

Agreed, we really need JuliaLang/julia#55516. OrdinaryDiffEq and DiffEqBase are split mostly to lesson the load times of Sundials.jl and not for any real code separation reason.

@KristofferC
Copy link
Author

It is still kind of weird how one function takes different kwargs depending on the integrator...

@ChrisRackauckas
Copy link
Member

All of the integrators have been updated so this interface now just has kwargs for all current releases.

@KristofferC
Copy link
Author

@ChrisRackauckas
Copy link
Member

It's missing the kwarg. We need to update the interface spec, but since you can't really test interfaces well downstream that's a bug that just hadn't been caught yet. We need some language tooling to help here 😅.

@ChrisRackauckas ChrisRackauckas linked a pull request Oct 20, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants