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
refactor(gates): one sentence for "the GPU never came up", not two
esengine74afa664593f
diff --git a/desktop/tests/dead-gpu.test.ts b/desktop/tests/dead-gpu.test.tsindex 8c39ea559..6204cadbe 100644--- a/desktop/tests/dead-gpu.test.ts+++ b/desktop/tests/dead-gpu.test.ts@@ -10,7 +10,7 @@*/import { describe, it, expect } from 'vitest';// @ts-expect-error — a .mjs tool module, typed by its own JSDoc-import { retryOnDeadGpu, gpuNeverCameUp } from '../../tools/lib/deadGpu.mjs';+import { retryOnDeadGpu, gpuNeverCameUp, deadGpuVerdict } from '../../tools/lib/deadGpu.mjs';const DEAD = 'Exiting GPU process due to errors during initialization';const BLANK = 'painted=true live=false errors=0';@@ -78,6 +78,13 @@ describe('retryOnDeadGpu', () => {expect(r.notes).toEqual([true, false]);});+ it('words the give-up once, for both runners', () => {+ // The two of them each had their own sentence for it, and one of them+ // blamed the game — the failure this file exists to keep apart.+ expect(deadGpuVerdict('the game')).toContain('says nothing about the game');+ expect(deadGpuVerdict('the scene')).toContain('never came up');+ });+it('gives up at the cap and says the GPU is why', () => {const r = run([DEAD]);expect(r.ok).toBe(false);diff --git a/tools/lib/deadGpu.mjs b/tools/lib/deadGpu.mjsindex 62f85f868..71514c130 100644--- a/tools/lib/deadGpu.mjs+++ b/tools/lib/deadGpu.mjs@@ -21,6 +21,15 @@ export function gpuNeverCameUp(output) {|| /WebGL2 is not available/.test(output);}+/**+ * What to report when a measurement never happened because the GPU never came up.+ * Shared for the same reason the detection is: the two runners described the same+ * failure differently, and one of them described it as the game's fault.+ */+export function deadGpuVerdict(subject) {+ return `the GPU process never came up, on every attempt — this says nothing about ${subject}`;+}+/** 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. */diff --git a/tools/verify-golden.mjs b/tools/verify-golden.mjsindex 44090e29f..a38cc370a 100644--- a/tools/verify-golden.mjs+++ b/tools/verify-golden.mjs@@ -21,7 +21,7 @@ import { mkdirSync, rmSync, readFileSync, existsSync } from 'node:fs';import path from 'node:path';import { atTier, projectDir, parityFor, interactFor, audioFor, suspendFor, safeAreaFor, atlasFor, webPixels, ROOT } from './goldenProjects.mjs';import { frameDistance, frameCellMax, readPNG } from './frameCompare.mjs';-import { retryOnDeadGpu } from './lib/deadGpu.mjs';+import { retryOnDeadGpu, deadGpuVerdict } from './lib/deadGpu.mjs';const argv = process.argv.slice(2);const flag = (n, d) => {@@ -124,7 +124,7 @@ function captureEditorFrame(id, out) {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)})`+ ? `${deadGpuVerdict('the editor\'s frame')} (${run.output.trim().slice(-200)})`: run.output.trim().slice(-300),};}@@ -270,7 +270,7 @@ for (const { id, target } of pairs) {const line = (launch.stdout || '').split('\n').find((l) => l.startsWith('✓') || l.startsWith('✗')) ?? '';if (launch.status !== 0) {const why = launch.gpuDied- ? `the GPU process never came up, on every attempt — this says nothing about the game (${line || 'no frame'})`+ ? `${deadGpuVerdict('the game')} (${line || 'no frame'})`: line || 'launch failed';results.push({ id, target, stage: 'launch', ok: false, why });console.log(`✗ ${id} ${target} — ${why}`);diff --git a/tools/verify-render.mjs b/tools/verify-render.mjsindex 4de391079..df4026340 100644--- a/tools/verify-render.mjs+++ b/tools/verify-render.mjs@@ -15,7 +15,7 @@ import { spawnSync } from 'node:child_process';import path from 'node:path';import { fileURLToPath } from 'node:url';import { TIERS, SCENES, scenesAtTier } from './renderScenes.mjs';-import { retryOnDeadGpu } from './lib/deadGpu.mjs';+import { retryOnDeadGpu, deadGpuVerdict } from './lib/deadGpu.mjs';const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');const DESKTOP = path.join(ROOT, 'desktop');@@ -121,7 +121,8 @@ for (const scene of scenes) {run = attempt;}if (!run.ok) failed.push(scene.id);- console.log(`${run.ok ? '✓' : '✗'} ${scene.id.padEnd(28)} ${run.verdict}`);+ console.log(`${run.ok ? '✓' : '✗'} ${scene.id.padEnd(28)} `+ + `${run.gpuDied ? deadGpuVerdict('the scene') : run.verdict}`);if (!run.ok) {for (const l of run.out.split('\n').slice(-8)) if (l.trim()) console.log(` ${l}`);}