-
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
Core type rewrite #144
Core type rewrite #144
Conversation
A major overhaul to replace the Tuple size hack in the base FixedArray, which now seems to be broken in 0.5. * Make a set of FixedArray subtypes with fixed dimensionality to replace the Tuple size hack which now seems to be broken in 0.5 * Many changes to core functions to deal with the fallout of the above. * Remove MutableFixedArray for now, since there's no concrete implementations. * New Ar3, Ar4, Ar5 concrete array types
@SimonDanisch I think I'm done here. It's a fair bit of churn, but it seems like this approach panned out and will fix the complete breakage in 0.5. I backed out of making FixedArray a subtype of AbstractArray - there were enough things to fix as it was! |
Thanks a lot! This seems reasonable! :)
Yeah, lets keep that for later... I tried it a few times and I think as long as we implement it as an abstract interface, we cannot do it unless we improve |
Ack too much refactoring the mess I'd made of the git history... things won't work very well without that! Added now. @andyferris has been prototyping yet another fixed size array package over at https://github.com/andyferris/StaticArrays.jl where he's got the array types as a subtype of AbstractArray. Seems to be working so far. |
The names Ar3 and Ar4 seem a bit short for types which may not be widely used. Also add some additional tests and documentation.
Has this broken things? I'm on 0.5 master and FixedSizeArray master and I can't multiply two
|
Or maybe the constructor for
|
@andyferris Yes seems broken, though I just checked and current master already has that bug when constructing a Mat from an AbstractArray - I'm not sure it ever worked... |
Matmul problem is tracked at #145. |
Uh oh. I've just updated to the latest 0.5, and it seems that someone has just fixed the underlying issue in Base which was causing everything to break with the existing design which uses So now I'm not sure whether to merge this. I think the new design is cleaner in some ways, but having a new set of types for each dimensionality isn't great. |
In the interests of avoiding API churn, I'm not going to merge this. Bit of a bummer, since it was quite a lot of work! I'll leave the branch around in case we need to bring this back from the dead later. |
Sorry to hear! At some point we should figure out how to solve this once and for all and if we want linear tuples ;) |
TBH I'm wondering whether just migrating to StaticArrays might make more sense once 0.5 comes around - so many of the design decisions in FixedSizeArrays were tradeoffs or workarounds for missing compiler capabilities in 0.4 and I'm a little burned out by trying to work around them ;-) The issue will be avoiding ecosystem fragmentation... at the moment it looks like we have one FSA-equivalent package for each julia version! |
yeah sorry, haven't been really helpful lately ;) I'm waiting for a few changes in base and improving GLVisualize is on higher priority right now! |
No problems at all, I appreciate the massive effort you're putting into GLVisualize. There's only so much time in the day :-) |
WIP! Do not merge!Upstream 0.5 changes seem to have broken FixedArray in a pretty fundamental way ( #137 #138 JuliaLang/julia#17247 )
I started trying to address the complete breakage in 0.5 by rethinking how the core type inheritance is arranged. There's a lot of things commented out and broken here which will need to be cleaned up later, but I'm throwing this up here for discussion.
The basic idea is that only low-dimensional fixed arrays are much use in practice since there's already a fairly strong assumption about stack allocation and loop unrolling in the existing code which only makes sense for a few elements. Given this assumption, it's probably ok to have an upper bound on the dimensionality:
Doing it this way means you can dispatch on either the dimensionality using
FixedArray{T,D}
, or the exact D-dimensional shape usingFixedArrayD{N1,N2,N3,...,T}
.As part of the experiment, I'm seeing what happens if I make FixedArray a subtype of AbstractArray.I ran out of steam on this - another time maybe.