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
engine r6: D3DMetal from Game Porting Toolkit 4.0 beta 2, opt-in on macOS 27 or newer (#85); manifests' minMacOS is enforced for offers and installs
Gauthier Piarrette711481b69d4b
diff --git a/Sources/HighballKit/EngineStore.swift b/Sources/HighballKit/EngineStore.swiftindex fb3786f..33a59ad 100644--- a/Sources/HighballKit/EngineStore.swift+++ b/Sources/HighballKit/EngineStore.swift@@ -126,11 +126,14 @@ public struct EngineStore: Sendable {public let missing: Boolpublic init(id: String, installed: Bool, missing: Bool = false) { self.id = id; self.installed = installed; self.missing = missing }}- public static func offeredEngines(installed: [InstalledEngine], known: [EngineManifest], current: String? = nil) -> [OfferedEngine] {+ public static func offeredEngines(installed: [InstalledEngine], known: [EngineManifest], current: String? = nil,+ macOS: String = EngineManifest.currentMacOS) -> [OfferedEngine] {let newestFirst: (String, String) -> Bool = { $0.compare($1, options: .numeric) == .orderedDescending }let have = installed.sorted { newestFirst($0.id, $1.id) }.map { OfferedEngine(id: $0.id, installed: true) }let ids = Set(have.map(\.id))- let more = known.filter { !ids.contains($0.id) }.sorted { newestFirst($0.id, $1.id) }+ // A manifest with a macOS floor above this Mac is not offered: it would download and+ // then run untested (r6's D3DMetal was measured on 27 only). Installed engines stay listed.+ let more = known.filter { !ids.contains($0.id) && $0.runs(onMacOS: macOS) }.sorted { newestFirst($0.id, $1.id) }.map { OfferedEngine(id: $0.id, installed: false) }var rows = have + moreif let current, !rows.contains(where: { $0.id == current }) { rows.append(OfferedEngine(id: current, installed: false, missing: true)) }diff --git a/Sources/HighballKit/Manifest.swift b/Sources/HighballKit/Manifest.swiftindex e602222..c688c39 100644--- a/Sources/HighballKit/Manifest.swift+++ b/Sources/HighballKit/Manifest.swift@@ -42,6 +42,25 @@ public struct EngineManifest: Codable, Sendable, Identifiable {public var displayName: Stringpublic var arch: Stringpublic var minMacOS: String++ /// Whether this engine is meant for the given macOS version (numeric compare of `minMacOS`,+ /// "27.0" against "26.6.2" and so on). An engine measured only on a newer macOS says so in+ /// its floor and is then neither offered nor installed on an older one (highball#85).+ public func runs(onMacOS version: String) -> Bool {+ let parse: (String) -> [Int] = { $0.split(separator: ".").map { Int($0) ?? 0 } }+ let floor = parse(minMacOS), have = parse(version)+ for i in 0..<max(floor.count, have.count) {+ let f = i < floor.count ? floor[i] : 0, h = i < have.count ? have[i] : 0+ if h != f { return h > f }+ }+ return true+ }++ /// This Mac's macOS version as "major.minor.patch".+ public static var currentMacOS: String {+ let v = ProcessInfo.processInfo.operatingSystemVersion+ return "\(v.majorVersion).\(v.minorVersion).\(v.patchVersion)"+ }public var requires: [String]?public var notes: [String]?public var components: [String: Component]diff --git a/Sources/highball/main.swift b/Sources/highball/main.swiftindex 5e38bd3..c603727 100644--- a/Sources/highball/main.swift+++ b/Sources/highball/main.swift@@ -58,6 +58,9 @@ struct Engine: AsyncParsableCommand {func run() async throws {let m = try EngineManifest.load(from: URL(fileURLWithPath: manifest))+ guard m.runs(onMacOS: EngineManifest.currentMacOS) else {+ throw HighballError.invalid("\(m.id) needs macOS \(m.minMacOS) or newer; this Mac runs \(EngineManifest.currentMacOS)")+ }print("installing \(m.id): \(m.displayName)")var accepted: Set<String> = []if acceptD3DMetal { accepted.insert("apple-gptk-license-2023-08-17") }diff --git a/Tests/HighballKitTests/RegressionTests.swift b/Tests/HighballKitTests/RegressionTests.swiftindex 60bb257..47a7073 100644--- a/Tests/HighballKitTests/RegressionTests.swift+++ b/Tests/HighballKitTests/RegressionTests.swift@@ -989,6 +989,20 @@ extension RegressionTests {XCTAssertEqual(EngineStore.offeredEngines(installed: [r1], known: [], current: r1.id).count, 1, "current engine present: no extra row")}+ func testEnginesAboveTheMacOSFloorAreNotOffered() throws {+ func manifest(_ id: String, floor: String) throws -> EngineManifest {+ let json = #"{"id":"\#(id)","displayName":"e","arch":"x86_64","minMacOS":"\#(floor)","components":{}}"#+ return try JSONDecoder().decode(EngineManifest.self, from: Data(json.utf8))+ }+ let r5 = try manifest("x64-a-r5", floor: "14.0"), r6 = try manifest("x64-a-r6", floor: "27.0")+ XCTAssertTrue(r6.runs(onMacOS: "27.0")); XCTAssertTrue(r6.runs(onMacOS: "27.1.2")); XCTAssertTrue(r5.runs(onMacOS: "26.6.2"))+ XCTAssertFalse(r6.runs(onMacOS: "26.6.2"), "26.6.2 is below a 27.0 floor even though 6 > 0 in the second field")+ XCTAssertEqual(EngineStore.offeredEngines(installed: [], known: [r5, r6], macOS: "26.6.2").map(\.id), ["x64-a-r5"])+ XCTAssertEqual(EngineStore.offeredEngines(installed: [], known: [r5, r6], macOS: "27.0").map(\.id), ["x64-a-r6", "x64-a-r5"])+ let installedR6 = InstalledEngine(manifest: r6, root: URL(fileURLWithPath: "/tmp/r6"))+ XCTAssertEqual(EngineStore.offeredEngines(installed: [installedR6], known: [r6], macOS: "26.6.2").map(\.id), ["x64-a-r6"], "an engine already installed stays listed")+ }+// A bottle set up by an old Steam recipe carries WINEMSYNC=0/WINEESYNC=0 in its bottle-wide// environment, which silently turned msync off for every game. Format 3 drops exactly that// pair once; a deliberate WINEMSYNC=1 or a single variable is left alone.diff --git a/spike/engines/x64-sikarugir10.0_6-r6.json b/spike/engines/x64-sikarugir10.0_6-r6.jsonnew file mode 100644index 0000000..da13112--- /dev/null+++ b/spike/engines/x64-sikarugir10.0_6-r6.json@@ -0,0 +1,151 @@+{+ "$schema": "https://highball.app/schemas/engine-manifest/v0",+ "id": "x64-sikarugir10.0_6-r6",+ "displayName": "Wine 10.0 (Sikarugir) r6, D3DMetal 4.0 beta 2",+ "arch": "x86_64",+ "minMacOS": "27.0",+ "requires": [+ "rosetta2"+ ],+ "notes": [+ "r6 = r5 with D3DMetal from Game Porting Toolkit 4.0 beta 2 (highball#85). Only D3DMetal (DirectX 12) games see a difference; DXMT and DXVK are unchanged. Offered on macOS 27 or newer.",+ "baseEnv D3DM_MTL4=0: D3DMetal 4.0b2's Metal 4 backend ended HumanitZ's menu quietly within a minute, twice, with no message and nothing from Metal validation (which, by slowing the work, let it survive), so it is a timing bug in Apple's beta. On the Metal 3 path inside 4.0b2 the same title held for the whole run at a fifth of the memory (about 260 MB resident against 1.26 GB on r5), and The Last Caretaker demo drew at 99% GPU where r5 sat at 2% (its black screen). Set D3DM_MTL4=1 in a game's environment to try the Metal 4 backend. Measured 2026-09-19 on an M1 Pro, macOS 27.0, session locked (process, GPU load and logs; no captures).",+ "Engine is Gcenx's Sikarugir build of upstream Wine 10.0: exports macdrv_functions from winemac.so (required by both DXMT and D3DMetal bridges) and supports WINEDLLPATH_PREPEND for per-bottle renderer overlays.",+ "Vanilla Gcenx wine-devel 11.15 lacks the macdrv_functions export -> DXMT and D3DMetal do NOT work on it. Verified 2026-08-23 with nm.",+ "Runtime dylibs (GStreamer, MoltenVK, gnutls, freetype, SDL2, icu...) are NOT inside the engine; they come from the Sikarugir Wrapper Template's Frameworks/ and are found via DYLD_FALLBACK_LIBRARY_PATH.",+ "Wine 10 still ships a wine64 binary but the loader is `wine`; use `wine` so Wine 11 engines work unchanged.",+ "D3DMetal is NOT downloaded separately: the Template's frameworks/renderer/d3dmetal overlay is used, but only exposed once the user has accepted the Apple GPTK license (recorded in manifest.json as acceptedLicenses).",+ "r1 (2026-09-02): adds the moltenvk component. Everything else is byte-identical to r0, so existing downloads are reused; only the 5 MB MoltenVK tarball is new.",+ "r2 (2026-09-07): adds the d3dmetal-tsshim component, a d3d12.dll in front of D3DMetal's that serves DirectX 12 timestamp queries (D3DMetal 3.0 resolves them to zero at a reported 60 Hz, which crashes Guardians of the Galaxy, highball#63). Everything else is byte-identical to r1, so existing downloads are reused; only the 46 KB shim tarball is new. Source: spike/tsshim, Scripts/build-tsshim.sh.",+ "r3 (2026-09-15): the d3dmetal-tsshim component rebuilt so its exports carry Microsoft's d3d12 ordinals (GetBehaviorValue 100, D3D12CreateDevice 101, ... 110), which D3DMetal mirrors. The r2 shim numbered them from 1, so a game that binds d3d12 imports by ordinal (Path of Exile 2 delay-loads D3D12CreateDevice as ordinal 101) died at startup with 'ordinal 101 out of range' and Wine's exception 0xc06d007f (highball-db#53). Everything else is byte-identical to r2, so existing downloads are reused; only the 46 KB shim tarball is new. Source: spike/tsshim, Scripts/build-tsshim.sh 20260915.",+ "r5 (2026-09-18): adds the d9vk-modern component, the DXVK-MacOS 3.1 Direct3D 9 that the withdrawn r4 candidate had put on every launch's search path, now as a directory nothing loads by itself. A game's recipe copies it beside the game with a per-program override (the legacy CS:GO copy mechanism). Every other component is byte-identical to r3, so existing downloads are reused; only the 10 MB d9vk archive is new, and it was already published for r4."+ ],+ "components": {+ "d3dmetal-tsshim": {+ "extract": {+ "into": "renderers/d3dmetal-tsshim/wine",+ "subpath": "renderers/d3dmetal-tsshim/wine"+ },+ "kind": "renderer",+ "license": "MIT",+ "note": "A d3d12.dll in front of D3DMetal's that serves DirectX 12 timestamp queries (D3DMetal 3.0 resolves them to zero at a reported 60 Hz). Exports carry Microsoft's d3d12 ordinals (D3D12CreateDevice at 101), which D3DMetal mirrors, so games that bind d3d12 imports by ordinal load through it. Kill switch HB_D3D12_TSSHIM=0 idles the patches; the DLL stays in front. Source: spike/tsshim, Scripts/build-tsshim.sh.",+ "order": 1,+ "sha256": "453f33ef1442ec8d24e9a44d901d35d4d07431c05ae8318c30567facc78d9ef3",+ "size": 46116,+ "url": "https://github.com/gauthierpiarrette/highball-engine/releases/download/d3dmetal-tsshim-20260915/d3dmetal-tsshim-20260915.tar.xz",+ "version": "20260915"+ },+ "d9vk-modern": {+ "extract": {+ "into": "renderers/d9vk-modern/wine",+ "subpath": "renderers/d9vk/wine"+ },+ "kind": "renderer",+ "license": "zlib",+ "note": "The metalsharp DXVK-MacOS v3.1-macos1.0 Direct3D 9 (DXVK 3.1 with the Gcenx MoltenVK work), both architectures, stamped as Wine builtins. Not on any launch's search path: the template's DXVK-Kegworks 1.10.4 d9vk stays the Direct3D 9 every game gets. A game's recipe copies this one beside the game's executable with a per-program native override when the row says the newer layer is the one that runs it (RaceRoom, highball-db#60). It rendered RaceRoom for one reporter and drew it in grayscale for another, and froze Five Nights at Freddy's, when the r4 candidate put it on every launch's path, which is why it is opt-in per game.",+ "order": 1,+ "sha256": "0fabdffde07ef1ef041e95181ca1507db96919cf70acfa91a15c159718ad7611",+ "size": 9766808,+ "url": "https://github.com/gauthierpiarrette/highball-engine/releases/download/d9vk-dxvk-macos-3.1-20260916/d9vk-dxvk-macos-3.1-20260916.tar.xz",+ "version": "dxvk-macos-3.1-20260916"+ },+ "dxmt": {+ "extract": {+ "into": "renderers/dxmt/wine",+ "subpath": "v0.80"+ },+ "kind": "renderer",+ "license": "MIT",+ "sha256": "8f260e36b5739e68f3bad613381441385c4dc7b85b78ba8de653d5a6a264529d",+ "size": 18681669,+ "url": "https://github.com/3Shain/dxmt/releases/download/v0.80/dxmt-v0.80-builtin.tar.gz"+ },+ "moltenvk": {+ "extract": {+ "into": "frameworks/libMoltenVK.dylib",+ "subpath": "libMoltenVK.dylib"+ },+ "kind": "runtime",+ "license": "Apache-2.0",+ "note": "MoltenVK 1.4.1 rebuilt with Highball's shadow-import patch (spike/patches/moltenvk-shadow-import.patch, Scripts/build-moltenvk.sh). Replaces the Template's libMoltenVK.dylib. Off unless a launch sets MVK_SHADOW_IMPORT=1: with it, Wine's wow64 host-memory imports are backed by a private Metal buffer synced on every submit, which is what makes 32-bit native-Vulkan games (The Sims Legacy Collection) render instead of losing the device on every vkQueueSubmit.",+ "order": 1,+ "sha256": "fbed7b80d6dc2aeaba6fa7047c1fe64827d5004c28029fb43c2bc34f80c35228",+ "size": 1674937,+ "url": "https://github.com/gauthierpiarrette/highball/releases/download/engine-components/moltenvk-1.4.1-shadow-import-1-x86_64.tar.gz",+ "version": "1.4.1+shadow-import-1"+ },+ "runtime": {+ "extract": {+ "into": "frameworks",+ "subpath": "Template-1.0.11.app/Contents/Frameworks"+ },+ "kind": "frameworks",+ "license": "mixed (LGPL-2.1 GStreamer, Apache-2.0 MoltenVK, LGPL gnutls, ...)",+ "sha256": "9fa15479e7ff6abd99c1d07be285fb95f41fc6991586502427152b1f7d6ccb8a",+ "size": 84533420,+ "url": "https://github.com/Sikarugir-App/Wrapper/releases/download/v1.0/Template-1.0.11.tar.xz"+ },+ "wine": {+ "extract": {+ "into": "engine",+ "strip": "wswine.bundle"+ },+ "kind": "engine",+ "license": "LGPL-2.1+",+ "sha256": "9da7ee0cbf386522f3a9906943726d9c3c125dbbd9ab120e3cde80e88d6091b2",+ "size": 166304096,+ "url": "https://github.com/Sikarugir-App/Engines/releases/download/v1.0/WS12WineSikarugir10.0_6.tar.xz",+ "version": "wine-10.0 (Sikarugir) revision 6"+ },+ "winetricks": {+ "kind": "tool",+ "license": "LGPL-2.1",+ "note": "Pinned to upstream commit 5a59ea07 (20260125+dev, 2026-08-07) — the exact bytes 0.7.x verified with dotnet48. The old branch URL drifted and broke every fresh engine install (issues #27/#28); URLs here must be immutable.",+ "sha256": "f35c29737ca08a583569e6a3752d52fbe23333c5acfad5f16c4177d25eaf3f4b",+ "url": "https://raw.githubusercontent.com/Winetricks/winetricks/5a59ea07513b24093bd90fad943ecf9543cf05bc/src/winetricks"+ },+ "d3dmetal": {+ "kind": "renderer",+ "url": "https://github.com/gauthierpiarrette/highball/releases/download/engine-components/d3dmetal-4.0b2-gptk4.tar.xz",+ "sha256": "96cbbe89b71cb07cc33bd761ae4b79452b9cdf3198593dfb779036caf85f07a9",+ "size": 16462052,+ "license": "apple-gptk-license-2023-08-17",+ "version": "D3DMetal-4.0b2 (Game Porting Toolkit 4.0 beta 2, redist/lib; Apple Software Signing chain verified 2026-09-19)",+ "order": 1,+ "extract": {+ "subpath": "renderers/d3dmetal",+ "into": "renderers/d3dmetal"+ },+ "layout": [+ "external/D3DMetal.framework",+ "external/libd3dshared.dylib",+ "wine/x86_64-windows/{d3d10,d3d11,d3d12,dxgi,nvapi64,nvngx-on-metalfx}.dll",+ "wine/x86_64-unix/*.so -> ../../external/libd3dshared.dylib"+ ],+ "note": "Apple's D3DMetal from GPTK 4 (Metal 4), laid over the Template's GPTK 3 copy: rendererDir prefers renderers/d3dmetal. Same Apple licence text as GPTK 3 (identical modulo whitespace, 2026-09-19), so the same licence id and acceptance apply. The framework's own minimum is macOS 14, but it is offered on 27 or newer only, where it was measured."+ }+ },+ "baseEnv": {+ "DYLD_FALLBACK_FRAMEWORK_PATH": "${frameworks}",+ "DYLD_FALLBACK_LIBRARY_PATH": "${frameworks}:${frameworks}/GStreamer.framework/Versions/1.0/lib",+ "GST_PLUGIN_PATH": "${frameworks}/GStreamer.framework/Versions/1.0/lib/gstreamer-1.0",+ "WINEDEBUG": "fixme-all",+ "D3DM_MTL4": "0"+ },+ "licenses": {+ "apple-gptk-license-2023-08-17": {+ "applies": [+ "renderers/d3dmetal (bundled in the Sikarugir Template: D3DMetal.framework sha1 1405e5c6… identical to GPTK 3.0-3)",+ "renderers/d3dmetal (GPTK 4.0 beta 2 redist: D3DMetal-4.0b2)"+ ],+ "summary": "Apple Game Porting Toolkit license: non-commercial use/distribution only; no modification; use scoped to developing, testing or evaluating games on Apple hardware.",+ "text": "spike/d3dmetal-license.txt"+ }+ },+ "verified": {+ "date": "2026-09-19",+ "macos": "27.0",+ "chip": "Apple M1 Pro",+ "result": "HumanitZ demo (D3D12) stable 3 min at ~260 MB resident (r5: 1.26 GB); The Last Caretaker demo draws (99% GPU) where r5 shows a black screen (2% GPU). Blind run (session locked): process, GPU load and logs only, no captures."+ }+}