From 41bbcf1ff65f3ebdbc7e86b378cd3a6f68e1e627 Mon Sep 17 00:00:00 2001 From: "William S. Moses" Date: Thu, 30 Oct 2025 16:58:32 -0500 Subject: [PATCH 1/3] Don't mark nospecialize if type var is captured --- src/Tracing.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Tracing.jl b/src/Tracing.jl index 79e22a6511..2459e9f13f 100644 --- a/src/Tracing.jl +++ b/src/Tracing.jl @@ -446,7 +446,7 @@ Base.@nospecializeinfer function traced_type_inner( end Base.@nospecializeinfer function traced_type_inner( - @nospecialize(A::Type{AbstractArray{T}}), + A::Type{AbstractArray{T}}, seen, mode::TraceMode, @nospecialize(track_numbers::Type), @@ -463,7 +463,7 @@ Base.@nospecializeinfer function traced_type_inner( end Base.@nospecializeinfer function traced_type_inner( - @nospecialize(A::Type{AbstractArray{T,N}}), + A::Type{AbstractArray{T,N}}, seen, mode::TraceMode, @nospecialize(track_numbers::Type), From 9a3580fd03950d809ae702993221d37b05cc3703 Mon Sep 17 00:00:00 2001 From: "William S. Moses" Date: Thu, 30 Oct 2025 17:05:41 -0500 Subject: [PATCH 2/3] fix --- src/Tracing.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Tracing.jl b/src/Tracing.jl index 2459e9f13f..15b585c044 100644 --- a/src/Tracing.jl +++ b/src/Tracing.jl @@ -455,7 +455,7 @@ Base.@nospecializeinfer function traced_type_inner( ) where {T} if mode == ConcreteToTraced return AbstractArray{ - traced_type_inner(T, seen, mode, track_numbers, sharding, runtime) + traced_type_inner(eltype(A), seen, mode, track_numbers, sharding, runtime) } else return A @@ -472,7 +472,7 @@ Base.@nospecializeinfer function traced_type_inner( ) where {T,N} if mode == ConcreteToTraced return AbstractArray{ - traced_type_inner(T, seen, mode, track_numbers, sharding, runtime),N + traced_type_inner(eltype(A), seen, mode, track_numbers, sharding, runtime),ndims(A) } else return A From 28993ee8f91744a131572361f4a4c0f06801071b Mon Sep 17 00:00:00 2001 From: William Moses Date: Thu, 30 Oct 2025 17:53:03 -0500 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/Tracing.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Tracing.jl b/src/Tracing.jl index 15b585c044..45dad6426c 100644 --- a/src/Tracing.jl +++ b/src/Tracing.jl @@ -455,7 +455,7 @@ Base.@nospecializeinfer function traced_type_inner( ) where {T} if mode == ConcreteToTraced return AbstractArray{ - traced_type_inner(eltype(A), seen, mode, track_numbers, sharding, runtime) + traced_type_inner(eltype(A), seen, mode, track_numbers, sharding, runtime) } else return A @@ -472,7 +472,8 @@ Base.@nospecializeinfer function traced_type_inner( ) where {T,N} if mode == ConcreteToTraced return AbstractArray{ - traced_type_inner(eltype(A), seen, mode, track_numbers, sharding, runtime),ndims(A) + traced_type_inner(eltype(A), seen, mode, track_numbers, sharding, runtime), + ndims(A), } else return A