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 pixel gate may not read the display it happens to run on

yhh9117fba42bb2
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 243692068..3453745cd 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -107,6 +107,17 @@ published separately; it ships inside the editor.
carries depth) and linear with layer 1 (capture built with depth) both drew red;
linear with no layer drew green.
+- **A pixel gate's verdict depended on the developer's monitor scaling.** The
+ headless render host never attaches its canvas to a document, so
+ `getBoundingClientRect()` is all zeros and `clientToScreen` reduces to
+ `client * devicePixelRatio` — the machine's own display scale. At Windows' 150%
+ every `ESTELLA_VERIFY_PICK` therefore hit-tested a point 1.5x away from the one
+ it named and answered null: `mesh-assign` and `view-orbit` were red on one
+ machine and green on another, about nothing either of them is testing. The host
+ forces `device-scale-factor` to 1 for the same reason it already forces the
+ colour profile to sRGB — a gate may not read the display it happens to run on.
+ The pr tier is 69/69 on WebGL2 and 68/68 on WebGPU with this.
+
- **The last gate still asserting the old work-plane rule.** `editor-grid-edge-on`
held that a head-on perspective eye works a plane it lies IN, so the grid has no
picture at all. "The view works on a plane it can see" replaced that rule — a
diff --git a/desktop/scripts/headless-verify.mjs b/desktop/scripts/headless-verify.mjs
index 54eaa5509..49ab58e0e 100644
--- a/desktop/scripts/headless-verify.mjs
+++ b/desktop/scripts/headless-verify.mjs
@@ -71,6 +71,13 @@ app.commandLine.appendSwitch('disable-gpu-sandbox');
// for a human). The pixel assertions do not: a composited read is colour
// managed, turning rgb(0,255,0) into rgb(58,254,32) switch or no switch.
app.commandLine.appendSwitch('force-color-profile', 'srgb');
+// ...and the same reason for the SIZE of a device pixel. The headless canvas is
+// never attached to a document, so its bounding rect is all zeros and a client
+// coordinate reaches the hit test as `client * devicePixelRatio` — the developer's
+// own monitor scaling. At Windows' 150% every ESTELLA_VERIFY_PICK landed 1.5x away
+// from the point it named and answered null, so two gates were red on one machine
+// and green on another, about nothing.
+app.commandLine.appendSwitch('force-device-scale-factor', '1');
// WebGPU: the unsafe flag covers non-default platforms (Linux CI); the optional
// software adapter (ESTELLA_VERIFY_WEBGPU_ADAPTER=swiftshader) gives GPU-less
// runners a real Dawn adapter through the bundled SwiftShader Vulkan — the