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): the second backend is measured where there is a GPU to measure it on

esengine78ab8910b9a7
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index d3ee9cbae..8905d8ba4 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -355,11 +355,14 @@ jobs:
# answer is a report rather than a runner killed at the ceiling.
verify-render-webgpu:
name: Render verify (second backend)
- runs-on: ubuntu-latest
+ # macOS, for the GPU. The Linux runner ships no graphics driver, and every run
+ # this job ever had died the same way: the GPU process exiting during init and
+ # requestDevice answering "a valid external Instance reference no longer
+ # exists", with lavapipe installed making no difference. A macOS runner has
+ # Metal, so what this measures is a REAL second implementation rather than a
+ # software one — which is the portability question it was created to ask.
+ runs-on: macos-latest
needs: build-emscripten
- # The runner stops at its own 45-minute budget and prints what it never
- # reached; this is that, plus the one scene it may already be retrying
- # through a dead GPU when the budget runs out.
timeout-minutes: 75
continue-on-error: true
@@ -370,15 +373,8 @@ jobs:
- uses: ./.github/actions/render-host
- # 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
-
+ # The adapter Dawn picks for itself, which here is Metal. `swiftshader` is the
+ # bundled software one, kept as an explicit opt-in for a machine with no GPU.
- name: Second backend, PR tier
env:
ESTELLA_VERIFY_WEBGPU_ADAPTER: ''
diff --git a/tools/renderScenes.mjs b/tools/renderScenes.mjs
index 132baae02..5927b13f8 100644
--- a/tools/renderScenes.mjs
+++ b/tools/renderScenes.mjs
@@ -86,8 +86,10 @@ export const SCENES = [
{ id: "point-shadow", tier: "pr", webgpu: true, env: { ESTELLA_VERIFY_SCENE: "/scenes/point-shadow.esscene", ESTELLA_VERIFY_W: "256", ESTELLA_VERIFY_H: "256", ESTELLA_VERIFY_STEPS: "2", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.167,\"y\":0.5,\"rgb\":[0,0,0],\"tol\":20},{\"x\":0.5,\"y\":0.833,\"rgb\":[0,0,0],\"tol\":20},{\"x\":0.333,\"y\":0.5,\"rgb\":[108,108,108],\"tol\":25},{\"x\":0.833,\"y\":0.5,\"rgb\":[102,102,102],\"tol\":25},{\"x\":0.5,\"y\":0.5,\"rgb\":[242,242,242],\"tol\":20}]" } },
// A SUN WITH A SIZE: its source is infinitely far away, so what it carries is an angle
// and not a length — the penumbra is tan(sourceAngle/2) times how far the caster stands
- // above what it falls on. Its ramp sits one sample step along on the second backend.
- { id: "sun-shadow", tier: "pr", webgpu: { ESTELLA_VERIFY_EXPECT: "[{\"x\":0.62,\"y\":0.5,\"rgb\":[0,0,0],\"tol\":20},{\"x\":0.66,\"y\":0.5,\"rgb\":[39,39,39],\"tol\":30},{\"x\":0.72,\"y\":0.5,\"rgb\":[186,186,186],\"tol\":30},{\"x\":0.85,\"y\":0.5,\"rgb\":[247,247,247],\"tol\":20}]" }, env: { ESTELLA_VERIFY_SCENE: "/scenes/sun-shadow.esscene", ESTELLA_VERIFY_W: "256", ESTELLA_VERIFY_H: "256", ESTELLA_VERIFY_STEPS: "2", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.62,\"y\":0.5,\"rgb\":[0,0,0],\"tol\":20},{\"x\":0.66,\"y\":0.5,\"rgb\":[70,70,70],\"tol\":35},{\"x\":0.72,\"y\":0.5,\"rgb\":[209,209,209],\"tol\":25},{\"x\":0.85,\"y\":0.5,\"rgb\":[247,247,247],\"tol\":20}]" } },
+ // above what it falls on. One expectation for both backends: a real WebGPU driver lands
+ // on the WebGL2 values exactly, and SwiftShader's ramp sits a sample step along, inside
+ // the tolerance either way.
+ { id: "sun-shadow", tier: "pr", webgpu: true, env: { ESTELLA_VERIFY_SCENE: "/scenes/sun-shadow.esscene", ESTELLA_VERIFY_W: "256", ESTELLA_VERIFY_H: "256", ESTELLA_VERIFY_STEPS: "2", ESTELLA_VERIFY_EXPECT: "[{\"x\":0.62,\"y\":0.5,\"rgb\":[0,0,0],\"tol\":20},{\"x\":0.66,\"y\":0.5,\"rgb\":[70,70,70],\"tol\":35},{\"x\":0.72,\"y\":0.5,\"rgb\":[209,209,209],\"tol\":25},{\"x\":0.85,\"y\":0.5,\"rgb\":[247,247,247],\"tol\":20}]" } },
// The same scene with the caster moved DOWN the sun's own ray: its shadow lands where it
// did and the edge sharpens by the ratio of the distances. Two of these four probes
// differ from the gate above by 70 and 38, which a fixed blur could not produce.
diff --git a/tools/verify-render.mjs b/tools/verify-render.mjs
index 765cfbb50..9cc99cc7c 100644
--- a/tools/verify-render.mjs
+++ b/tools/verify-render.mjs
@@ -82,9 +82,10 @@ const scenes = selected.map((s) => ({
...s.env,
...(typeof s.webgpu === 'object' ? s.webgpu : {}),
ESTELLA_VERIFY_BACKEND: 'webgpu',
- // Empty lets the Vulkan loader choose from the ICDs installed; a name it
- // does not recognize is ignored in silence. The boot log says which it got.
- ESTELLA_VERIFY_WEBGPU_ADAPTER: process.env.ESTELLA_VERIFY_WEBGPU_ADAPTER ?? 'swiftshader',
+ // The adapter Dawn picks for itself: a real driver is the only kind that
+ // answers the portability question. `swiftshader` names the bundled software
+ // one, for a machine with no GPU. The boot log says which it got.
+ ESTELLA_VERIFY_WEBGPU_ADAPTER: process.env.ESTELLA_VERIFY_WEBGPU_ADAPTER ?? '',
}
: s.env,
}));