New flagged storage for parallel joins#737
New flagged storage for parallel joins#737Imberflur wants to merge 3 commits intoamethyst:masterfrom
Conversation
…::get that should eliminate unsoundness if followed, add extra safety requirement to UnprotectedStorage::get implementation, comment out unsound methods on JoinIter and some Storages that were clearly unsound with the newly documented requirements (not all storages where reviewed)
…access of a component in a non streaming join as well as using par_join with tracked mutable access
…the current removal of restricted storage (and comment out an example that was using the restricted storage)
|
|
||
| [[example]] | ||
| name = "track" | ||
| # TODO: restricted storage is unsound without streaming iterator or some changes made to it (i.e. to not allow access to component data on other entities in the mutable case) |
There was a problem hiding this comment.
My addition of GAT support of the storage traits should allow for this, I think.
There was a problem hiding this comment.
Yeah, Join::Type would probably need to be made into a GAT as well. Are there any GAT based iterator crates that could serve as a replacement for the Iterator trait from std? I'm not seeing any 🤔
There was a problem hiding this comment.
It's pretty trivial to create one.
trait StreamingIterator {
type Item<'a>;
fn next(&mut self) -> Self::Item<'_>;
}I've not seen any 'canonical' streaming iterator crates that use GATs yet. Perhaps when std gets such a trait (here's hoping!) with for integration we can use that instead.
There was a problem hiding this comment.
It will need some of the common adapters/methods: map, for_each, filter, filter_map, collect. Which seems fairly doable but is a bit more than the just the minimal version.
Checklist
API changes
Breaking: RestrictedStorage removed (unsound without streaming JoinIter)
Breaking: DerefFlaggedStorage removed (unsound without streaming JoinIter)
Breaking: JoinIter::get/JoinIter::get_unchecked removed (unsound see #647) (can probably be brought back with a streaming JoinIter impl using GATs)
UnsplitFlaggedStorage added for deferred mutable access (like DerefFlaggedStorage) that can also be used in parallel joins (unlike any other flagged storage) (locked behind
nightlyfeature).Breaking: Safety comments on Join/UnprotectedStorage traits improved (downstream crates that implement novel storages should review these).