Skip to content

Modern Swift concurrency#2

Merged
RISCfuture merged 2 commits into
mainfrom
modern-concurrency
Jun 27, 2026
Merged

Modern Swift concurrency#2
RISCfuture merged 2 commits into
mainfrom
modern-concurrency

Conversation

@RISCfuture

Copy link
Copy Markdown
Owner

Summary

Adopts Swift's Approachable Concurrency upcoming features and finishes the migration to modern structured concurrency.

  • Enables NonisolatedNonsendingByDefault and InferIsolatedConformances on every target. The public async entry points (CIFP(url:), CIFP(bytes:), and linked()) now run on the caller's executor by default, and the streaming line reader's next() is annotated @concurrent so file and byte iteration keep running off the caller's executor.
  • Removes the remaining nonisolated(unsafe) escape hatches: the two header-parsing regexes are now compiled once per parse on the builder instead of stored as shared unsafe statics (no perf regression).
  • Drops a vestigial @preconcurrency from import RegexBuilder; the module is fully Sendable-audited under Swift 6.

SwiftCIFP was already close to modern structured concurrency (actor-based data model, async inits, hand-rolled AsyncSequence readers, async @Sendable resolver closures, zero GCD/threads/locks). The remaining @unchecked Sendable conformances (UnitSlope and UnitConverterDegrees) are unavoidable Foundation Dimension/UnitConverter patterns and are kept by design.

No public signatures changed; this is a source-compatible change.

Verification

  • swift build --build-tests succeeds.
  • 67/67 unit tests pass.
  • The E2E executable target was run end-to-end against live FAA data and passed.
  • swift-format and swiftlint are clean on the changed files.

Version

This release is 1.1.0 (minor: public async execution semantics change while remaining source-compatible). The GitHub release will be cut after this PR is merged.

🤖 Generated with Claude Code

RISCfuture and others added 2 commits June 27, 2026 01:09
…rrency

Enable the Approachable Concurrency upcoming features on every target
(NonisolatedNonsendingByDefault and InferIsolatedConformances). The
public async entry points (CIFP(url:), CIFP(bytes:), and linked()) now
run on the caller's executor by default, and the streaming line reader's
next() is annotated @Concurrent so file and byte iteration keep running
off the caller's executor.

SwiftCIFP was already close to modern structured concurrency (actor-based
data model, async inits, hand-rolled AsyncSequence readers, async @sendable
resolver closures, zero GCD/threads/locks), so the migration focused on
removing the remaining escape hatches:

- Remove both nonisolated(unsafe) static-regex escape hatches: the two
  header-parsing regexes now live as instance stored properties on
  CIFPBuilder, compiled once per parse rather than as shared unsafe
  statics (no perf regression).
- Drop a vestigial @preconcurrency from import RegexBuilder; the module
  is fully Sendable-audited under Swift 6 and builds clean.

The remaining @unchecked Sendable conformances (UnitSlope and
UnitConverterDegrees) are unavoidable Foundation Dimension/UnitConverter
patterns and are kept by design. No public signatures changed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@RISCfuture RISCfuture force-pushed the modern-concurrency branch from 3059fc7 to 6b11542 Compare June 27, 2026 08:09
@RISCfuture RISCfuture merged commit 6b11542 into main Jun 27, 2026
5 checks passed
@RISCfuture RISCfuture deleted the modern-concurrency branch June 27, 2026 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant