JuliaDiff / JuliaDiff/ChainRulesCore.jl

Making `getproperty`, `getindex` and `iterate` more type stable for `Tangent`s

Open
#606 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Structural Tangent
Dominant language
Julia
Stars
267
Forks
66
PR merge metrics
No merged PRs in 30d

Description

Constprop is rarely able to pierce the function barrier and get through to the underlying type. This would especially help when the backing is a tuple or NamedTuple.

I think the main question is how to do this. @inline as seen in https://github.com/JuliaLang/julia/blob/master/base/tuple.jl is one option. Base.@constprop :aggressive is another that Diffractor currently employs.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Tangent implementations of getproperty, getindex, and iterate, then compare how tuple.jl uses @inline with how Diffractor uses Base.@constprop :aggressive. Confirm that the chosen approach preserves type stability for tuple and NamedTuple backings; done means these operations can specialize through the function barrier.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
performance
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.