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(gates): a runner with no GPU says so in minutes, not in an hour

esengine589a35800db7
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index a32535c54..d3ee9cbae 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -370,11 +370,18 @@ jobs:
- uses: ./.github/actions/render-host
- # Electron's own bundled SwiftShader: the runner installs no Vulkan driver,
- # and it is the adapter the tier passes on locally.
+ # A software Vulkan driver, because the runner ships no driver at all. The
+ # bundled-SwiftShader adapter is what the tier passes on locally, and on this
+ # runner it took the GPU process down at frame 0 in every scene of every run
+ # this job has ever had — a device created and then lost as "destroyed", with
+ # the GL fallback dead behind it. lavapipe is a real ICD for the loader to
+ # find, which is what an empty adapter asks it to do.
+ - name: Software Vulkan for the second backend
+ run: sudo apt-get update && sudo apt-get install -y libvulkan1 mesa-vulkan-drivers
+
- name: Second backend, PR tier
env:
- ESTELLA_VERIFY_WEBGPU_ADAPTER: swiftshader
+ ESTELLA_VERIFY_WEBGPU_ADAPTER: ''
run: node tools/verify-render.mjs --tier pr --backend webgpu --no-build --budget 45
# The native runtime, judged by pixels on a machine with no GPU.
diff --git a/tools/verify-render.mjs b/tools/verify-render.mjs
index b7bab9dda..765cfbb50 100644
--- a/tools/verify-render.mjs
+++ b/tools/verify-render.mjs
@@ -135,8 +135,17 @@ const failed = [];
const unmeasured = [];
const startedAt = Date.now();
let retried = 0;
+// A runner with no GPU for this backend fails every scene the same way, six
+// attempts apiece — an hour to say nothing, with the rest blamed on the budget.
+// Once this many have died with it down and none has drawn, no scene can change it.
+const DEAD_GPU_GIVE_UP = 3;
+let deadInARow = 0;
+let drewSomething = false;
+let noGpu = false;
for (const [index, scene] of scenes.entries()) {
- if (BUDGET_MS && Date.now() - startedAt >= BUDGET_MS) {
+ const outOfBudget = BUDGET_MS && Date.now() - startedAt >= BUDGET_MS;
+ noGpu = !drewSomething && deadInARow >= DEAD_GPU_GIVE_UP;
+ if (outOfBudget || noGpu) {
for (const rest of scenes.slice(index)) unmeasured.push(rest.id);
break;
}
@@ -158,7 +167,8 @@ for (const [index, scene] of scenes.entries()) {
);
run = attempt;
}
- if (!run.ok) failed.push(scene.id);
+ if (run.ok) drewSomething = true; else failed.push(scene.id);
+ deadInARow = run.gpuDied ? deadInARow + 1 : 0;
console.log(`${run.ok ? '✓' : '✗'} ${scene.id.padEnd(28)} ${seconds(run.ms).padStart(7)} `
+ `${run.gpuDied ? deadGpuVerdict('the scene') : run.verdict}`);
if (!run.ok) {
@@ -172,7 +182,10 @@ console.log(`\nrender ${TIER}: ${measured - failed.length}/${measured} scene(s)
+ (retried ? `, ${retried} measured twice (the GPU had died)` : ''));
if (failed.length) for (const id of failed) console.log(` ✗ ${id}`);
if (unmeasured.length) {
- console.log(`\nthe ${BUDGET} minute budget ran out: ${unmeasured.length} scene(s) never ran`);
+ console.log(noGpu
+ ? `\nthe runner never gave ${BACKEND} a GPU: ${measured} scene(s) died with it down and `
+ + `${unmeasured.length} were not run — this is a verdict about the RUNNER, not the engine`
+ : `\nthe ${BUDGET} minute budget ran out: ${unmeasured.length} scene(s) never ran`);
for (const id of unmeasured) console.log(` · ${id}`);
}
if (failed.length || unmeasured.length) process.exit(1);