Skip to content

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Sep 2, 2025

Bumps github.com/apple/swift-numerics from 1.0.3 to 1.1.0.

Release notes

Sourced from github.com/apple/swift-numerics's releases.

1.1: Relax

  • Expanded documentation and docc catalogs for ComplexModule and RealModule

  • “Relaxed arithmetic” bindings are added to the Real module. These allow you to write floating-point arithmetic that licenses the compiler to reassociate and form FMAs, which allows for much better performance in hot loops (e.g. if you are writing a signal-processing or linear algebra kernel in Swift). I expect that these will get nicer syntax sugar eventually, but I want the functionality to be available now, because it can make a huge difference in some cases. For arrays that fit into cache, on common hardware, relaxedSum below is an order of magnitude faster than strictSum, and often competitive with specialized libraries when optimization is enabled.

    func strictSum(_ array: [Float]) -> Float {
      array.reduce(0, +)
    }
    

    import RealModule func relaxedSum(_ array: [Float]) -> Float { array.reduce(0, Relaxed.sum) }

  • The generic constraint on the Augmented arithmetic methods has been relaxed from Real to FloatingPoint. This is more correct and makes the operations more broadly useful. Arguably, Augmented.sum(large:small:) should be constrained to BinaryFloatingPoint, because the fast2sum algorithm doesn’t work in radix 10, but this would complicate generic call sites. Instead, it will dispatch to the unordered sum(_:_:) for decimal types, so that callers do not have to worry about this detail.

  • There is a new algorithm for complex division when the inputs are poorly scaled such that the naïve approach would fail. This gives more accurate results than the old approach, and (importantly for some use cases) does not perturb results if the numerator and denominator are rescaled by the same power of two (up to the underflow boundary), and is more optimizable. Note that while it produces better results, the results will change for some inputs vis-à-vis what is seen on 1.0.x

  • Complex no longer conditionally conforms to Differentiable. Given that the Differentiation module has not formally stabilized, support for it will be moved onto a feature branch for now.

  • AlgebraicField has a Magnitude: AlgebraicField constraint. This is formally source-breaking. I do not expect it to actually matter for any real-world clients, which is why this isn’t a major-version release, but I want to make sure people are aware of it. Please speak up if it would have an effect that I’m overlooking.

  • Complex has a new rawStorage property that directly vends the cartesian coordinates as a tuple. Previously they were available via underscored properties. These are mainly useful for interoperation with other languages, but are expected to be fairly niche outside of that use case.

As always, thanks for your feedback and contributions.

1.1

What's Changed

  • The minimum supported Swift tools version is bumped to 5.9.
  • Expanded documentation and docc catalogs for ComplexModule and RealModule
  • The generic constraint on the Augmented arithmetic methods has been relaxed from Real to FloatingPoint. This is more correct and makes the operations more broadly useful. Formally, Augmented.sum(large:small:) should arguably be constrained to BinaryFloatingPoint, because the fast2sum algorithm doesn’t work in radix 10, but this would complicate generic call sites. Instead, it will dispatch to the unordered sum(::) for decimal types, so that callers do not have to worry about this detail. (Thanks to @​markuswntr for contributing the sum(_:_:) implementation).
  • There is a new algorithm for complex division when the inputs are poorly scaled such that the naïve approach would fail. This gives more accurate results than the old approach, and (importantly for some use cases) does not perturb results if the numerator and denominator are rescaled by the same power of two (up to the underflow boundary), and is more optimizable. Note that while it produces better results, the results will change for some inputs vis-à-vis what is seen on 1.0.x
  • Complex no longer conditionally conforms to Differentiable. Given that the Differentiation module has not formally stabilized, this seems appropriate.
  • AlgebraicField has a Magnitude: AlgebraicField constraint. This is formally source-breaking. I do not expect it to actually matter for any real-world clients, which is why this isn’t a major-version release, but I want to make sure people are aware of it. Please speak up if it would have an effect that I’m overlooking.
  • Complex has a new rawStorage property that directly vends the cartesian coordinates as a tuple. Previously they were available via underscored properties. These are mainly useful for interoperation with other languages, but are expected to be fairly niche outside of that use case.
Commits
  • bbadd4b Merge pull request #326 from stephentyrone/wasm-testing-1.1
  • e46ddfe Merge pull request #325 from stephentyrone/enable-wasm-testing
  • 1653d35 Merge pull request #323 from stephentyrone/docc-stuff-1.1
  • 207fea2 Pull documentation revamp from main into release/1.1
  • c16e7a9 Merge pull request #322 from stephentyrone/augmented-sum-assert-1.1
  • 416b94a Merge pull request #321 from stephentyrone/remove-2sum-assert
  • 1a19d0d Merge pull request #318 from stephentyrone/constrain-algebraic-field-1.1
  • d91884b Merge pull request #315 from stephentyrone/algebraic-field-magnitude
  • 6bd8a0c Merge pull request #317 from apple/stephentyrone-patch-1
  • 05472f9 Update README.md
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [github.com/apple/swift-numerics](https://github.com/apple/swift-numerics) from 1.0.3 to 1.1.0.
- [Release notes](https://github.com/apple/swift-numerics/releases)
- [Commits](apple/swift-numerics@1.0.3...1.1.0)

---
updated-dependencies:
- dependency-name: github.com/apple/swift-numerics
  dependency-version: 1.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file swift_package_manager Pull requests that update Swift_package_manager code labels Sep 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file swift_package_manager Pull requests that update Swift_package_manager code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants