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
Verifier: record which Direct3D implementation served the game
Gauthier Piarrette0f31ff97ba99
diff --git a/Sources/HighballKit/Verifier.swift b/Sources/HighballKit/Verifier.swiftindex 7849a1c..7621bfe 100644--- a/Sources/HighballKit/Verifier.swift+++ b/Sources/HighballKit/Verifier.swift@@ -17,6 +17,14 @@ public struct VerifyOutcome: Codable, Sendable {public var chip: Stringpublic var macos: Stringpublic var log: String+ /// Which Direct3D implementation actually served the game, from Wine's DLL-load trace:+ /// "dxmt", "dxvk", "d3dmetal", "wined3d" (Wine's own, i.e. no overlay applied), or "none"+ /// when the game loaded no Direct3D at all. Optional so older result lines still decode.+ public var served: String?+ /// False when a renderer overlay was asked for and Wine's own Direct3D served instead: the+ /// engine ignored the overlay (2026-09-04: a tree without WINEDLLPATH_PREPEND support passed+ /// every liveness check while never running DXMT or DXVK once).+ public var overlayApplied: Bool?}public struct Verifier {@@ -51,8 +59,12 @@ public struct Verifier {let runner = WineRunner(paths: paths, engine: engine, bottle: bottle)let steam = bottle.driveC.appending(path: "Program Files (x86)/Steam/steam.exe")log?("[\(game.name)] launching via silent Steam (\(renderer.rawValue))…")+ // +loaddll is what makes the verdict attributable: the game's Wine output lands in this+ // log (children inherit stderr), and each Direct3D DLL's load line names the file that+ // served it, overlay or Wine's own.let launch = Task {- try await runner.start(steam, arguments: ["-silent", "-applaunch", String(game.appid)], renderer: renderer)+ try await runner.start(steam, arguments: ["-silent", "-applaunch", String(game.appid)], renderer: renderer,+ extraEnvironment: ["WINEDEBUG": "fixme-all,+loaddll"])}// Wait up to 6 minutes for the game process (cold silent Steam needs ~2 min first).@@ -72,6 +84,11 @@ public struct Verifier {// Tear down.try? WineRunner(paths: paths, engine: engine, bottle: bottle).kill()launch.cancel()+ let launchLog = (try? await launch.value)?.log+ let served = launchLog.flatMap { try? String(contentsOf: $0, encoding: .utf8) }.map(Self.servedImplementation(fromLog:)) ?? "unknown"+ // Every renderer but wined3d routes Direct3D 9 through the d9vk overlay, so "dxvk" under a+ // dxmt run is still an overlay; only Wine's own implementation means the ask was ignored.+ let overlayApplied: Bool? = (renderer == .wined3d || served == "unknown" || served == "none") ? nil : served != "wined3d"let meanLum = luminances.isEmpty ? 0 : luminances.reduce(0, +) / Double(luminances.count)let verdict: VerifyOutcome.Verdict =@@ -84,12 +101,33 @@ public struct Verifier {let outcome = VerifyOutcome(appid: game.appid, title: game.name, renderer: renderer, verdict: verdict,secondsAlive: alive, meanLuminance: (meanLum * 1000).rounded() / 1000,date: ISO8601DateFormatter().string(from: Date()),- engine: engine.id, chip: chip, macos: macos, log: "")+ engine: engine.id, chip: chip, macos: macos, log: "",+ served: served, overlayApplied: overlayApplied)try append(outcome)- log?("[\(game.name)] \(renderer.rawValue): \(verdict.rawValue) (alive \(alive)s, luminance \(outcome.meanLuminance))")+ let via = overlayApplied == false ? " via \(served), OVERLAY NOT APPLIED" : " via \(served)"+ log?("[\(game.name)] \(renderer.rawValue): \(verdict.rawValue) (alive \(alive)s, luminance \(outcome.meanLuminance))\(via)")return outcome}+ /// Reads Wine's +loaddll trace for the Direct3D DLLs a process loaded and names the+ /// implementation behind them by the file's location: Highball's overlay directories+ /// (renderers/<name>/wine or the Template's renderer/<name>/wine) or Wine's own system32.+ /// d3d9 through the d9vk overlay counts as dxvk. The first Direct3D load wins the name;+ /// "none" when no Direct3D DLL loaded at all.+ public static func servedImplementation(fromLog log: String) -> String {+ for line in log.split(separator: "\n") {+ guard line.contains("loaddll"), line.contains("Loaded L\""),+ let range = line.range(of: #"Loaded L"([^"]+\\(d3d11|d3d9|d3d10core|d3d12|dxgi)\.dll)""#, options: .regularExpression)+ else { continue }+ let path = line[range].lowercased()+ if path.contains("\\dxmt\\") { return "dxmt" }+ if path.contains("\\dxvk\\") || path.contains("\\d9vk\\") { return "dxvk" }+ if path.contains("\\d3dmetal\\") { return "d3dmetal" }+ if path.contains("\\windows\\system32\\") || path.contains("\\windows\\syswow64\\") { return "wined3d" }+ }+ return "none"+ }+func append(_ o: VerifyOutcome) throws {try paths.ensure()let file = paths.logs.appending(path: "verify-results.jsonl")diff --git a/Tests/HighballKitTests/RegressionTests.swift b/Tests/HighballKitTests/RegressionTests.swiftindex 61a3234..3231246 100644--- a/Tests/HighballKitTests/RegressionTests.swift+++ b/Tests/HighballKitTests/RegressionTests.swift@@ -919,6 +919,19 @@ extension RegressionTests {XCTAssertFalse(current.needsSave)}+ // The verifier names the Direct3D implementation from Wine's +loaddll trace. The 2026-09-04+ // engine that ignored every overlay would have shown "wined3d" on a dxmt run.+ func testVerifierNamesTheDirect3DImplementationFromTheLoadTrace() {+ let dxmt = #"0024:trace:loaddll:build_module Loaded L"Z:\Users\me\Library\Application Support\Highball\engines\x64-a-r1\renderers\dxmt\wine\x86_64-windows\d3d11.dll" at 000000006FC00000: builtin"#+ let d9vk = #"0024:trace:loaddll:build_module Loaded L"Z:\Users\me\Library\Application Support\Highball\engines\x64-a-r1\frameworks\renderer\d9vk\wine\x86_64-windows\d3d9.dll" at 000000006FC00000: builtin"#+ let own = #"0024:trace:loaddll:build_module Loaded L"C:\windows\system32\d3d11.dll" at 000000006FC00000: builtin"#+ let other = #"0024:trace:loaddll:build_module Loaded L"C:\windows\system32\kernel32.dll" at 000000006FC00000: builtin"#+ XCTAssertEqual(Verifier.servedImplementation(fromLog: [other, dxmt, own].joined(separator: "\n")), "dxmt", "the first Direct3D load names it")+ XCTAssertEqual(Verifier.servedImplementation(fromLog: [other, d9vk].joined(separator: "\n")), "dxvk", "d9vk is DXVK's d3d9")+ XCTAssertEqual(Verifier.servedImplementation(fromLog: [other, own].joined(separator: "\n")), "wined3d")+ XCTAssertEqual(Verifier.servedImplementation(fromLog: other), "none")+ }+func testDefaultEnginePrefersBundledManifestID() throws {func engine(_ id: String) throws -> InstalledEngine {let json = #"{"id":"\#(id)","displayName":"e","arch":"x86_64","minMacOS":"14.0","components":{}}"#