Run Windows games on Apple Silicon — free, open source, with an open compatibility database that tells you what actually works.
Swift apple-silicond3dmetaldxmtdxvkfexgame-porting-toolkitgamingmac-gamingmacosmetalmoltenvksteamswiftuivkd3d-protonwhisky-alternativewindows-gameswinewine-wrapper
Two faults the first launch of Microsoft Flight Simulator 2024 through the app's own path showed (the CLI's run on the arm64 engine the store installed, M4, 2026-10-15). An arm64 engine's Wine opens MoltenVK and its other host libraries by leaf name, and the GStreamer framework carries a stock libMoltenVK: with the framework's lib alone on DYLD_FALLBACK_LIBRARY_PATH, winevulkan got that copy and DXVK refused the device (no Vulkan 1.3), so the engine's lib now leads the fallback path on the arm64 line; the Intel line is unchanged. And the renderer's own variables are defaults: a value the bottle's environment carries, set by the player or a recipe, keeps its say (the route's Shader Model 6_6 replaced the game's 6_7), only the composed entries still compose. The Rosetta test accepts the arm64 line's manifest, which must not ask for Rosetta. 538 tests pass on the M4.
Gauthier Piarrette3b33cedced63
diff --git a/Sources/HighballKit/Bottle.swift b/Sources/HighballKit/Bottle.swiftindex 5557684..72cdbd9 100644--- a/Sources/HighballKit/Bottle.swift+++ b/Sources/HighballKit/Bottle.swift@@ -793,7 +793,12 @@ public struct Bottle: Sendable {if !settings.dllOverrides.isEmpty { merge(&env, ["WINEDLLOVERRIDES+": settings.dllOverrides]) }merge(&env, ["WINEDLLOVERRIDES+": "winemenubuilder.exe=d"])merge(&env, settings.environment)- merge(&env, try effective.environment(engine: engine))+ // The renderer's own variables are defaults (a declared feature level and shader model,+ // the relax switches, its cache path): a value the bottle's environment carries, set by+ // the player or a recipe, keeps its say. Only the "+" entries compose. The first launch+ // of Microsoft Flight Simulator 2024 through the app had its Shader Model 6_7 replaced by+ // the vkd3d route's 6_6 this way (2026-10-15).+ merge(&env, try effective.environment(engine: engine).filter { key, _ in key.hasSuffix("+") || settings.environment[key] == nil })merge(&env, extra)// A game's recipe or the player may set DXMT_CONFIG too, a GPU identity for instance// (GTA V falls back to 800x600 on an Apple GPU, highball-db#72), and the merges abovediff --git a/Sources/HighballKit/EngineStore.swift b/Sources/HighballKit/EngineStore.swiftindex 86af13d..6e70125 100644--- a/Sources/HighballKit/EngineStore.swift+++ b/Sources/HighballKit/EngineStore.swift@@ -698,8 +698,15 @@ public struct InstalledEngine: Sendable {/// Environment every Wine process needs for this engine, before bottle/renderer settings.public func baseEnvironment() -> [String: String] {let fw = frameworksDir.path+ // An arm64 engine's Wine opens its host libraries by leaf name (patch 0030 looks beside+ // Wine only when that fails), and the GStreamer framework carries a stock libMoltenVK of+ // its own: with the framework's lib on the fallback path alone, winevulkan got that copy+ // instead of the engine's patched one, and DXVK refused the device (no Vulkan 1.3) on the+ // first launch through the app (2026-10-15). The engine's lib goes first on this line.+ var fallback = "\(fw):\(fw)/GStreamer.framework/Versions/1.0/lib"+ if manifest.isNativeARM64 { fallback = engineDir.appending(path: "lib").path + ":" + fallback }var env: [String: String] = [- "DYLD_FALLBACK_LIBRARY_PATH": "\(fw):\(fw)/GStreamer.framework/Versions/1.0/lib",+ "DYLD_FALLBACK_LIBRARY_PATH": fallback,"DYLD_FALLBACK_FRAMEWORK_PATH": fw,"GST_PLUGIN_PATH": "\(fw)/GStreamer.framework/Versions/1.0/lib/gstreamer-1.0",]diff --git a/Tests/HighballKitTests/EngineArchTests.swift b/Tests/HighballKitTests/EngineArchTests.swiftindex ba0a7fd..d5c28d3 100644--- a/Tests/HighballKitTests/EngineArchTests.swift+++ b/Tests/HighballKitTests/EngineArchTests.swift@@ -71,20 +71,42 @@ final class EngineArchTests: XCTestCase {["x86_64-windows", "i386-windows"], "the default stays the Intel layout every shipped engine has")}+ /// An arm64 engine's Wine opens MoltenVK and its other host libraries by leaf name, and the+ /// GStreamer framework carries a stock libMoltenVK: the engine's lib leads the fallback path so+ /// winevulkan gets the patched copy (the first app launch got the framework's, 2026-10-15).+ func testAnArm64EngineOpensItsOwnHostLibrariesFirst() {+ let root = URL(fileURLWithPath: "/e")+ let arm = InstalledEngine(manifest: manifest("arm64"), root: root).baseEnvironment()["DYLD_FALLBACK_LIBRARY_PATH"]!+ XCTAssertTrue(arm.hasPrefix("/e/engine/lib:"), arm)+ XCTAssertTrue(arm.contains("/e/frameworks/GStreamer.framework/Versions/1.0/lib"), "the framework's plugins still find their libraries")+ let intel = InstalledEngine(manifest: manifest("x86_64"), root: root).baseEnvironment()["DYLD_FALLBACK_LIBRARY_PATH"]!+ XCTAssertTrue(intel.hasPrefix("/e/frameworks:"), "the Intel line is unchanged, its engine/lib links resolve through rpath")+ }+func testOnlyEnginesThatSaySoNeedRosetta() throws {XCTAssertTrue(manifest("x86_64", requires: ["rosetta2"]).requiresRosetta)XCTAssertFalse(manifest("arm64", requires: []).requiresRosetta)XCTAssertFalse(manifest("arm64").requiresRosetta, "no requires at all means nothing is required")- // Every engine shipped today is Intel code and must keep saying so, or the app would stop- // installing Rosetta for it.+ // Every Intel engine shipped must keep saying so, or the app would stop installing Rosetta+ // for it; the native arm64 line (arm64-wine11.18-r1 since 2026-10-15) runs x86-64 code+ // through FEX inside Wine and must not ask for Rosetta.let dir = URL(fileURLWithPath: #filePath).deletingLastPathComponent().deletingLastPathComponent().deletingLastPathComponent().appending(path: "spike")var files = try FileManager.default.contentsOfDirectory(at: dir.appending(path: "engines"), includingPropertiesForKeys: nil).filter { $0.pathExtension == "json" }files.append(dir.appending(path: "engine-manifest.json"))+ var intel = 0, arm = 0for f in files {let m = try EngineManifest.load(from: f)- XCTAssertEqual(m.arch, "x86_64", "\(m.id) is not an Intel engine")- XCTAssertTrue(m.requiresRosetta, "\(m.id) no longer declares rosetta2")+ if m.isNativeARM64 {+ arm += 1+ XCTAssertFalse(m.requiresRosetta, "\(m.id) is native arm64 and must not ask for Rosetta")+ } else {+ intel += 1+ XCTAssertEqual(m.arch, "x86_64", "\(m.id) is not an Intel engine")+ XCTAssertTrue(m.requiresRosetta, "\(m.id) no longer declares rosetta2")+ }}+ XCTAssertGreaterThan(intel, 0, "the Intel engines are still shipped")+ XCTAssertGreaterThan(arm, 0, "the arm64 line's manifest is shipped")}func testAnARM64EngineNeedsFEXAndTheSignedLoader() throws {diff --git a/Tests/HighballKitTests/RendererAvailabilityTests.swift b/Tests/HighballKitTests/RendererAvailabilityTests.swiftindex 40e8b98..572ede7 100644--- a/Tests/HighballKitTests/RendererAvailabilityTests.swift+++ b/Tests/HighballKitTests/RendererAvailabilityTests.swift@@ -234,6 +234,22 @@ final class RendererAvailabilityTests: XCTestCase {XCTAssertFalse(Renderer.fallbackOrder.contains(.vkd3d), "never a fallback for other modes")}+ /// A variable the bottle carries, from a recipe or the player, outranks the route's declared+ /// defaults: Microsoft Flight Simulator 2024 asks for Shader Model 6.7 and its recipe says so,+ /// and the first launch through the app had it replaced by the route's 6_6 (2026-10-15).+ func testBottleVariablesOutrankTheRouteDefaults() throws {+ let e = try engine(ships: ["dxmt", "dxvk", "d9vk", "vkd3d"], accepted: false)+ var b = bottle(renderer: .vkd3d, explicit: true)+ b.settings.environment["VKD3D_SHADER_MODEL"] = "6_7"+ b.settings.environment["VKD3D_FEATURE_LEVEL"] = "12_1"+ let env = try b.environment(engine: e)+ XCTAssertEqual(env["VKD3D_SHADER_MODEL"], "6_7")+ XCTAssertEqual(env["VKD3D_FEATURE_LEVEL"], "12_1")+ XCTAssertEqual(env["VKD3D_RELAX_DEVICE_CAPS"], "1", "the route's other defaults still apply")+ XCTAssertTrue(env["WINEDLLOVERRIDES"]!.contains("d3d12core=n,b"), "the composed entries still compose")+ XCTAssertTrue(env["WINEDLLPATH_PREPEND"]!.contains("/vkd3d/wine"))+ }+/// B2: a pipeline cache compiled by one MoltenVK build and read by another gave wrong or hung/// pipelines on the arm64 line. The key follows every component's checksum, so a rebuilt/// component (same version, new patch) starts a new cache, and nothing else moves it.