Repository navigation
MultiArray 3.0 adds macro-derived representations, conditional Sendable support, asynchronous construction, and reusable SoA buffers. It also restores automatic vectorization on newer Swift compilers and fixes several storage-safety issues.
This is a major release with source-breaking API changes and a new binary snapshot format; version-1 snapshots must be regenerated.
Added
- Architecture documentation
- Developer scripts for Linux and macOS builds, tests, formatting, and preflight checks
Genericwitnesses and structurally validated storage forRawRepresentabletypes, includingInt/UIntraw values via their fixed-width representations@Genericderivation for structs: balanced tree representation with no property count limit, preserved memberwise initializers, and non-public encoded fields; inferred, conditionally compiled, and declaration-initialized immutable stored properties, and private nested types, are diagnosed@Genericderivation for raw-value enums; enums with associated values or with no possible raw type are diagnosed@Boxfor transparently storing mutable non-Genericproperties, including default values, module-qualified attributes, and escaped property names; stored properties without an explicit type annotation are diagnosed, and an invalid@Boxdeclaration does not cascade into@GenericerrorsBox: Equatableconformance- Checked conditional
Sendableconformances for the representation constructors - Conditional
Sendableconformance for immutableMultiArraysnapshots with sendable elements and raw representations - Fixed-size
MultiArrayBufferfor reusable, reference-semantic SoA scratch with disjoint-index concurrency - DocC guides with compiler-checked examples and a cross-version automatic-vectorization regression check
- A Swift 6.0 through 6.4 strict-concurrency signature compatibility check
- An opt-in
PartialInitializationArrayDatarefinement for per-index cleanup of scattered initialization - Async arbitrary-order prefix construction with a published initialized count and exact cleanup of partially initialized tracked representations
Changed
- Update the project's lint and formatting rules
- Support SwiftSyntax releases from 600 through 603
- Reorganize the test suite and expand coverage for empty arrays, Boolean fields, and large arrays
- Breaking: Change
init(unsafeUninitializedCapacity:initializingWith:)to report the initialized prefix for cleanup when the closure throws; counts outside0...capacitynow trap - Breaking: Make
ArrayData.rawSize(capacity:from:)return an optional checked size - Breaking: Binary snapshot encoding advances to version 2, rejecting version-1 snapshots; nested-product snapshots no longer contain unused opaque-struct padding
- Breaking: Add
BinaryArrayData.appendPayloadfor canonical field-wise snapshot copying; custom conformances whoseBufferis notUnsafeMutablePointer<Self>must supply an implementation - Breaking: Pass the synchronous unsafe initializer's buffer view by value instead of
inout; the initialized count remainsinout - Rename the construction view to
UnsafeUninitializedMultiArrayBuffer; retainUninitializedMultiArrayDataas a deprecated source-compatible alias - Improve
init(repeating:count:)by decomposing the repeated value only once - Remove redundant per-element platform integer layout assertions
- Breaking: Raise the minimum watchOS deployment target from 4 to 9, the oldest target supported by Swift 6.4
Fixed
- Avoid force-unwrapping unavailable
Datastorage during binary decoding - Reject negative or overflowing storage layouts before allocation and enforce the 16-byte maximum field alignment
- Decode binary snapshots correctly from nonzero-index
Dataslices - Encode only initialized field prefixes after partial-capacity construction, producing the same binary snapshot as exact-capacity construction
- Reject out-of-domain
RawRepresentablevalues during binary decoding - Preserve
MultiArrayvalue semantics by copying shared storage before indexed mutation - Remove unstable raw storage addresses from
MultiArray.debugDescription - Restore automatic vectorization of
MultiArray.mapwith Swift 6.2 and later