From bc2bdfc52ef1d66a2ba0008348b52fb8b19ca9d2 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Sat, 25 Jul 2026 19:49:29 -0700 Subject: [PATCH] test(gpu): pin the win32-only fallback invariant the macOS Graphite fix relies on (#10646) Co-authored-by: Orca --- src/main/startup/configure-process.ts | 2 ++ src/main/startup/gpu-fallback-marker.test.ts | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/main/startup/configure-process.ts b/src/main/startup/configure-process.ts index 74eacdac1..292f61952 100644 --- a/src/main/startup/configure-process.ts +++ b/src/main/startup/configure-process.ts @@ -264,6 +264,8 @@ export function enableMainProcessGpuFeatures(): void { if (process.platform === 'darwin') { // Why: Graphite can strand corrupt Metal tiles after idle; Ganesh preserves GPU compositing without the stale surface. + // Reached on every macOS launch only because GPU fallback skips this function and is win32-only; if fallback ever + // reaches macOS this must move out of this path or Macs silently lose the fix. app.commandLine.appendSwitch('disable-skia-graphite') } diff --git a/src/main/startup/gpu-fallback-marker.test.ts b/src/main/startup/gpu-fallback-marker.test.ts index c52fc3c1f..6aeacf8ec 100644 --- a/src/main/startup/gpu-fallback-marker.test.ts +++ b/src/main/startup/gpu-fallback-marker.test.ts @@ -79,6 +79,21 @@ describe('gpu-fallback-marker', () => { expect(existsSync(join(userDataPath, GPU_FALLBACK_MARKER_FILE))).toBe(false) }) + // Why: enableMainProcessGpuFeatures() is skipped while GPU fallback is active, and that function + // carries the macOS disable-skia-graphite fix. A marker that survived on darwin would silently + // strip the fix from the Macs it targets, so pin the platform gate for darwin specifically. + it('clears an active marker on macOS so the Graphite fix is never skipped', () => { + writeGpuFallbackMarker(userDataPath, { engagedAt: 1, crashesInWindow: 4 }, environment) + + expect( + readActiveGpuFallbackMarker(userDataPath, { + ...environment, + platform: 'darwin' + }) + ).toBeNull() + expect(existsSync(join(userDataPath, GPU_FALLBACK_MARKER_FILE))).toBe(false) + }) + it('clears a corrupt or wrong-version marker', () => { writeFileSync(join(userDataPath, GPU_FALLBACK_MARKER_FILE), '{ not json') expect(readGpuFallbackMarker(userDataPath)).toBeNull()