From 79fd1644e192e2cb6fb5bb587bd97331f93d5348 Mon Sep 17 00:00:00 2001 From: David Tai Date: Wed, 30 Sep 2026 11:02:17 -0500 Subject: [PATCH] test(mimo): skip native-lane tests on machines without the lane Since eeba2afa (#178), 31 XCTest cases in five MiMo suites throw nativeLaneRequired on the hosted CI runner, so every run of Fork Tests on main fails. The tests need the exclusive native GPU lane, which the runner does not have. This change turns each of those throws into an XCTSkipUnless on the same environment variables. The tests now skip, with the reason, on a machine without the lane, and run as before where the variables are set. The unused nativeLaneRequired enum case is removed from each suite. Tests only. No production code change. Co-Authored-By: Claude Fable 5.1 --- .../MiMo/MiMoV26ManagedAudiovisualTests.swift | 13 ++++---- .../MiMoV26ManagedCompletePrefixTests.swift | 11 ++++--- .../MiMoV26ManagedDecodedAudioTests.swift | 30 +++++++++++-------- .../MiMoV26NativeMediaDeadlineTests.swift | 13 ++++---- .../MiMoV26RectangularVerifyNativeTests.swift | 11 ++++--- 5 files changed, 47 insertions(+), 31 deletions(-) diff --git a/Tests/MLXLMTests/MiMo/MiMoV26ManagedAudiovisualTests.swift b/Tests/MLXLMTests/MiMo/MiMoV26ManagedAudiovisualTests.swift index 10724fc7a2..f796e67755 100644 --- a/Tests/MLXLMTests/MiMo/MiMoV26ManagedAudiovisualTests.swift +++ b/Tests/MLXLMTests/MiMo/MiMoV26ManagedAudiovisualTests.swift @@ -17,7 +17,7 @@ import XCTest /// owner. Reservation counters are SDK lifetime witnesses, NOT host ledger or /// measured-peak qualification. Each fault selector needs its own process. final class MiMoV26ManagedAudiovisualTests: XCTestCase { - private enum Failure: Error { case inputRequired, nativeLaneRequired, noProof, injected } + private enum Failure: Error { case inputRequired, noProof, injected } private enum Profile: Sendable, Equatable { case audio, visual, text } private final class RootPermit: MiMoV26SerialLoadReservation, Sendable { let request: MiMoV26SerialLoadRequest @@ -145,10 +145,13 @@ final class MiMoV26ManagedAudiovisualTests: XCTestCase { enableMTP: Bool = false ) async throws -> Fixture { let env = ProcessInfo.processInfo.environment - guard env["MIMO_V26_SERIAL_NATIVE_TESTS"] == "1", - env["MIMO_V26_MANAGED_AUDIO_NATIVE_TESTS"] == "1", - env["MIMO_V26_DECODED_AV_NATIVE_TESTS"] == "1" - else { throw Failure.nativeLaneRequired } + // Skip, not fail, on a machine without the lane, such as the hosted CI runner. + try XCTSkipUnless( + env["MIMO_V26_SERIAL_NATIVE_TESTS"] == "1" + && env["MIMO_V26_MANAGED_AUDIO_NATIVE_TESTS"] == "1" + && env["MIMO_V26_DECODED_AV_NATIVE_TESTS"] == "1", + "Requires the exclusive native GPU lane. Set MIMO_V26_SERIAL_NATIVE_TESTS=1, MIMO_V26_MANAGED_AUDIO_NATIVE_TESTS=1 and MIMO_V26_DECODED_AV_NATIVE_TESTS=1 to run it." + ) guard let path = env["MIMO_V26_MANAGED_AUDIO_FIXTURE_ROOT"] else { throw Failure.inputRequired } diff --git a/Tests/MLXLMTests/MiMo/MiMoV26ManagedCompletePrefixTests.swift b/Tests/MLXLMTests/MiMo/MiMoV26ManagedCompletePrefixTests.swift index 9c0207c925..37e53e4a4c 100644 --- a/Tests/MLXLMTests/MiMo/MiMoV26ManagedCompletePrefixTests.swift +++ b/Tests/MLXLMTests/MiMo/MiMoV26ManagedCompletePrefixTests.swift @@ -12,7 +12,7 @@ import XCTest /// the actual authenticated selected sidecar. Test-only bounded ledger/encoded /// transport are not provider global-memory or encrypted-store qualification. final class MiMoV26ManagedCompletePrefixTests: XCTestCase { - private enum Failure: Error { case inputRequired, nativeLaneRequired, noProof, injected } + private enum Failure: Error { case inputRequired, noProof, injected } private enum Profile: Sendable, Equatable { case audio, visual } private final class RootPermit: MiMoV26SerialLoadReservation, Sendable { let request: MiMoV26SerialLoadRequest @@ -181,9 +181,12 @@ final class MiMoV26ManagedCompletePrefixTests: XCTestCase { enableMTP: Bool = false ) async throws -> Fixture { let env = ProcessInfo.processInfo.environment - guard env["MIMO_V26_SERIAL_NATIVE_TESTS"] == "1", - env["MIMO_V26_MANAGED_AUDIO_NATIVE_TESTS"] == "1" - else { throw Failure.nativeLaneRequired } + // Skip, not fail, on a machine without the lane, such as the hosted CI runner. + try XCTSkipUnless( + env["MIMO_V26_SERIAL_NATIVE_TESTS"] == "1" + && env["MIMO_V26_MANAGED_AUDIO_NATIVE_TESTS"] == "1", + "Requires the exclusive native GPU lane. Set MIMO_V26_SERIAL_NATIVE_TESTS=1 and MIMO_V26_MANAGED_AUDIO_NATIVE_TESTS=1 to run it." + ) guard let path = env["MIMO_V26_MANAGED_AUDIO_FIXTURE_ROOT"] else { throw Failure.inputRequired } diff --git a/Tests/MLXLMTests/MiMo/MiMoV26ManagedDecodedAudioTests.swift b/Tests/MLXLMTests/MiMo/MiMoV26ManagedDecodedAudioTests.swift index 7df4c2e263..1fc0b929da 100644 --- a/Tests/MLXLMTests/MiMo/MiMoV26ManagedDecodedAudioTests.swift +++ b/Tests/MLXLMTests/MiMo/MiMoV26ManagedDecodedAudioTests.swift @@ -15,7 +15,7 @@ import XCTest /// owner. Reservation counters are SDK lifetime witnesses, NOT host ledger or /// measured-peak qualification. Each fault selector needs its own process. final class MiMoV26ManagedDecodedAudioTests: XCTestCase { - private enum Failure: Error { case inputRequired, nativeLaneRequired, noProof, injected } + private enum Failure: Error { case inputRequired, noProof, injected } private enum Profile: Sendable, Equatable { case audio, visual, text } private final class RootPermit: MiMoV26SerialLoadReservation, Sendable { let request: MiMoV26SerialLoadRequest @@ -140,9 +140,12 @@ final class MiMoV26ManagedDecodedAudioTests: XCTestCase { enableMTP: Bool = false ) async throws -> Fixture { let env = ProcessInfo.processInfo.environment - guard env["MIMO_V26_SERIAL_NATIVE_TESTS"] == "1", - env["MIMO_V26_MANAGED_AUDIO_NATIVE_TESTS"] == "1" - else { throw Failure.nativeLaneRequired } + // Skip, not fail, on a machine without the lane, such as the hosted CI runner. + try XCTSkipUnless( + env["MIMO_V26_SERIAL_NATIVE_TESTS"] == "1" + && env["MIMO_V26_MANAGED_AUDIO_NATIVE_TESTS"] == "1", + "Requires the exclusive native GPU lane. Set MIMO_V26_SERIAL_NATIVE_TESTS=1 and MIMO_V26_MANAGED_AUDIO_NATIVE_TESTS=1 to run it." + ) guard let path = env["MIMO_V26_MANAGED_AUDIO_FIXTURE_ROOT"] else { throw Failure.inputRequired } @@ -497,10 +500,11 @@ final class MiMoV26ManagedDecodedAudioTests: XCTestCase { func testInnerRequiredCodesReadbackFailureRetainsOriginalInnerRootsBeforeCleanup() async throws { #if DEBUG - guard ProcessInfo.processInfo.environment["MIMO_V26_MANAGED_AUDIO_FAULT_TEST"] == "1" - else { - throw Failure.nativeLaneRequired - } + // Skip, not fail, on a machine without the lane, such as the hosted CI runner. + try XCTSkipUnless( + ProcessInfo.processInfo.environment["MIMO_V26_MANAGED_AUDIO_FAULT_TEST"] == "1", + "Requires the exclusive native GPU lane. Set MIMO_V26_MANAGED_AUDIO_FAULT_TEST=1 to run it." + ) let f = try await fixture() let permit = WorkPermit() let reached = Cancel() @@ -548,14 +552,16 @@ final class MiMoV26ManagedDecodedAudioTests: XCTestCase { // Refusal injected at a required readback after REAL native evaluation, // not evidence of a physical backend readback failure. #else - throw Failure.nativeLaneRequired + throw XCTSkip("Requires a debug build. The fault hook exists only in debug builds.") #endif } func testRequiredPreparationFenceFailureRetainsAudioOwnerAndBothObligations() async throws { - guard ProcessInfo.processInfo.environment["MIMO_V26_MANAGED_AUDIO_FAULT_TEST"] == "1" else { - throw Failure.nativeLaneRequired - } + // Skip, not fail, on a machine without the lane, such as the hosted CI runner. + try XCTSkipUnless( + ProcessInfo.processInfo.environment["MIMO_V26_MANAGED_AUDIO_FAULT_TEST"] == "1", + "Requires the exclusive native GPU lane. Set MIMO_V26_MANAGED_AUDIO_FAULT_TEST=1 to run it." + ) let f = try await fixture() let permit = WorkPermit() f.engine.loopForTesting.onEngineQueueSync { diff --git a/Tests/MLXLMTests/MiMo/MiMoV26NativeMediaDeadlineTests.swift b/Tests/MLXLMTests/MiMo/MiMoV26NativeMediaDeadlineTests.swift index b038894a3a..6c6b89c714 100644 --- a/Tests/MLXLMTests/MiMo/MiMoV26NativeMediaDeadlineTests.swift +++ b/Tests/MLXLMTests/MiMo/MiMoV26NativeMediaDeadlineTests.swift @@ -12,7 +12,7 @@ import XCTest /// qualification or measured deadline throughput. No fabricated feature arrays. final class MiMoV26NativeMediaDeadlineTests: XCTestCase { private enum FixtureError: Error { - case fixtureRequired, nativeLaneRequired, missingReceipt, wrongOutcome, rawClosure + case fixtureRequired, missingReceipt, wrongOutcome, rawClosure } private final class Permit: MiMoV26SerialLoadReservation, Sendable { let request: MiMoV26SerialLoadRequest @@ -127,11 +127,12 @@ final class MiMoV26NativeMediaDeadlineTests: XCTestCase { } private func fixture(tracked: Bool = true, maxWaiting: Int = 4) async throws -> Fixture { let environment = ProcessInfo.processInfo.environment - guard environment["MIMO_V26_SERIAL_NATIVE_TESTS"] == "1", - environment["MIMO_V26_NATIVE_MEDIA_DEADLINE_TESTS"] == "1" - else { - throw FixtureError.nativeLaneRequired - } + // Skip, not fail, on a machine without the lane, such as the hosted CI runner. + try XCTSkipUnless( + environment["MIMO_V26_SERIAL_NATIVE_TESTS"] == "1" + && environment["MIMO_V26_NATIVE_MEDIA_DEADLINE_TESTS"] == "1", + "Requires the exclusive native GPU lane. Set MIMO_V26_SERIAL_NATIVE_TESTS=1 and MIMO_V26_NATIVE_MEDIA_DEADLINE_TESTS=1 to run it." + ) guard let path = environment["MIMO_V26_SERIAL_LOAD_FIXTURES"] else { throw FixtureError.fixtureRequired } diff --git a/Tests/MLXLMTests/MiMo/MiMoV26RectangularVerifyNativeTests.swift b/Tests/MLXLMTests/MiMo/MiMoV26RectangularVerifyNativeTests.swift index da69e78d81..62aef20dca 100644 --- a/Tests/MLXLMTests/MiMo/MiMoV26RectangularVerifyNativeTests.swift +++ b/Tests/MLXLMTests/MiMo/MiMoV26RectangularVerifyNativeTests.swift @@ -17,7 +17,7 @@ import XCTest /// owner. Reservation counters are SDK lifetime witnesses, NOT host ledger or /// measured-peak qualification. Each fault selector needs its own process. final class MiMoV26RectangularVerifyNativeTests: XCTestCase { - private enum Failure: Error { case inputRequired, nativeLaneRequired, noProof, injected } + private enum Failure: Error { case inputRequired, noProof, injected } private enum Profile: Sendable, Equatable { case audio, visual, text } private final class RootPermit: MiMoV26SerialLoadReservation, Sendable { let request: MiMoV26SerialLoadRequest @@ -143,9 +143,12 @@ final class MiMoV26RectangularVerifyNativeTests: XCTestCase { depth: Int = 3, shutdownTimeout: TimeInterval = 10 ) async throws -> Fixture { let env = ProcessInfo.processInfo.environment - guard env["MIMO_V26_SERIAL_NATIVE_TESTS"] == "1", - env["MIMO_V26_RECTANGULAR_NATIVE_TESTS"] == "1" - else { throw Failure.nativeLaneRequired } + // Skip, not fail, on a machine without the lane, such as the hosted CI runner. + try XCTSkipUnless( + env["MIMO_V26_SERIAL_NATIVE_TESTS"] == "1" + && env["MIMO_V26_RECTANGULAR_NATIVE_TESTS"] == "1", + "Requires the exclusive native GPU lane. Set MIMO_V26_SERIAL_NATIVE_TESTS=1 and MIMO_V26_RECTANGULAR_NATIVE_TESTS=1 to run it." + ) guard let path = env["MIMO_V26_MANAGED_AUDIO_FIXTURE_ROOT"] else { throw Failure.inputRequired }