Skip to content

3.0.0

Latest

Choose a tag to compare

@tmcdonell tmcdonell released this 16 Oct 11:13

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
  • Generic witnesses and structurally validated storage for RawRepresentable types, including Int/UInt raw values via their fixed-width representations
  • @Generic derivation 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
  • @Generic derivation for raw-value enums; enums with associated values or with no possible raw type are diagnosed
  • @Box for transparently storing mutable non-Generic properties, including default values, module-qualified attributes, and escaped property names; stored properties without an explicit type annotation are diagnosed, and an invalid @Box declaration does not cascade into @Generic errors
  • Box: Equatable conformance
  • Checked conditional Sendable conformances for the representation constructors
  • Conditional Sendable conformance for immutable MultiArray snapshots with sendable elements and raw representations
  • Fixed-size MultiArrayBuffer for 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 PartialInitializationArrayData refinement 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 outside 0...capacity now 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.appendPayload for canonical field-wise snapshot copying; custom conformances whose Buffer is not UnsafeMutablePointer<Self> must supply an implementation
  • Breaking: Pass the synchronous unsafe initializer's buffer view by value instead of inout; the initialized count remains inout
  • Rename the construction view to UnsafeUninitializedMultiArrayBuffer; retain UninitializedMultiArrayData as 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 Data storage 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 Data slices
  • Encode only initialized field prefixes after partial-capacity construction, producing the same binary snapshot as exact-capacity construction
  • Reject out-of-domain RawRepresentable values during binary decoding
  • Preserve MultiArray value semantics by copying shared storage before indexed mutation
  • Remove unstable raw storage addresses from MultiArray.debugDescription
  • Restore automatic vectorization of MultiArray.map with Swift 6.2 and later