From 35d145157b277ff9b6b2178736e6b03406678de9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel?= Date: Sat, 14 Nov 2026 14:33:10 +0000 Subject: [PATCH] fix(cli): check no longer reports GPU stalls from its own pixel reads as the film's warnings (#7736) check copies each canvas into a 2D context to see whether it moved. On WebGL that readback makes Chrome log a GL driver Performance note, which check then listed as a console warning from the composition. --- packages/cli/src/utils/checkBrowser.test.ts | 32 +++++++++++++++++++++ packages/cli/src/utils/checkBrowser.ts | 3 ++ 2 files changed, 35 insertions(+) diff --git a/packages/cli/src/utils/checkBrowser.test.ts b/packages/cli/src/utils/checkBrowser.test.ts index 670f91c793..f4d9665ff7 100644 --- a/packages/cli/src/utils/checkBrowser.test.ts +++ b/packages/cli/src/utils/checkBrowser.test.ts @@ -1078,6 +1078,38 @@ it("elevates and deduplicates WebGPU validation warnings while preserving ordina ); }); +// fails without the fix: check's own canvas reads made Chrome log GPU stalls, reported as the film's warnings. +it("does not report Chrome's GPU stall notes for check's own pixel reads as the film's warnings", async () => { + vi.spyOn(Date, "now").mockReturnValue(100); + mountCanvasFixture(); + const page = fakePage(); + const stall = fakeConsoleMessage( + "warn", + "[.WebGL-0x2c84001d4800]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels", + ); + const ordinaryWarning = fakeConsoleMessage("warn", "Optional caption font was not loaded"); + page.on = vi.fn( + (event: string, handler: (message: ReturnType) => void) => { + if (event === "console") { + handler(stall); + handler(ordinaryWarning); + } + }, + ); + installSessionMock(page); + + const result = await runBrowserCheck( + PROJECT, + { ...DEFAULT_CHECK_OPTIONS, samples: 1, contrast: false }, + { kind: "none" }, + runAuditGrid, + ); + + expect( + result.runtimeFindings.filter(({ code }) => code === "console_warning").map((f) => f.message), + ).toEqual([ordinaryWarning.text()]); +}); + describe("collectSeekClock", () => { afterEach(() => { Reflect.deleteProperty(window, "__timelines"); diff --git a/packages/cli/src/utils/checkBrowser.ts b/packages/cli/src/utils/checkBrowser.ts index c20fd906af..8a0ce38dff 100644 --- a/packages/cli/src/utils/checkBrowser.ts +++ b/packages/cli/src/utils/checkBrowser.ts @@ -869,6 +869,8 @@ function runtimeInfoFindingCode(text: string): string | null { : "media_proxy_fallback"; } +const GL_DRIVER_PERFORMANCE_NOTE = /^\[\.WebGL-[^\]]*\]GL Driver Message \([^,]*, Performance,/; + function wireRuntimeListeners(page: Page, drafts: RuntimeDraft[], clock: RuntimeClock): void { followSampleTimeMarkers(page, clock.at); page.on("console", (message) => { @@ -885,6 +887,7 @@ function wireRuntimeListeners(page: Page, drafts: RuntimeDraft[], clock: Runtime line: location.lineNumber, }); } else if (type === "warn") { + if (GL_DRIVER_PERFORMANCE_NOTE.test(text)) return; const location = message.location(); const webGpuFailure = isWebGpuRuntimeFailure(text); pushRuntimeDraft(drafts, {