mcabbott / mcabbott/TransmuteDims.jl
`unalias`-ing
Open
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 8
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
It would be nice if TransmutedDimsArray behaved like Adjoint does here:
julia> x = [1 2; 3 4]; @btime $x .= $x' # detects aliasing, makes a copy of RHS
23.971 ns (1 allocation: 96 bytes)
2×2 Matrix{Int64}:
1 2
3 4
julia> x = [1 2; 3 4]; @btime $x .= $(PermutedDimsArray(x, (2,1))) # does not detect this
16.784 ns (0 allocations: 0 bytes)
2×2 Matrix{Int64}:
1 2
2 4
julia> x = [1 2; 3 4]; @btime $x .= $(TransmutedDimsArray(x, (2,1))) # no detection, and slow
62.352 ns (6 allocations: 320 bytes)
2×2 Matrix{Int64}:
1 2
2 4
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 reproducing the Julia examples comparing Adjoint, PermutedDimsArray, and TransmutedDimsArray during in-place assignment. Then trace TransmutedDimsArray's alias handling and compare it with the behavior of Adjoint; done means aliasing is detected and the assignment produces the correct result without the reported slowdown and allocations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- performance
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100