import XCTest @testable import MarkBase final class BatchEmbeddingOptimizationTest: XCTestCase { func testBatchEmbeddingPerformance() throws { print("\n═══════════════════════════════════════════════════════════════════") print(" Batch Embedding Optimization Test") print("═══════════════════════════════════════════════════════════════════\n") let engine = try MarkBaseEngine(autoCompile: true) // Test with E4B-MarkBase (smaller, faster to load) let modelPath = "/Users/accusys/MarkBaseEngine/models/E4B-MarkBase" print("Loading E4B-MarkBase...") let model = try E4BModel(modelDir: modelPath, engine: engine, maxContextLength: 512) print("✓ Model loaded: \(model.layers.count) layers\n") // Create batch context (using model's helper method) let maxBatchSize = 8 let context = model.createBatchContext(maxBatchSize: maxBatchSize) print("Testing batch embedding performance:") print(" Batch sizes: 1, 2, 4, 8\n") for batchSize in [1, 2, 4, 8] { print("Testing batch(\(batchSize))...") // Generate random token IDs let tokenIds = (0..