A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.
TypeScript 2d-game-engine3d3d-game-engineandroidcppecsgame-editorgame-enginegamedeviostypescriptwebassemblywebglwebgpuwechat-minigame
fix(gates): a runner whose GPU never came up says so, and gets more tries
esengineeacdf721f0a5
diff --git a/desktop/tests/dead-gpu.test.ts b/desktop/tests/dead-gpu.test.tsindex fea5d975e..8c39ea559 100644--- a/desktop/tests/dead-gpu.test.ts+++ b/desktop/tests/dead-gpu.test.ts@@ -81,7 +81,7 @@ describe('retryOnDeadGpu', () => {it('gives up at the cap and says the GPU is why', () => {const r = run([DEAD]);expect(r.ok).toBe(false);- expect(r.attempts).toBe(4);+ expect(r.attempts).toBe(6);expect(r.gpuDied).toBe(true);});});diff --git a/tools/lib/deadGpu.mjs b/tools/lib/deadGpu.mjsindex f55f7db84..62f85f868 100644--- a/tools/lib/deadGpu.mjs+++ b/tools/lib/deadGpu.mjs@@ -21,8 +21,10 @@ export function gpuNeverCameUp(output) {|| /WebGL2 is not available/.test(output);}-/** Attempts one measurement is allowed, counting the first. */-const MAX_ATTEMPTS = 4;+/** Attempts one measurement is allowed, counting the first. Six, not four: four+ * was measured when the first project needed three retries to draw, and a tier+ * with one more pair in it spent them all on a game that was fine. */+const MAX_ATTEMPTS = 6;/*** Wait before relaunching, growing with each try. The retries were immediate,diff --git a/tools/verify-golden.mjs b/tools/verify-golden.mjsindex 30f0331a6..44090e29f 100644--- a/tools/verify-golden.mjs+++ b/tools/verify-golden.mjs@@ -120,7 +120,14 @@ function captureEditorFrame(id, out) {const run = retryOnDeadGpu(attempt, (died) => console.log(`↻ ${id} — ${died? 'the GPU process died before the editor drew': 'no editor frame after a GPU death'}; capturing again`));- if (!run.ok) return { ok: false, why: run.output.trim().slice(-300) };+ if (!run.ok) {+ return {+ ok: false,+ why: run.gpuDied+ ? `the GPU process never came up for the editor, on every attempt — no frame to compare against (${run.output.trim().slice(-200)})`+ : run.output.trim().slice(-300),+ };+ }return { ok: true, w: run.w, h: run.h };}@@ -174,7 +181,10 @@ function launchPackage(id, target, args) {? 'the GPU process died before it drew': 'a blank frame on the launch after a GPU death'}; launching again`),);- return run.r;+ // gpuDied travels with the result: without it a runner whose GPU never came up+ // is reported as a game that draws nothing, which is the one confusion this+ // whole retry exists to prevent.+ return { ...run.r, gpuDied: Boolean(run.gpuDied) };}const results = [];@@ -259,8 +269,11 @@ for (const { id, target } of pairs) {const line = (launch.stdout || '').split('\n').find((l) => l.startsWith('✓') || l.startsWith('✗')) ?? '';if (launch.status !== 0) {- results.push({ id, target, stage: 'launch', ok: false, why: line || 'launch failed' });- console.log(`✗ ${id} ${target} — ${line || 'launch failed'}`);+ const why = launch.gpuDied+ ? `the GPU process never came up, on every attempt — this says nothing about the game (${line || 'no frame'})`+ : line || 'launch failed';+ results.push({ id, target, stage: 'launch', ok: false, why });+ console.log(`✗ ${id} ${target} — ${why}`);for (const l of (launch.stdout || '').split('\n').slice(-6)) if (l.trim()) console.log(` ${l}`);continue;}