Unexpected results with variable LHS indices
Open
Nobody has claimed this yet.
parsing
- Dominant language
- Julia
- Stars
- 668
- Forks
- 30
- PR merge metrics
- No merged PRs in 30d
Description
Why these two are different?
using Tullio
w = collect(1.0:2.0);
h = collect(1.0:3.0);
I = zeros(4);
@tullio I[j+k-1] = w[j] * h[k];
# I = [1.0, 2.0, 3.0, 6.0]
vs.
I .= 0
for j ∈ 1:length(w), k in 1:length(h)
I[j+k-1] += w[j] * h[k]
end
# I = [1.0, 4.0, 7.0, 6.0]
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the two Julia snippets from the issue and comparing the generated behavior for the variable left-hand index in @tullio. Trace the macro's handling of indexed assignments and reductions; done means the behavior is explained and the @tullio result is consistent with the explicit loop or the intended semantics are documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100