-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DO NOT MERGE: rely on julia-0.5 indexing mechanisms to fix a segfault #29
Conversation
Thanks, yes, I won't immediately merge, because some tests are failing currently, even for 0.5. But I like the simplification, I was never charmed by the many definitions of |
Just FYI, on travis all the 0.5 tests pass. What are you seeing fail? |
You are right---I noticed the Travis stats. Turns out I was running a 6-day old master. Didn't realize it was this much bleeding edge. |
Hmm, I'm surprised; I thought this would have passed ever since the merger of JuliaLang/julia#11242, which was back in early May. |
I still have the error in my scroll-back history, this is what I got with Commit f53b00e
an ambiguity (how much I love those) which is in the "dodgy indices" test, where admittedly dodgy indices are used. The update of julia went |
The PR doesn't rely on anything all that new, so I think you just got caught by a recent breakage. Perhaps JuliaLang/julia#17350. Anyway, not a big deal either way, except of course my sympathies for the various bugs. |
Has this fix been tested with the 0.5.0 release candidates? |
Bumping this item since Julia 0.5 has now been out for a while. |
Worth noting that AxisArrays is out now. |
@davidavdav, if you want this, do you want to rebase it or are you hoping I will? Or are you reluctant to abandon 0.4? |
This fixes JuliaLang/julia#17328, and is one of those happy circumstances where deleting a lot of code makes things work better. By declaring that the number of indices must match the dimensionality of the array, you're now allowing some of the automatic fallback mechanisms to kick in. In particular, trying to index
a[i,j]
whena
is 1-dimensional should just check thatj==1
(or is aCartesianIndex{0}
or similar) and then returna[i]
. By restricting dispatch to the case where the number of indices matches the dimensionality, you can let this happen.The reason this is marked DO NOT MERGE is that it works only on julia-0.5, and I haven't tested the impact this has on performance (probably favorable due to those
@inline
statements). On earlier versions of julia, you could annotate all those methods for the specific dimensionality, but I think the "splatting" version is basically unfixable 😦 unless you write the bounds-checking code yourself (which wouldn't be so bad, e.g.,map(i->@assert(i==1), I[ndims(a)-5:end])
or something, except you might need to handle1:1
,[1]
,CartesianIndex
types, etc.).CC @tkelman.