Skip to content

[VIBE] fix mapreduce stackoverflow#3000

Open
wsmoses wants to merge 1 commit into
mainfrom
vibe/mr
Open

[VIBE] fix mapreduce stackoverflow#3000
wsmoses wants to merge 1 commit into
mainfrom
vibe/mr

Conversation

@wsmoses

@wsmoses wsmoses commented Jun 22, 2026

Copy link
Copy Markdown
Member

resolves #2966

@wsmoses wsmoses requested a review from avik-pal June 22, 2026 18:20
Comment thread src/TracedRArray.jl
end

function Base._mapreduce_dim(
@nospecialize(f), @nospecialize(op), @nospecialize(init::Base._InitialValue), A::AnyTracedRArray, dims

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
@nospecialize(f), @nospecialize(op), @nospecialize(init::Base._InitialValue), A::AnyTracedRArray, dims
@nospecialize(f),
@nospecialize(op),
@nospecialize(init::Base._InitialValue),
A::AnyTracedRArray,
dims,

Comment thread src/TracedRArray.jl
end

function Base._mapreduce_dim(
@nospecialize(f), @nospecialize(op), @nospecialize(init::Base._InitialValue), A::AnyTracedRArray, dims::AbstractVector{<:Integer}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
@nospecialize(f), @nospecialize(op), @nospecialize(init::Base._InitialValue), A::AnyTracedRArray, dims::AbstractVector{<:Integer}
@nospecialize(f),
@nospecialize(op),
@nospecialize(init::Base._InitialValue),
A::AnyTracedRArray,
dims::AbstractVector{<:Integer},

Comment thread src/TracedRArray.jl
end

function Base._mapreduce_dim(
@nospecialize(f), @nospecialize(op), @nospecialize(init::Base._InitialValue), A::AnyTracedRArray, dims::Colon

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
@nospecialize(f), @nospecialize(op), @nospecialize(init::Base._InitialValue), A::AnyTracedRArray, dims::Colon
@nospecialize(f),
@nospecialize(op),
@nospecialize(init::Base._InitialValue),
A::AnyTracedRArray,
dims::Colon,

Comment thread src/TracedRArray.jl
end

function Base._mapreduce_dim(
@nospecialize(f), @nospecialize(op), @nospecialize(init), A::AnyTracedRArray, dims::AbstractVector{<:Integer}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
@nospecialize(f), @nospecialize(op), @nospecialize(init), A::AnyTracedRArray, dims::AbstractVector{<:Integer}
@nospecialize(f),
@nospecialize(op),
@nospecialize(init),
A::AnyTracedRArray,
dims::AbstractVector{<:Integer},

Comment thread src/TracedRArray.jl
end

function Base._mapreduce_dim(
@nospecialize(f), @nospecialize(op), @nospecialize(init), A::AnyTracedRArray, dims::Colon

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
@nospecialize(f), @nospecialize(op), @nospecialize(init), A::AnyTracedRArray, dims::Colon
@nospecialize(f),
@nospecialize(op),
@nospecialize(init),
A::AnyTracedRArray,
dims::Colon,

end
end

map_sum_closure_bad(x) = only(map(_ -> sum(x; dims = 2), 1:1))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
map_sum_closure_bad(x) = only(map(_ -> sum(x; dims = 2), 1:1))
map_sum_closure_bad(x) = only(map(_ -> sum(x; dims=2), 1:1))

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.

map over a sum gives a StackOverflow

1 participant