Skip to content

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.

fix(verify): a device the engine reports lost has drawn nothing, verdict line or not

yhh7fd48e0d03c8
diff --git a/tools/lib/deadGpu.mjs b/tools/lib/deadGpu.mjs
index c971f3f48..3c6ee09a8 100644
--- a/tools/lib/deadGpu.mjs
+++ b/tools/lib/deadGpu.mjs
@@ -99,7 +99,10 @@ const OUTAGE_SETTLES_MS = 2 * 60 * 1000;
* the same as "it rendered", and only the latter is a verdict about the scene.
*/
export function engineCouldNotDraw(output) {
- return /Framebuffer is incomplete|Failed to create framebuffer|Failed to create texture|createTexture failed/
+ // A device the engine reports LOST draws nothing after, whether or not it
+ // went on to fail making anything: the flat frame a launcher judges after
+ // that line is the loss, not the game — input-actions was red for one.
+ return /Framebuffer is incomplete|Failed to create framebuffer|Failed to create texture|createTexture failed|GPU device lost/
.test(output);
}
diff --git a/tools/tests/dead-gpu.test.ts b/tools/tests/dead-gpu.test.ts
index 0939f7496..1794e8cd4 100644
--- a/tools/tests/dead-gpu.test.ts
+++ b/tools/tests/dead-gpu.test.ts
@@ -203,6 +203,16 @@ describe('retryOnDeadGpu', () => {
const r = runReporting([{ ok: false, measured: true, drew: false }]);
expect(r.attempts).toBe(1);
});
+ it('a lost device with nothing left to create is still no verdict', () => {
+ // Verbatim from the runner: the context went, the launcher judged the flat
+ // frame that followed as "drew nothing", and no texture failed because
+ // nothing was asked for after the loss.
+ const lost = '[ERROR] GPU device lost: context-lost [backend=WebGL2, vendor=Google Inc. (Google)]';
+ expect(engineCouldNotDraw(lost)).toBe(true);
+ const r = runReporting([{ ok: false, output: lost, measured: true, drew: false }, { ok: true }]);
+ expect(r.ok).toBe(true);
+ expect(r.attempts).toBe(2);
+ });
it('a run whose engine could not draw has measured nothing', () => {
const broke = 'Framebuffer is incomplete! (size: 640x480, GL error 0x37442)';
expect(engineCouldNotDraw(broke)).toBe(true);