mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-18 07:50:13 +00:00
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.
This commit is contained in:
@@ -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<typeof fakeConsoleMessage>) => 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");
|
||||
|
||||
@@ -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, {
|
||||
|
||||
Reference in New Issue
Block a user