JuliaArrays / JuliaArrays/FillArrays.jl

Collision of LazyArrays and FillArrays broadcasting

Open
#143 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
187
Forks
41
Avg merge
17h 29m
Merged PRs (30d)
1

Description

This came up here: https://discourse.julialang.org/t/preventing-collect-on-broadcasting-expressions/57996

julia> using LazyArrays, FillArrays

julia> BroadcastArray(+, fill(1,2), 3)
2-element BroadcastVector{Int64, typeof(+), Tuple{Vector{Int64}, Int64}}:
 4
 4

julia> broadcast(+, Fill(1,2), 3)
2-element Fill{Int64, 1, Tuple{Base.OneTo{Int64}}} = 4

julia> BroadcastArray(+, Fill(1,2), 3)
ERROR: type Fill has no field f
Stacktrace:
 [1] getproperty(x::Fill{Int64, 1, Tuple{Base.OneTo{Int64}}}, f::Symbol)
   @ Base ./Base.jl:33
 [2] call(#unused#::ArrayLayouts.FillLayout, a::Fill{Int64, 1, Tuple{Base.OneTo{Int64}}})
   @ LazyArrays ~/.julia/packages/LazyArrays/MAEFm/src/lazyapplying.jl:21
 [3] call(a::Fill{Int64, 1, Tuple{Base.OneTo{Int64}}})
   @ LazyArrays ~/.julia/packages/LazyArrays/MAEFm/src/lazyapplying.jl:22
 [4] BroadcastArray(A::Fill{Int64, 1, Tuple{Base.OneTo{Int64}}})
   @ LazyArrays ~/.julia/packages/LazyArrays/MAEFm/src/lazybroadcasting.jl:46
 [5] BroadcastArray(f::Function, A::Fill{Int64, 1, Tuple{Base.OneTo{Int64}}}, As::Int64)
   @ LazyArrays ~/.julia/packages/LazyArrays/MAEFm/src/lazybroadcasting.jl:33
 [6] top-level scope
   @ REPL[66]:1

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 failure with the shown Julia calls to BroadcastArray and broadcast using LazyArrays and FillArrays. Read the LazyArrays entry points in src/lazybroadcasting.jl and src/lazyapplying.jl named by the stack trace, then determine the compatibility change needed so broadcasting a Fill works without the type error and verify the original example succeeds.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
backend
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.