ChainRules.jl icon indicating copy to clipboard operation
ChainRules.jl copied to clipboard

Fix type inference failure in norm on structural matrix

Open oxinabox opened this issue 11 months ago • 2 comments

This fixes the 1.11 failures on CI.

Not sure its the best way, but it basically boils down to

Julia 1.11 introduced a minor regression in inference of: zero.(Diagonal(Float64[;])) .* 0.0) This used to infer to Diagonal{Float64} now it infers to Union(Diagonal{Float64}, Matrix{Float64}) Similar to others.

Not sure this is exactly the cleanest or best way but this does fix it.

We also could change it not to test this. But small type inference failures do easily grow into big ones -- union splitting isn't a silver bullet.


I am not stepping up to primary maintainer duties, I am just on leave and thought i would check something and I saw CI was broken. hopefully someone can review this

oxinabox avatar Dec 29 '24 09:12 oxinabox

Apparently this inference failure doesn't happen in julia 1.11 without anything loaded, so it is caused by World Splitting somewhere

oxinabox avatar Dec 31 '24 07:12 oxinabox

CI still fails because of a failure with sortslices, but the norm problem is gone

oxinabox avatar Jan 01 '25 07:01 oxinabox