test(gpu): pin the win32-only fallback invariant the macOS Graphite fix relies on (#10646)

Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
Neil 2026-07-25 19:49:29 -07:00 committed by GitHub
parent 9042ef9792
commit bc2bdfc52e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 17 additions and 0 deletions

View File

@ -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')
}

View File

@ -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()