From 4c33ff6f662935d2e525ce0b9b4d7b1076b13e89 Mon Sep 17 00:00:00 2001 From: Istvan Matejcsok <119620946+matejcsok-ee@users.noreply.github.com> Date: Fri, 3 Jul 2026 11:43:41 +0200 Subject: [PATCH] fix(ci): run heavy 3D-viewer specs headed on Mesa llvmpipe (not headless SwiftShader) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Serializing the 3D specs (prior commit) proved the crashes are NOT concurrency: with --workers=1 (one tab at a time) the same three heavy-interaction specs still failed (run 28649537489). The [DIAG] instrumentation + trace console pinned the real cause — under HEADLESS SwiftShader on the GPU-less CI VM, the CPU raytracer's WebGL blit plus the tests' drawImage(glCanvas) pixel reads trigger "GPU stall due to ReadPixels", and Chromium's GPU watchdog then resets the context (CONTEXT_LOST_WEBGL) or crashes the renderer ("Target crashed") — even single-tab. Run chromium-ci-3d HEADED under the CI's Xvfb with Mesa llvmpipe (--use-gl=angle --use-angle=gl) — the same software-WebGL stack the Firefox CI project already relies on — and disable the GPU watchdog / crash-limit so a slow ReadPixels completes instead of being killed. --enable-unsafe-swiftshader kept only as a last-ditch fallback. The serial --workers=1 pass + phase-1 worker cap stay (cheap, and they removed concurrency as a variable). Co-Authored-By: Claude Opus 4.8 (1M context) --- tests/playwright-kicad.config.ts | 36 ++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/tests/playwright-kicad.config.ts b/tests/playwright-kicad.config.ts index 653bd59..6936431 100644 --- a/tests/playwright-kicad.config.ts +++ b/tests/playwright-kicad.config.ts @@ -243,22 +243,40 @@ export default defineConfig({ }, }, { - // CI-only serial carrier for the heavy 3D-viewer specs (see THREE_D_HEAVY_SPECS). - // Same runtime as chromium-ci; test:kicad:ci invokes this project in a SEPARATE - // `playwright test` pass with --workers=1, so at most one raytrace tab is alive at a - // time (the environment in which a single 3D load is reliably green — see - // docs/features/3d-raytracer/README.md §6-§7). Own outputDir so its start-of-run - // cleanup doesn't wipe chromium-ci's retained traces, and so its own failure traces - // survive the later `test:perf` run's pw-artifacts/kicad wipe; the CI upload glob - // tests/pw-artifacts/** already captures it, so no workflow change is needed. + // CI-only carrier for the heavy 3D-viewer specs (see THREE_D_HEAVY_SPECS). Two reasons + // it is split out of chromium-ci: + // 1. HEADED + Mesa llvmpipe GL, not headless SwiftShader. The heavy 3D interactions + // (camera move / model scene-build / edge-resize) run the CPU raytracer whose WebGL + // blit + the tests' drawImage(glCanvas) pixel reads trigger heavy ReadPixels. Under + // HEADLESS SwiftShader on the GPU-less CI VM those stall the GPU thread and Chromium's + // GPU watchdog resets the context (CONTEXT_LOST_WEBGL) or crashes the renderer ("Target + // crashed") — even with a SINGLE tab (run 28649537489, confirmed via the [DIAG] logs + + // trace console). Fix: run HEADED under the CI's Xvfb with Mesa llvmpipe + // (--use-gl=angle --use-angle=gl) — the SAME software-WebGL stack the Firefox CI + // project already relies on (see the firefox project's headless:false note) — and + // disable the GPU watchdog / crash-limit so a slow ReadPixels completes instead of + // being killed. --enable-unsafe-swiftshader stays only as a last-ditch fallback. + // 2. Runs in a SEPARATE `playwright test` pass with --workers=1 (test:kicad:ci), so at + // most one raytrace tab is alive at a time. + // Own outputDir so its start-of-run cleanup doesn't wipe chromium-ci's retained traces, + // and its own failure traces survive the later `test:perf` run's pw-artifacts/kicad wipe; + // the CI upload glob tests/pw-artifacts/** already captures it (no workflow change needed). name: "chromium-ci-3d", testMatch: THREE_D_HEAVY_SPECS, outputDir: process.env.CI ? "pw-artifacts/kicad-3d" : "test-results", use: { ...devices["Desktop Chrome"], viewport: { width: 1280, height: 720 }, + // Headed only matters on CI (real GPU locally); harmless headed locally too. + headless: !process.env.CI, launchOptions: { - args: ["--enable-unsafe-swiftshader"], + args: [ + "--use-gl=angle", + "--use-angle=gl", + "--disable-gpu-watchdog", + "--disable-gpu-process-crash-limit", + "--enable-unsafe-swiftshader", + ], }, }, },