Commit 1792730
fix: address PR #471 review comments (10/11)
Swift SDK:
- RunAnywhere.swift: atomically check-or-create _servicesInitTask under a
DispatchQueue so concurrent completeServicesInitialization() callers
can't spawn duplicate init tasks. Also clear the task on success (not
just failure) so the completed Task is released. (coderabbit
#3082258780, greptile #3082192287)
- CppBridge+VAD.swift: clear loadedModelId before calling
rac_vad_component_load_model — the C side unloads first, so on load
failure our Swift mirror must already be nil for a retry to work.
(coderabbit #3082258776)
- WhisperKitSTTService.swift: replace legacy vDSP_measqv+sqrt with the
Swift-overlay vDSP.rootMeanSquare(_:). (coderabbit #3082258785)
Commons (C++):
- onnx_backend.cpp (VAD model resolution): collect all *.onnx files,
sort lexicographically, pick the first — previously picked whatever
readdir() happened to return first, which is filesystem-dependent.
(coderabbit #3082258759)
- vad_component.cpp: if model_service->ops->start() returns
non-success, fully roll back (destroy impl, free service, clear
is_model_loaded/loaded_model_id) and propagate the error instead of
lying about a loaded-but-not-running service. (coderabbit #3082258769)
Playground (YapRun + keyboard extension):
- PlaygroundViewModel.swift: gate FlowSessionManager.shared.isActive
check behind #if os(iOS) — FlowSessionManager is iOS-only and the
unguarded reference broke the macOS target. (coderabbit #3082258684)
- FlowSessionManager.swift: guard deliverResult() with
`case .transcribing = sessionPhase` so a Task.detached that completes
after endSession()/killSession() doesn't overwrite SharedDataBridge
with a discarded result. (coderabbit #3082258728)
- KeyboardViewController.swift: remove the unconditional
UIPasteboard.general.string = text copy — duplicating every dictated
utterance to the global pasteboard is a privacy leak. (coderabbit
#3082258734)
- SharedDataBridge.swift: (1) audioLevel setter now posts
audioLevelChanged so peer-process caches refresh; (2) drop the
_cachedHeartbeat cache entirely and read/write UserDefaults directly
— heartbeat ticks every second without a state transition so the
cache was stale by definition. (coderabbit #3082258739)
Not addressed:
- rac_vad_component_is_loaded returning rac_bool_t (coderabbit
#3082258749) — intentionally left as rac_bool_t to match the
established project convention for is_X query APIs (rac_stt_
component_is_loaded, rac_server_is_running, rac_framework_is_
platform_service, ~20 more). Changing only the VAD one would break
consistency without a concrete call-site benefit.
Verification:
- sdk/runanywhere-commons: 51/51 existing tests pass (test_core,
test_extraction, test_download_orchestrator).
- sdk/runanywhere-commons ONNX backend: builds clean.
- sdk/runanywhere-swift: `swift build` complete (425 modules).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 525243e commit 1792730
9 files changed
Lines changed: 82 additions & 39 deletions
File tree
- Playground/YapRun
- YapRunKeyboard
- YapRun/Features
- Playground
- VoiceKeyboard
- sdk
- runanywhere-commons/src
- backends/onnx
- features/vad
- runanywhere-swift/Sources
- RunAnywhere
- Foundation/Bridge/Extensions
- Public
- WhisperKitRuntime
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
72 | 74 | | |
73 | 75 | | |
74 | 76 | | |
75 | 77 | | |
| 78 | + | |
76 | 79 | | |
77 | 80 | | |
78 | 81 | | |
| |||
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
260 | 270 | | |
261 | 271 | | |
262 | 272 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
77 | 76 | | |
78 | 77 | | |
79 | 78 | | |
80 | 79 | | |
81 | 80 | | |
82 | | - | |
83 | 81 | | |
84 | 82 | | |
85 | 83 | | |
| |||
102 | 100 | | |
103 | 101 | | |
104 | 102 | | |
105 | | - | |
106 | 103 | | |
107 | 104 | | |
108 | 105 | | |
109 | 106 | | |
110 | 107 | | |
111 | | - | |
112 | 108 | | |
113 | 109 | | |
114 | 110 | | |
| |||
165 | 161 | | |
166 | 162 | | |
167 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
168 | 169 | | |
169 | 170 | | |
170 | 171 | | |
171 | 172 | | |
172 | 173 | | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
173 | 178 | | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
| 179 | + | |
| 180 | + | |
179 | 181 | | |
180 | 182 | | |
181 | 183 | | |
| |||
220 | 222 | | |
221 | 223 | | |
222 | 224 | | |
223 | | - | |
224 | 225 | | |
225 | 226 | | |
226 | 227 | | |
Lines changed: 13 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| |||
1153 | 1155 | | |
1154 | 1156 | | |
1155 | 1157 | | |
1156 | | - | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
1157 | 1162 | | |
1158 | 1163 | | |
1159 | 1164 | | |
1160 | 1165 | | |
1161 | 1166 | | |
1162 | 1167 | | |
1163 | 1168 | | |
1164 | | - | |
1165 | | - | |
1166 | | - | |
| 1169 | + | |
1167 | 1170 | | |
1168 | 1171 | | |
1169 | 1172 | | |
1170 | 1173 | | |
1171 | | - | |
1172 | | - | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
1173 | 1180 | | |
1174 | 1181 | | |
1175 | 1182 | | |
| |||
Lines changed: 13 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
447 | 447 | | |
448 | 448 | | |
449 | 449 | | |
450 | | - | |
| 450 | + | |
| 451 | + | |
451 | 452 | | |
452 | 453 | | |
453 | 454 | | |
454 | | - | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
455 | 466 | | |
456 | 467 | | |
457 | 468 | | |
| |||
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
80 | 86 | | |
81 | 87 | | |
82 | 88 | | |
| |||
Lines changed: 20 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
74 | 77 | | |
75 | 78 | | |
76 | 79 | | |
| |||
316 | 319 | | |
317 | 320 | | |
318 | 321 | | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
330 | 335 | | |
331 | | - | |
332 | 336 | | |
333 | 337 | | |
334 | 338 | | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
335 | 342 | | |
336 | | - | |
| 343 | + | |
337 | 344 | | |
338 | 345 | | |
339 | 346 | | |
| |||
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
194 | | - | |
195 | | - | |
196 | | - | |
| 194 | + | |
197 | 195 | | |
198 | 196 | | |
199 | 197 | | |
| |||
0 commit comments