mcabbott / mcabbott/TransmuteDims.jl

`unalias`-ing

Open
#34 0 comments 0 reactions 0 assignees View on GitHub

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

  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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.