feat(AI): 集成MNN推理引擎替换MLX作为主AI运行时

- 引入MNN(alibaba) + Arm SME2 + CPU作为主AI运行时,支持A19/iPhone17的
  SME2和A17的NEON加速
- 添加MLX Swift作为兜底GPU推理方案,实现双后端切换机制
- 使用单一Qwen3.5-2B多模态模型(1.2GB),替代原有的LLM+VL分离架构
- 实现InferenceEngine.current引擎选择逻辑,真机默认MNN,模拟器回退MLX
- 更新AIAgent架构,通过MNNLLMBridge(ObjC++) → MNNBackend进行推理
- 修改队列机制防止并发推理导致OOM,使用信号量闸门控制显存占用
- 更新文档中的技术栈说明、模块边界和周次交付计划
```
This commit is contained in:
link2026
2026-06-15 09:24:59 +08:00
parent 6c6a950140
commit 9d856fcfc4
37 changed files with 2605 additions and 430 deletions

View File

@@ -61,6 +61,42 @@ struct TodayRemindersLogicTests {
#expect(!CustomReminder(title: "x", frequency: .yearly, dayOfMonth: 29, month: 5).occurs(on: d, calendar: cal))
}
// MARK: - (// )
@Test func multiFrequencyOccursOnAnySelected() {
// ( = 2)+ 15,
let monday = date(2026, 6, 1) // 2026-06-01
let wdMon = cal.component(.weekday, from: monday)
let r = CustomReminder(title: "x")
r.frequencies = [.weekly, .monthly]
r.weekdays = [wdMon]
r.monthlyDays = [15]
// 15 (weekly)
#expect(r.occurs(on: monday, calendar: cal))
// 15(2026-06-15 , 2026-07-15 ) (monthly)
let mid = date(2026, 7, 15)
#expect(r.occurs(on: mid, calendar: cal))
// 15
#expect(!r.occurs(on: date(2026, 7, 16), calendar: cal))
}
@Test func monthlyMultiDayOccursOnEach() {
let r = CustomReminder(title: "x")
r.frequencies = [.monthly]
r.monthlyDays = [1, 15]
#expect(r.occurs(on: date(2026, 6, 1), calendar: cal))
#expect(r.occurs(on: date(2026, 6, 15), calendar: cal))
#expect(!r.occurs(on: date(2026, 6, 10), calendar: cal))
}
@Test func legacySingleFrequencyStillReadsThroughFrequenciesFallback() {
// : frequency,frequenciesRaw frequencies 退 [frequency]
let r = CustomReminder(title: "x", frequency: .weekly, dayOfMonth: 1)
r.weekdays = [2]
#expect(r.frequencies == [.weekly])
#expect(r.monthlyDays == [1]) // monthDays 退 dayOfMonth
}
// MARK: - MetricReminder
@Test func metricReminderOccursOnSelectedWeekday() {