From f80df5e085f6f06f5bb0e12a1c035c3ce12af958 Mon Sep 17 00:00:00 2001 From: meleki Date: Sun, 13 Sep 2026 18:00:51 +0200 Subject: [PATCH] Shaders: fingerprint without node positions, compile counter hook; 760 checks (#65) --- Development.md | 4 ++-- Shaders.md | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Development.md b/Development.md index 915a848..a87b211 100644 --- a/Development.md +++ b/Development.md @@ -12,7 +12,7 @@ npm run check # typecheck + lint + format:check + tests, the gate CI runs # code is lost (tail's is reported), so a red run reads as green npm run build # writes dist/ and regenerates index.html ./build.sh # the same under `set -o pipefail`, for callers that pipe the output -node tools/seed-e2e.mjs && node tools/e2e.mjs # 758 editor checks, screenshots in /tmp/gm-e2e-*.png +node tools/seed-e2e.mjs && node tools/e2e.mjs # 760 editor checks, screenshots in /tmp/gm-e2e-*.png GM_STEPS=20 node tools/e2e.mjs # or 1-12, or 6,20 — a subset while working on one step ./e2e.sh start [GM_STEPS] # the same run detached, see below ./e2e.sh status # live progress, or the last run's result @@ -151,4 +151,4 @@ widths to find click points. The **render device is not in this repo** — `/dev and a 1 GB `/dev/shm` come from `container.options` in the runner's own `config.yaml`, which applies to every job on that runner. Without them chromium falls back to llvmpipe, which gets WebGL 1.0 only. Measured in the job container: `ANGLE (Intel, Vulkan 1.3.230, HD Graphics 630)`, -WebGL 2.0, and the same 758 checks as here. +WebGL 2.0, and the same 760 checks as here. diff --git a/Shaders.md b/Shaders.md index 3cc1fa5..3f6df70 100644 --- a/Shaders.md +++ b/Shaders.md @@ -150,7 +150,10 @@ quad has four corners and stays a quad (#79 is the vertex-side step that would c fragment (every node reachable from the Output becomes one local per output, in dependency order; every Property a `uniform float u_`), `src/viewport/shaders.ts` wraps the result in a Pixi `Shader` for the sprite's mesh (`GraphShader`, with a vertex stage of its own) and -`src/viewport/ShaderLibrary.ts` caches the compiled graph per asset. A sprite's picture is a `Mesh` +`src/viewport/ShaderLibrary.ts` caches the compiled graph per asset, keyed by a fingerprint of what +the fragment depends on — node ids, types, params, declared ports, and which port feeds which — so +moving, collapsing or folding compiles nothing again; a changed param or link does, once +(`__gm.shaderCompiles()` counts it for the checks). A sprite's picture is a `Mesh` (a unit quad sized by its scale, `symbols.ts`), a sibling of the sprite's `Graphics` node under the same parent: Pixi 8 lets only plain containers have children, and the node keeps just the hit area. Two Pixi facts the code leans on: a mesh's texture is bound only for Pixi's own shader, so