Skip to content

Run Windows games on Apple Silicon — free, open source, with an open compatibility database that tells you what actually works.

Report attaches a log from the newest sitting. A log that recorded a graphics backend won over newer logs of any age, so a Forza Horizon 6 report on engine r3 came with a log from the evening before, written on r1, because the two newest logs (Steam launches) had no backend line (highball#645, spotted by atheisticzc). An older backend log now counts only within two hours of the newest log, otherwise the newest log is attached. Report tests pass (7). (#646)

Gauthier Piarrette10101bf57c7b
diff --git a/Sources/HighballKit/Paths.swift b/Sources/HighballKit/Paths.swift
index 8c4a20f..3e8e645 100644
--- a/Sources/HighballKit/Paths.swift
+++ b/Sources/HighballKit/Paths.swift
@@ -247,6 +247,8 @@ public enum BugReport {
static let maxDigestCharacters = 8000
/// How many of the newest logs to open. The directory accumulates hundreds of files.
static let maxLogsExamined = 15
+ /// How far before the newest log a log still counts as the same sitting.
+ static let sameSessionWindow: TimeInterval = 2 * 3600
/// GitHub answers a request URI over roughly 8 KB with 414, and percent-encoding a log can
/// several-fold its length (every newline becomes %0A), so the ENCODED url is what must be
/// budgeted — not the digest's character count. Someone not signed in to GitHub is sent to
@@ -483,6 +485,11 @@ public enum BugReport {
// both times chosen by this picker, and each round cost days. Repair runs wineboot, so it
// is also the log most likely to be the newest one after someone follows fix instructions.
let isPrefixBoot: (URL) -> Bool = { $0.lastPathComponent.hasSuffix("-wineboot.log") }
+ // A log that recorded a backend wins over newer ones only from the same sitting. A Forza
+ // Horizon 6 report came with a log from the evening before, written on another engine
+ // revision, because the two newest logs (Steam launches on the new one) had no backend
+ // line (highball#645).
+ let sessionStart = newestFirst.first.map { modified($0).addingTimeInterval(-sameSessionWindow) } ?? .distantPast
var fallback: (url: URL, text: String)?
var bootFallback: (url: URL, text: String)?
for url in newestFirst {
@@ -491,7 +498,7 @@ public enum BugReport {
if bootFallback == nil { bootFallback = (url, text) }
continue
}
- if backendMarkers.contains(where: text.contains) { return (url, text) }
+ if backendMarkers.contains(where: text.contains), modified(url) >= sessionStart { return (url, text) }
if fallback == nil { fallback = (url, text) }
}
// Only when it is genuinely the only thing on disk — a bottle that has never run anything.
diff --git a/Tests/HighballKitTests/RegressionTests.swift b/Tests/HighballKitTests/RegressionTests.swift
index d7a95f0..bd84a2a 100644
--- a/Tests/HighballKitTests/RegressionTests.swift
+++ b/Tests/HighballKitTests/RegressionTests.swift
@@ -384,6 +384,29 @@ extension RegressionTests {
XCTAssertFalse(BugReport.isChore(dir.appending(path: "x-Games-winetricks-corefonts.log")), "a winetricks log explains a failed dependency")
}
+ // highball#645: the two newest logs, Steam launches on engine r3, had no backend line, and the
+ // picker went back to the evening before for a log written on r1.
+ func testReportKeepsToTheNewestSittingOverAnOlderBackendLog() throws {
+ let dir = FileManager.default.temporaryDirectory.appending(path: "hb-sitting-\(UUID().uuidString)")
+ try FileManager.default.createDirectory(at: dir, withIntermediateDirectories: true)
+ defer { try? FileManager.default.removeItem(at: dir) }
+ let write = { (name: String, text: String, age: TimeInterval) -> URL in
+ let url = dir.appending(path: name)
+ try text.write(to: url, atomically: true, encoding: .utf8)
+ try FileManager.default.setAttributes([.modificationDate: Date().addingTimeInterval(-age)], ofItemAtPath: url.path)
+ return url
+ }
+ let backend = "info: Game: steamsysinfo.exe\ninfo: DXVK: v3.1.1\n"
+ _ = try write("2026-11-03T211314Z-FH6-steam.exe.log", "# gin arm64-kk-wine11.18-r1 bottle=FH6\n" + backend, 14 * 3600)
+ _ = try write("2026-11-04T063732Z-FH6-steam.exe.log", "# gin arm64-kk-wine11.18-r3 bottle=FH6\n", 4 * 3600)
+ let newest = try write("2026-11-04T110154Z-FH6-steam.exe.log", "# gin arm64-kk-wine11.18-r3 bottle=FH6\n", 60)
+ XCTAssertEqual(BugReport.mostInformativeLog(in: [dir])?.url.lastPathComponent, newest.lastPathComponent)
+
+ // Within the same sitting the log that recorded the backend still wins.
+ let game = try write("2026-11-04T104000Z-FH6-ForzaHorizon6.exe.log", "# gin arm64-kk-wine11.18-r3 bottle=FH6\n" + backend, 30 * 60)
+ XCTAssertEqual(BugReport.mostInformativeLog(in: [dir])?.url.lastPathComponent, game.lastPathComponent)
+ }
+
// A blind suffix(30) is useless on a wine log: the end is MoltenVK warning spam while the
// block that identifies the backend sits thousands of lines earlier (6547 of 8185 in #21).
func testReportDigestKeepsTheBackendBlockBuriedMidLogAndCollapsesSpam() {