From fe3c63c48cc1506d01d64608630354803a50b3ad Mon Sep 17 00:00:00 2001 From: root Date: Thu, 10 Sep 2026 16:00:28 +0200 Subject: [PATCH] Collapse Tetris' variable clusters, and give the long runs a home Next move held four clusters of Set variable in a row, fourteen single nodes in all; clear-lines read three variables one after the other. They are now one plural node each, which takes Next move 40 -> 30 nodes and clear-lines 25 -> 23. Every remaining single node was checked and really is single: ok/no are the same variable in opposite branches, take/keep the same one across a write, and the three key setters hang on three different events. Two contracts carry those merges, both pinned as tests. Set variables writes per port with writeTyped exactly as the singular node does, so a Pack{rot} still merges instead of overwriting - without it, turning would have erased the other three fields. And the interpreter collects every input before the node runs, so no input may come from a variable the same node writes; a data node is evaluated once per pulse and keeps its answer. That second rule is invisible in the game, because OnUpdate re-reads each frame and heals it, so it lives in a unit test rather than in the smoke. /opt/node22 and /opt/npm are gone from the tree. build.sh ran into the empty path once they were moved away; the other seven mentions were documentation. e2e.sh and check.sh replace the bare npm calls. A long run does not survive the end of its shell - four full e2e runs died mid-suite with oom_kill 0 - so e2e.sh start hands the run to a transient game-maker-e2e.service, which does. e2e.sh status reports the running job or the last result, and calls a log without a closing line ABORTED rather than reporting the passes it got to. Both scripts end on an explicit exit line, because set -o pipefail inside a script does not protect the caller: measured, ./check.sh | tail still reports 0. Logs carry a timestamp and land in logs/, which is ignored. Co-Authored-By: Claude Opus 5 --- .gitignore | 1 + README.md | 29 +- build.sh | 2 +- check.sh | 11 + e2e.sh | 109 ++++++ tests/core/variable-ports.test.ts | 84 +++++ .../done/tetris-mit-structs-neu-bauen.md | 46 +++ todo-notes/node-collapse.md | 1 + todo-notes/tetris-mit-structs-neu-bauen.md | 2 - tools/e2e.mjs | 2 +- tools/seed-e2e.mjs | 2 +- tools/seed-jumprun.mjs | 2 +- tools/seed-tetris.mjs | 321 ++++++++---------- tools/smoke-jumprun.mjs | 2 +- tools/smoke-tetris.mjs | 8 +- 15 files changed, 439 insertions(+), 183 deletions(-) create mode 100755 check.sh create mode 100755 e2e.sh create mode 100644 todo-notes/done/tetris-mit-structs-neu-bauen.md create mode 100644 todo-notes/node-collapse.md delete mode 100644 todo-notes/tetris-mit-structs-neu-bauen.md diff --git a/.gitignore b/.gitignore index 47d118f5..41501c38 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ data/projects/*.tmp # Uploaded images are user data like the projects: content-addressed, written by the API, # reproducible only by uploading them again. data/textures/ +logs/ .DS_Store diff --git a/README.md b/README.md index 8362612b..bc5d29e2 100644 --- a/README.md +++ b/README.md @@ -575,7 +575,7 @@ and reasons, not what the code does: a `/** */` on every export whose name does ## Development -Node 22 is required (on this machine: `PATH=/opt/node22/bin:$PATH`). +Node 22 is required (`/usr/bin/node`, in the default PATH). ```bash npm install @@ -585,10 +585,14 @@ npm run typecheck npm run lint # ESLint, type-aware; --fix for the fixable half npm run format # Prettier over src, tests and tools npm run check # typecheck + lint + format:check + tests, what CI would run +./check.sh # the same, ending in `=== CHECK EXIT n ===`: piped into `tail` npm's exit + # code is lost (tail's is reported), so a red run reads as green npm run build # writes dist/ and regenerates index.html export GM_REMOTE=user@host # optional: run the browser elsewhere; see below -node tools/seed-e2e.mjs && node tools/e2e.mjs # 456 editor checks, screenshots in /tmp/gm-e2e-*.png +node tools/seed-e2e.mjs && node tools/e2e.mjs # 465 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 node tools/seed-jumprun.mjs && node tools/smoke-jumprun.mjs # 24 checks: the example game, played end to end node tools/seed-tetris.mjs && node tools/smoke-tetris.mjs # 19 checks: the Tetris example, played end to end ``` @@ -606,6 +610,17 @@ four cores of this box (60% renderer, 18% GPU process, load ~1.0), which it carr step is being worked on, `GM_STEPS` keeps a run to seconds – take the whole suite before a commit, or when a change touches drawing, the widget toolkit or anything else every step sees. +**`./e2e.sh start` runs the suite detached**, in a transient `game-maker-e2e.service`, and returns at +once; output goes to `logs/e2e-_