Skip to content

Equality of Composites with different backings causes stackoverflow #261

@oxinabox

Description

@oxinabox

see:

julia> tup = (1.0, 2.0)
(1.0, 2.0)

julia> c_tup1 = Composite{typeof(tup)}(1.0, 2.0)
Composite{Tuple{Float64,Float64}}(1.0, 2.0)

julia> c_tup2 = Composite{typeof(tup)}(1.0, @thunk(2*1.0))
Composite{Tuple{Float64,Float64}}(1.0, Thunk(var"#89#90"()))

julia> c_tup1 == c_tup2
ERROR: StackOverflowError:
Stacktrace:
 [1] ==(::Composite{Tuple{Float64,Float64},Tuple{Float64,Float64}}, ::Composite{Tuple{Float64,Float64},Tuple{Float64,Thunk{var"#89#90"}}}) at /Users/oxinabox/JuliaEnvs/ChainRulesWorld/ChainRulesCore.jl/src/differentials/composite.jl:52 (repeats 79982 times)

I think this should be a fairly easy one to debug and fix so marking it a [good first issue]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Structural TangentRelated to the `Tangent` type for structured (composite) valuesbugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions