I had Claude co-author an adaptive audio feature for a small Swift game.
The code compiled. The tests passed. The app installed. Then it crashed as soon as the audio engine called its render block.
There was no useful exception message, just SIGTRAP .
The problem was where the closure had been created. The audio class was @MainActor , so Swift 6 treated the render closure as main-actor isolated too:
let node = AVAudioSourceNode ( format : format ) { _ , _ , frames , buffers in synth . render ( frames : Int ( frames ), into : buffers ) return noErr }
Enter fullscreen mode
Exit fullscreen mode
That closure does not run on the main actor. Core Audio calls it from a real-time audio thread.…