JuliaArrays / JuliaArrays/StaticArrays.jl

`mapreduce`/`mapfoldl` unrolls fully, failing to compile for large static sizes

Open
#1,028 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
844
Forks
159
Avg merge
3d 21h
Merged PRs (30d)
3

Description

MWE:

julia> x = SizedVector{30000}(randn(30000));

julia> 0.5 in x
ERROR: syntax: invalid syntax (memory-error out of gc handles)
Stacktrace:
 [1] top-level scope
   @ REPL[4]:1
 [2] _mapreduce
   @ ~/.julia/packages/StaticArrays/58yy1/src/mapreduce.jl:113 [inlined]
 [3] in(x::Float64, a::SizedVector{30000, Float64, Vector{Float64}})
   @ StaticArrays ~/.julia/packages/StaticArrays/58yy1/src/mapreduce.jl:267
 [4] top-level scope
   @ REPL[4]:1
 [5] top-level scope

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

Reproduce the MWE and inspect StaticArrays/mapreduce.jl, especially _mapreduce around line 113 and in around line 267. Determine how mapreduce and mapfoldl are fully unrolled for large static sizes; done means large inputs such as SizedVector{30000} compile without the memory-error while preserving the operation's behavior.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.