Skip to content

Commit 35d1451

Browse files
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.
1 parent 32f562b commit 35d1451

2 files changed

Lines changed: 35 additions & 0 deletions

File tree

‎packages/cli/src/utils/checkBrowser.test.ts‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,6 +1078,38 @@ it("elevates and deduplicates WebGPU validation warnings while preserving ordina
10781078
);
10791079
});
10801080

1081+
// fails without the fix: check's own canvas reads made Chrome log GPU stalls, reported as the film's warnings.
1082+
it("does not report Chrome's GPU stall notes for check's own pixel reads as the film's warnings", async () => {
1083+
vi.spyOn(Date, "now").mockReturnValue(100);
1084+
mountCanvasFixture();
1085+
const page = fakePage();
1086+
const stall = fakeConsoleMessage(
1087+
"warn",
1088+
"[.WebGL-0x2c84001d4800]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels",
1089+
);
1090+
const ordinaryWarning = fakeConsoleMessage("warn", "Optional caption font was not loaded");
1091+
page.on = vi.fn(
1092+
(event: string, handler: (message: ReturnType<typeof fakeConsoleMessage>) => void) => {
1093+
if (event === "console") {
1094+
handler(stall);
1095+
handler(ordinaryWarning);
1096+
}
1097+
},
1098+
);
1099+
installSessionMock(page);
1100+
1101+
const result = await runBrowserCheck(
1102+
PROJECT,
1103+
{ ...DEFAULT_CHECK_OPTIONS, samples: 1, contrast: false },
1104+
{ kind: "none" },
1105+
runAuditGrid,
1106+
);
1107+
1108+
expect(
1109+
result.runtimeFindings.filter(({ code }) => code === "console_warning").map((f) => f.message),
1110+
).toEqual([ordinaryWarning.text()]);
1111+
});
1112+
10811113
describe("collectSeekClock", () => {
10821114
afterEach(() => {
10831115
Reflect.deleteProperty(window, "__timelines");

‎packages/cli/src/utils/checkBrowser.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -869,6 +869,8 @@ function runtimeInfoFindingCode(text: string): string | null {
869869
: "media_proxy_fallback";
870870
}
871871

872+
const GL_DRIVER_PERFORMANCE_NOTE = /^\[\.WebGL-[^\]]*\]GL Driver Message \([^,]*, Performance,/;
873+
872874
function wireRuntimeListeners(page: Page, drafts: RuntimeDraft[], clock: RuntimeClock): void {
873875
followSampleTimeMarkers(page, clock.at);
874876
page.on("console", (message) => {
@@ -885,6 +887,7 @@ function wireRuntimeListeners(page: Page, drafts: RuntimeDraft[], clock: Runtime
885887
line: location.lineNumber,
886888
});
887889
} else if (type === "warn") {
890+
if (GL_DRIVER_PERFORMANCE_NOTE.test(text)) return;
888891
const location = message.location();
889892
const webGpuFailure = isWebGpuRuntimeFailure(text);
890893
pushRuntimeDraft(drafts, {

0 commit comments

Comments
 (0)