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

Avoid lowering to Base.rest(), as it infers poorly #721

Merged
merged 1 commit into from
Jun 6, 2023

Conversation

staticfloat
Copy link
Contributor

While it would be best to fix Base.rest() to be able to infer properly, at the moment the destructuring with a splat in the arguments to this frule end up causing inference issues in Diffractor.

@oxinabox
Copy link
Member

oxinabox commented Jun 2, 2023

Is Base.tail public API?

This is probably fine as both the nominally correct type has Base.tail implemented (https://github.com/JuliaDiff/ChainRulesCore.jl/blob/caf8692ca1bf5fabeb4afc86340eef9456da469c/src/tangent_types/tangent.jl#L106)
and the most commonly used type (Tuple) has it.

However, right now CI is broken due to not having #721 in yet.
Hopefully i hwill have that in today and can also merge this.

It is pretty bad that this breaks inference so badly, it looks so idiomatic. Can we open an upstream issue in JuliaLang/julia about it?

@staticfloat
Copy link
Contributor Author

I have opened an error report and an MWE here: JuliaLang/julia#50046

While it would be best to fix `Base.rest()` to be able to infer
properly, at the moment the destructuring with a splat in the arguments
to this `frule` end up causing inference issues in Diffractor.
@oxinabox oxinabox force-pushed the sf/no_rest_for_the_wicked branch from 46f80e6 to bc57832 Compare June 6, 2023 04:20
@oxinabox oxinabox merged commit 82dcffe into JuliaDiff:main Jun 6, 2023
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 this pull request may close these issues.

2 participants