Skip to content

Commit 0ac126b

Browse files
committed
test: update lifecycle tests to evaluate staffPicks instead of deprecated recommended() catalog function
1 parent 913465a commit 0ac126b

1 file changed

Lines changed: 14 additions & 26 deletions

File tree

‎tests/SwiftBuddyTests/ModelLifecycleTests.swift‎

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,13 @@ import UIKit
77

88
final class ModelLifecycleTests: XCTestCase {
99

10-
// Feature 11: RAM Budget Checks
10+
// Feature 11: Staff Picks Check
1111
@MainActor
12-
func testFeature11_RAMBudgetFiltersModels() {
13-
let manager = ModelDownloadManager()
14-
let models = manager.modelsForDevice()
15-
16-
// This will rely on the device running the tests, but let's do a strict boundary test
17-
// on the Catalog logic instead.
18-
let device6GB = DeviceProfile(physicalRAMGB: 6.0, isAppleSilicon: true)
19-
let fits = ModelCatalog.recommended(for: device6GB, safetyMargin: 0.25)
20-
21-
// 6 * 0.75 = 4.5GB usable.
22-
// Qwen 2.5 7B needs 4.2GB, should be there.
23-
// Qwen 2.5 14B needs 8.5GB, should NOT be there.
24-
XCTAssertTrue(fits.contains { $0.id == "mlx-community/Qwen2.5-7B-Instruct-4bit" })
25-
XCTAssertFalse(fits.contains { $0.id == "mlx-community/Qwen2.5-14B-Instruct-4bit" })
12+
func testFeature11_StaffPicksAvailable() {
13+
// Since we migrated from RAM-based filtering to Staff Picks, we verify the catalog curates high-quality defaults.
14+
let picks = ModelCatalog.staffPicks
15+
XCTAssertTrue(picks.contains { $0.id.contains("Qwen3.5-4B") })
16+
XCTAssertTrue(picks.count >= 4)
2617
}
2718

2819
// Feature 12: Thermal Throttling Intercepts
@@ -57,35 +48,32 @@ final class ModelLifecycleTests: XCTestCase {
5748

5849
// Feature 14: SSD Streaming (MoE bypassing)
5950
func testFeature14_SSDStreamingConfigBypass() {
60-
let qwen30B = ModelCatalog.all.first { $0.id == "mlx-community/Qwen3-30B-A3B-4bit" }!
51+
let qwenMoE = ModelCatalog.all.first { $0.id == "mlx-community/Qwen3.5-35B-A3B-4bit" }!
6152

62-
// A 30B MoE requires far less active RAM than parameter count.
63-
// Needs ~4.5GB, but streams effectively.
64-
XCTAssertTrue(qwen30B.isMoE)
53+
// A 35B MoE requires far less active RAM than parameter count.
54+
XCTAssertTrue(qwenMoE.isMoE)
6555

6656
let device8GB = DeviceProfile(physicalRAMGB: 8.0, isAppleSilicon: true)
67-
let status = ModelCatalog.fitStatus(for: qwen30B, on: device8GB)
57+
let status = ModelCatalog.fitStatus(for: qwenMoE, on: device8GB)
6858

69-
// 8GB RAM * 0.75 = 6GB. Since Model Needs 4.5, it actually .fits!
7059
XCTAssertEqual(status, .fits)
7160

7261
let device2GB = DeviceProfile(physicalRAMGB: 2.0, isAppleSilicon: true)
73-
let status2 = ModelCatalog.fitStatus(for: qwen30B, on: device2GB)
62+
let status2 = ModelCatalog.fitStatus(for: qwenMoE, on: device2GB)
7463
XCTAssertEqual(status2, .requiresFlash)
7564
}
7665

7766
// Feature 15: TurboQuant Footprint Estimates
7867
func testFeature15_TurboQuantFootprint() {
79-
// Evaluate the TurboQuant flags internally
80-
let qwen32 = ModelCatalog.all.first { $0.id == "mlx-community/Qwen3-32B-4bit" }!
68+
let qwen27 = ModelCatalog.all.first { $0.id == "mlx-community/Qwen3.5-27B-4bit" }!
8169
let mixtralMoE = ModelCatalog.all.first { $0.id == "mlx-community/Qwen3.5-35B-A3B-4bit" }!
8270

8371
// Both are massive. Mixtral ~35B MoE should require minimal footprint (TurboQuant/SSD).
8472
XCTAssertEqual(mixtralMoE.quantization, "4-bit")
8573
XCTAssertTrue(mixtralMoE.isMoE)
8674
XCTAssertEqual(mixtralMoE.ramRequiredGB, 5.5) // TurboQuant active mapping
8775

88-
// Non-MoE 32B needs 19GB natively in 4-bit!
89-
XCTAssertEqual(qwen32.ramRequiredGB, 19.0)
76+
// Non-MoE 27B needs 16GB natively in 4-bit!
77+
XCTAssertEqual(qwen27.ramRequiredGB, 16.0)
9078
}
9179
}

0 commit comments

Comments
 (0)