chore(deps): update dependency apple/swift-collections to from: "1.5.0"#11
Open
renovate[bot] wants to merge 1 commit into
Open
chore(deps): update dependency apple/swift-collections to from: "1.5.0"#11renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
61eeb9f to
a37e8e0
Compare
a37e8e0 to
e9f854d
Compare
e9f854d to
7616dbc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
from: "1.0.0"→from: "1.5.0"Release Notes
apple/swift-collections (apple/swift-collections)
v1.5.0: Swift Collections 1.5.0Compare Source
This feature release supports Swift toolchain versions 6.0, 6.1, 6.2, and 6.3. It includes the following new features and bug fixes:
Debugging enhancements
The package now defines LLDB data formatters for
RigidArray. The formatters are emitted into the executable binary, and they are automatically loaded by LLDB. We expect to implement formatters for (many) more types in subsequent releases.New stable APIs
RigidArrayandUniqueArraynow conform toEquatablewhen their element type isEquatable. This conformance requires a Swift 6.4 or later toolchain (it relies on SE-0499 generalizations ofEquatable/Hashableto support noncopyable conforming types).RigidArrayandUniqueArraygained anisTriviallyIdentical(to:)operation, which reports whether two instances share their underlying storage allocation. This does not require the element type to beEquatable, and it works with noncopyable elements.BitSetgained amakeIterator(from:)shortcut for starting iteration at (or after) a specific member, avoiding a linear scan from the start of the set.OrderedDictionarygained areplaceElement(at:withKey:value:)operation that replaces the key-value pair at a given index. The new key is allowed to equal the existing key at that index (in which case only the value is updated).Experimental hashed containers (
UnstableHashedContainerstrait)The Robin-Hood-hashed
UniqueSet,RigidSet,UniqueDictionary, andRigidDictionarytypes in theBasicContainersmodule continue to evolve behind theUnstableHashedContainerspackage trait. This release brings a number of correctness fixes and performance improvements:maxProbeLengthmaintenance to avoid probe-length bloat.RigidDictionary.updateValue(forKey:with:)(the latter exhibited undefined behavior on removals).RigidSet.insert(maximumCount:from:)no longer spuriously reports a capacity overflow due to incorrect accounting.UnstableHashedContainerstrait can now be enabled independently ofUnstableContainersPreview.These types remain source-unstable for now.
Experimental sorted collections (
UnstableSortedCollectionstrait)The
SortedCollectionsmodule'sSortedSethas gained the following additions:SortedSetnow supports value-range subscripts for the full variety of standard range expression types,ClosedRange,PartialRangeFrom,PartialRangeThrough, andPartialRangeUpTo.SortedSet.firstIndex(after:)andSortedSet.lastIndex(before:)return the index to the nearest member following or preceding a given value.This release also fixes several underlying B-tree bugs that were surfaced by these additions.
These types remain source-unstable; they have known API deficiencies that will need to be addressed before they ship.
Experimental container protocols (
UnstableContainersPreviewtrait)The
ContainersPreviewmodule's protocol hierarchy and associated types continue to be developed. Several constructs have been renamed to follow Swift Evolution proposals in flight.struct Box<T>struct UniqueBox<Value>struct Borrow<Target>struct Ref<Target>struct Inout<Target>struct MutableRef<Target>Producer.ProducerErrorProducer.FailureProducer.generateNext()Producer.next()Producer.skip(upTo:)Producer.skip(by:)For
UniqueBox,RefandMutableRef, there are deprecated typealiases for the old names, preserving source compatibility.Other changes to the experimental container model:
Container.Indexno longer needs to conform toComparable. This allows linked lists to become containers.RigidArray,UniqueArray,RigidDeque, andUniqueDequenow conform to the container protocols.Producer.collect(into:)for collecting a producer's output into aRangeReplaceableContainer.BorrowingIteratorProtocol.copy()for turning a borrowing iterator into a producer.filterandmapoverloads forBorrowingIteratorProtocol,Producer, andDrain.BorrowingSequence.firstwas removed.BorrowingSequence,BorrowingIteratorProtocoland their requirements have temporarily gained trailing underscores to avoid naming conflicts with the (provisional) protocol definition in the Standard Library. We expect these definitions to be removed when these protocols officially become part of the stdlib.The protocol-based APIs in
ContainersPreviewnow require a Swift 6.4 or later toolchain.UniqueBoxis source-stable, therefore it continues to require Swift 6.2.Notable bug fixes
HashTreeCollections: Fixed an invariant violation that could be triggered by some operations onTreeSet/TreeDictionary._RopeModule: Fixed an infinite loop when hashing the UTF-8 view of a multi-chunk big substring.BitCollections: Fixed a bogus precondition inBitArray.insert(repeating:count:at:); fixedBitSet.isSubset(of: Range<Int>)to correctly examine elements above the range's upper word.HeapModule: FixedHeap.insert(contentsOf:)to use a wrapping multiply in its Floyd-heuristic computation; added a missing bounds assertion inHeap._UnsafeHandle.swapAt(_:with:).OrderedCollections: FixedOrderedSetcrash on negative capacity values; minor fixes in_HashTable.UnsafeHandle.DequeModule: Fixed sizing issue inUniqueDeque.replace(removing:addingCount:initializingWith:); fixed a missing argument validation inRigidDeque.nextMutableSpan(after:maximumCount:);RigidDeque.consume(_:consumingWith:)now closes the resulting gap before returning; added zero-count fast-paths; replace/prepend operations taking aCollectionnow verify that the source's count matches its contents.BasicContainers: Fixed an overallocation issue inUniqueArray.replace(removing:copying:); fixed a partial-initialization correctness issue inRigidArray.replace(removing:consumingWith:addingCount:initializingWith:).What's Changed
BorrowingSequenceimplementation with proposal by @natecook1000 in #609Container.Indexto conform toComparableby @lorentey in #623BitSet.makeIterator(from:)by @lorentey in #627UniqueArray.edit’s docs by @lorentey in #642BoxtoUniqueBox; align API surface with SE-0517 by @lorentey in #640struct Borrow⟹struct Refby @lorentey in #643struct Inout⟹struct MutableRefby @lorentey in #646New Contributors
Full Changelog: apple/swift-collections@1.4.1...1.5.0
v1.4.1: Swift Collections 1.4.1Compare Source
This patch release is mostly focusing on evolving the package traits
UnstableContainersPreviewandUnstableHashedContainers, with the following notable fixes and improvements to the stable parts of the package:DequeModuleandOrderedCollectionsmodules.Changes to experimental package traits
The new set and dictionary types enabled by the
UnstableHashedContainerstrait have now resolved several correctness issues in their implementation of insertions. They have also gained some low-hanging performance optimizations. Like before, these types are in "working prototype" phase, and while they have working implementations of basic primitive operations, we haven't done much work validating their performance yet. Feedback from intrepid early adopters would be very welcome.The
UnstableContainersPreviewtrait has gained several new protocols and algorithm implementations, working towards one possible working model of a coherent, ownership-aware container/iteration model.BidirectionalContainerdefines a container that allows iterating over spans backwards, and provides decrement operations on indices -- an analogue of the classicBidirectionalCollectionprotocol.RandomAccessContainermodels containers that allow constant-time repositioning of their indices, likeRandomAccessCollection.MutableContaineris the ownership-aware analogue ofMutableCollection-- it models a container type that allows its elements to be arbitrarily reordered and mutated/reassigned without changing the shape of the data structure (that is to say, without invalidating any indices).PermutableContaineris an experimental new spinoff ofMutableContainer, focusing on reordering items without allowing arbitrary mutations.RangeReplaceableContaineris a partial, ownership-aware analogue ofRangeReplaceableCollection, providing a full set of insertion/append/removal/consumption operations, with support for fixed-capacity conforming types.DynamicContainerrounds out the range-replacement operations with initializer and capacity reservation requirements that can only be implemented by dynamically sized containers.map,reduceandfilteroperations on borrowing iterators, producers and drains, as well acollect(into:)family of methods to supply "greedy" variants, generating items into a container of the user's choice. Importantly, the algorithms tend to be defined on the iterator types, rather than directly on some sequence/container -- going this way has some interesting benefits (explicitness, no confusion between the various flavors or the existingSequencealgorithms), but they also have notable drawbacks (minor design issues with the borrowing iterator protocol, unknowns on how the pattern would apply to container algorithms, etc.).Like before, these are highly experimental, and they will definitely change in dramatic/radical ways on the way to stabilization. Note that there is no project- or team-wide consensus on any of these constructs. I'm publishing them primarily as a crucial reference point, and to gain a level of shared understanding of the actual problems that need to be resolved, and the consequences of the design path we are on.
What's Changed
New Contributors
Full Changelog: apple/swift-collections@1.4.0...1.4.1
v1.4.0: Swift Collections 1.4.0Compare Source
This feature release supports Swift toolchain versions 6.0, 6.1 and 6.2. It includes a variety of bug fixes, and ships the following new features:
New ownership-aware ring buffer and hashed container implementations
In the
DequeModulemodule, we have two new source-stable types that provide ownership-aware ring buffer implementations:struct UniqueDeque<Element>is a uniquely held, dynamically resizing, noncopyable deque.struct RigidDeque<Element>is a fixed-capacity deque implementation.RigidDeque/UniqueDequeare toDequelikeRigidArray/UniqueArrayare toArray-- they provide noncopyable embodiments of the same basic data structure, with many of the same operations.In the
BasicContainersmodule, this release adds previews of four new types, implementing ownership-aware hashed containers:struct UniqueSet<Element>is a uniquely held, dynamically resizing set.struct RigidSet<Element>is a fixed-capacity set.struct UniqueDictionary<Key, Value>is a uniquely held, dynamically resizing dictionary.struct RigidDictionary<Key, Value>is a fixed-capacity dictionary.These are direct analogues of the standard
SetandDictionarytypes. These types are built on top of theEquatableandHashableprotocol generalizations that were proposed in SE-0499; as that proposal is not yet implemented in any shipping toolchain, these new types are shipping as source-unstable previews, conditional on a newUnstableHashedContainerspackage trait. The final API of these types will also deeply depend on thestruct Borrowandstruct Inoutproposals (and potentially other language/stdlib improvements) that are currently working their way through the Swift Evolution process. Accordingly, we may need to make source-breaking changes to the interfaces of these types -- they are not ready to be blessed as Public API. However, we encourage intrepid engineers to try them on for size, and report pain points. (Of which we expect there will be many in this first preview.)We continue the pattern of
Rigid-andUnique-naming prefixes with these new types:Uniquetypes (UniqueArray,UniqueDeque,UniqueSet,UniqueDictionaryetc.) are dynamically self-sizing containers that automatically reallocate their storage as needed to best accommodate their contents; theUniqueprefix was chosen to highlight that these types are always uniquely held, avoiding the complications of mutating shared copies.Rigidtypes remove dynamic sizing, and they operate strictly within an explicitly configured capacity. Dynamic sizing is not always appropriate -- when targeting space- or time-constrained environments (think embedded use cases or real-time work), it is preferable to avoid implicit reallocations, and to instead choose to have explicit control over when (and if) storage is reallocated, and to what size. This is where theRigidtypes come in: their instances are created with a specific capacity and it is a runtime error to exceed that. This makes them quite inflexible (hence the "rigid" qualifier), but in exchange, their operations provide far stricter complexity guarantees: they exhibit no random runtime latency spikes, and they can trivially fit in strict memory budgets.Early drafts of borrowing sequence, generative iteration and container protocols
This release includes highly experimental but working implementations of new protocols supplying ownership-aware alternatives to the classic
Sequence/Collectionprotocol hierarchy. These protocols and the generic operations built on top of them can be turned on by enabling theUnstableContainersPreviewpackage trait.protocol BorrowingSequence<Element>models borrowing sequences with ephemeral lifetimes. (This is already progressing through Swift Evolution.)protocol Container<Element>models constructs that physically store their contents, and can expose stable spans over them.protocol Producer<Element, ProducerError>models a generative iterator -- a construct that generates items demand.protocol Drain<Element>refinesProducerto model an in-place consumable elements -- primarily for use around container types.In this version, the package has developed these protocols just enough to implement basic generic operations for moving data between containers like
UniqueArrayandRigidDeque. As we gain experience using these, future releases may start adding basic generic algorithms, more protocols (bidirectional, random-access, (per)mutable, range-replaceable containers etc.) convenience adapters, and other features -- or we may end up entirely overhauling or simply discarding some/all of them. Accordingly, the experimental interfaces enabled byUnstableContainersPrevieware not source stable, and they are not intended for production use. We expect the eventual production version of these (or whatever designs they evolve into) to ship in the Swift Standard Library. We do highly recommend interested folks to try playing with these, to get a feel for the strange problems of Ownership.Besides these protocols, the package also defines rudimentary substitutes of some basic primitives that belong in the Standard Library:
struct InputSpan<Element>the dual ofOutputSpan-- whileOutputSpanis primarily for moving items into somebody else's storage,InputSpanenables safely moving items out of storage.struct Borrow<Target>represents a borrowing reference to an item. (This package models this with a pointer, which is an ill-fitting substitute for the real implementation in the stdlib.)struct Inout<Target>represents a mutating reference to an item.A formal way to access
SortedSetandSortedDictionarytypesThe
SortedCollectionsmodule contains (preexisting) early drafts of two sorted collection typesSortedSetandSortedDictionary, built on top of an in-memory B-tree implementation. This release defines anUnstableSortedCollectionspackage trait that can be used to enable building these types for experimentation without manually modifying the package. Like in previous releases, these implementations remain unfinished in this release, with known API issues; accordingly, these types remain unstable. (Issue #1 remains open.) Future package releases may change their interface in ways that break source compatibility, or they may remove these types altogether.Minor interface-level changes
The
Collectionsmodule no longer uses the unstable@_exported importfeature. Instead, it publishes public typealiases of every type that it previously reexported fromDequeModule,OrderedCollections,BitCollections,HeapModuleandHashTreeCollections.We renamed some
RigidArray/UniqueArrayoperations to improve their clarity at the point of use. The old names are still available, but deprecated.append(count:initializingWith:)append(addingCount:initializingWith:)insert(count:at:initializingWith:)insert(addingCount:at:initializingWith:)replaceSubrange(_:newCount:initializingWith:)replace(removing:addingCount:initializingWith:)replaceSubrange(_:moving:)replace(removing:moving:)replaceSubrange(_:copying:)replace(removing:copying:)copy()clone()copy(capacity:)clone(capacity:)We have now defined a complete set of
OutputSpan/InputSpan-basedappend/insert/replace/consumeprimitives, fully generalized to be implementable by piecewise contiguous containers. These operations pave the way for aContainer-based analogue of the classicRangeReplaceableCollectionprotocol, with most of the user-facing operations becoming standard generic algorithms built on top of these primitives:The package no longer uses the code generation tool
gyb.What's Changed
packageaccess modifier and get rid of gybbing by @lorentey in #526RigidDequeandUniqueDequeby @lorentey in #557@_exported importby @lorentey in #566RigidArray/UniqueArrayupdates by @lorentey in #569RigidArray/UniqueArray: Add new copying span initializers by @Azoy in #572RigidDeque/UniqueDeque: Add some top-level documentation by @lorentey in #571maximumCountby @lorentey in #575update(with:)method by @benrimmington in #538span(after/before:)(+ other doc fixes) by @natecook1000 in #541New Contributors
Full Changelog: apple/swift-collections@1.3.0...1.4.0
v1.3.0: Swift Collections 1.3.0Compare Source
This feature release supports Swift toolchain versions 6.0, 6.1 and 6.2, and it includes the following improvements:
BasicContainersmoduleThis new module collects ownership-aware, low-level variants of existing data structures in the core standard library. In this release, this module consists of two array variants,
UniqueArrayandRigidArray.These new types are provided as less flexible, noncopyable alternatives to the classic
Arraytype. The standardArrayimplements value semantics with the copy-on-write optimization; this inherently requires elements to be copyable, and it is itself copyable.struct UniqueArray<Element>is a noncopyable array variant that takes awayArray's copy-on-write behavior, enabling support for noncopyable elements. This type's noncopyability means mutations can always assume that the array is uniquely owned, with no shared copies (hence the name!). This means that array mutations such as mutating an element at an index can behave much more predictably, with no unexpected performance spikes due to having to copy shared storage.struct RigidArray<Element>goes even further, by also disabling dynamic resizing. Rigid arrays have a fixed capacity: they are initialized with room for a particular number of elements, and they never implicitly grow (nor shrink) their storage. When a rigid array's count reaches its capacity, it becomes unable to add any new items -- inserting into a full array is considered a programming error. This makes this a quite inflexible (or rigid) type indeed, as avoiding storage overflow requires careful, up front planning on the resource needs of the task at hand. In exchange, rigid arrays can have extremely predictable performance characteristics.UniqueArrayis a great default choice when a task just needs an array type that is able store noncopyable elements.RigidArrayis best reserved for use cases that require absolute, pedantic control over memory use or latency -- such as control software running in environments with extremely limited memory, or when a certain task must always be completed in some given amount of time.The
UniqueandRigidprefixes applied here establish a general naming convention for low-level variants of the classic copy-on-write data structure implementations. Future releases are expected to flesh out our zoo of container types by addingUniqueandRigidvariants of the existingSet,Dictionary,Deque,Heapand other constructs, with type names such as asRigidDictionaryandUniqueDeque.TrailingElementsModulemoduleThis new module ships a new
TrailingArrayconstruct, a preview of a new low-level, ownership-aware variant ofManagedBuffer. This is primarily intended as a interoperability helper for C constructs that consist of a fixed-size header directly followed by variable-size storage buffer.ContainersPreviewmoduleThis module is intended to contain previews of an upcoming ownership-aware container model. In this initial release, this module consists of just one construct:
struct Box<T>.Boxis a wrapper type that forms a noncopyable, heap allocated box around an arbitrary value.What's Changed
release/1.1tomainby @lorentey in #248release/1.1tomainby @lorentey in #358OrderedSet.appending(contentsOf:)by @pm-dev in #452SortedCollectionsmodule by @lorentey in #479release/1.2tomainbranch by @lorentey in #487release/1.2by @cthielen in [#498](https:Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.