Skip to content

Conversation

naykutguven
Copy link
Contributor

This pull request adds the Sendable protocol conformance to a number of core data structures throughout the WhisperKit codebase. This update improves the safety and correctness of concurrent code by ensuring these types can be safely passed across threads, which is particularly important for Swift Concurrency. No other functional changes are introduced.

Concurrency and thread safety improvements:

  • Added Sendable conformance to key structs and enums related to audio processing, configuration, model support, and transcription, such as AudioDevice, AudioInputConfig, DecodingOptions, ModelComputeOptions, ModelSupport, DeviceSupport, ModelSupportConfig, AudioChunk, DecodingTask, DecodingFallback, TranscriptionResult, TranscriptionSegment, WordTiming, TranscriptionProgress, TranscriptionTimings, SpecialTokens, and SamplingResult.

@Copilot Copilot AI review requested due to automatic review settings September 23, 2025 08:57
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request adds Sendable protocol conformance to core data structures throughout the WhisperKit codebase to improve thread safety and support Swift Concurrency. The changes ensure these types can be safely passed across threads without introducing functional modifications.

Key changes:

  • Added Sendable conformance to 15+ public structs and enums across audio processing, model configuration, and transcription components
  • Enhanced concurrency safety for data structures used in multi-threaded audio processing workflows
  • Maintained existing API compatibility while improving thread safety guarantees

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
Sources/WhisperKit/Core/Text/TokenSampler.swift Added Sendable to SamplingResult struct
Sources/WhisperKit/Core/Models.swift Added Sendable to 10 core data structures including model options, transcription results, and audio chunks
Sources/WhisperKit/Core/Configurations.swift Added Sendable to DecodingOptions struct
Sources/WhisperKit/Core/Audio/AudioProcessor.swift Added Sendable to audio-related structs and enums including AudioDevice, AudioInputConfig, and ChannelMode

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@ZachNagengast ZachNagengast self-requested a review September 26, 2025 01:55
@ZachNagengast ZachNagengast merged commit f31370f into argmaxinc:main Sep 26, 2025
19 checks passed
@naykutguven naykutguven deleted the sendable-public-types branch September 26, 2025 20:16
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.

2 participants