import XCTest @testable import MarkBase final class G12BGenerationTests: XCTestCase { func testSimpleForwardPass() throws { print("\n═══════════════════════════════════════") print(" 12B Forward Pass Test") print("═══════════════════════════════════════\n") let modelDir = "/Users/accusys/.cache/huggingface/hub/models--mlx-community--gemma-4-12B-it-4bit/snapshots/73bcf09092aa277861d5a191b989b666f7f32e8f" print("Step 1: Initialize Metal engine...") let engine = try MarkBaseEngine(autoCompile: true) print(" ✓ Engine ready (shaders compiled)\n") print("Step 2: Load 12B model...") let model = try E4BModel(modelDir: modelDir, engine: engine, maxContextLength: 512) print(" ✓ Model loaded\n") print("Step 3: Create input buffer...") // Create simple input buffer with all zeros (dummy token embedding) guard let inputBuffer = engine.device.makeBuffer( length: model.hiddenSize * MemoryLayout.stride, options: .storageModeShared ) else { throw E4BError.bufferCreationFailed } // Initialize with small values to avoid numerical issues let inputPtr = inputBuffer.contents().bindMemory(to: Float.self, capacity: model.hiddenSize) for i in 0...stride, options: .storageModeShared ) else { throw E4BError.bufferCreationFailed } let inputPtr = inputBuffer.contents().bindMemory(to: Float.self, capacity: model.hiddenSize) for i in 0..