Chrome draws no frames for a hidden page, so the scene stopped asking
for its videos. The sweeper of the VideoLibrary kept running and
dropped every player after 2 s. Back in the window, the video started
over, and Pixi warned that a texture source was destroyed while still
bound to a shader.
- The sweeper skips a hidden page. The time hidden does not count as
idle, the 2 s start once the page is shown again.
- A dropped player only unloads its video source instead of destroying
it. A shader that still holds the source no longer warns.
- CI serves videos through a new router for php -S. The built-in
server answers no Range requests, so Chrome could not seek. e2e 66
had 4 red checks in the suite job of d48f174 because of it. nginx on
stein2 hid this.
Tests:
- Unit video-library.test.ts (new): 3 tests
- e2e 66 (atx): ALL PASSED, 18 checks
- Router checked with curl: 206 with the right bytes
- Counter-check: the old sweep fails both hidden-page tests
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A video becomes an asset like a sound: uploaded once, converted to one
format by a worker of its own, cut into clips in its tab, and worn by a
sprite through its Texture row. Only Chrome is a target, without alpha.
- Server: POST ?r=videos queues the upload under the hash of its bytes,
so the MP4's name is known at once. The worker (VideoWorker over
VideoFormat) writes H.264/AAC, yuv420p, constant frame rate, a
keyframe every 15 frames, at most 1920x1080, with a poster and the
details beside it. A failed job says why and is tried again on the
next upload.
- An upload may be up to 2 GB. It is streamed from the request to disk
and hashed there, so php-fpm holds none of it in memory. The other
routes keep their 256 MB.
- The worker runs in the container game-maker-video on stein2, a
compose project of its own (tools/video/), and in CI beside the PHP
server. The CI image has ffmpeg for it.
- Model: asset type video with size, length, frame rate and sound, and
clips like a sound's. The clip helpers and commands serve both.
- A sprite's Texture row offers videos and clips after the pictures.
resolvePicture names a playing video by a key, and the texture library
hands it to a VideoLibrary with one player per key.
- The editor shows a placed video as a quiet preview. Play starts it
over at its clip's start and lets it be heard through the master bus,
a pause holds it, Esc makes it quiet again.
- Video tab: the picture, a ruler, the clip strip and a track on the
Sound tab's time axis. A drag spans a clip, a handle moves an edge,
Play plays the picked clip.
- The picker shows a video on its way with its progress and adopts an
upload from it once it is ready. Dropping a video file does the same.
Decided on my own:
- Two sprites wearing the same clip share one player and show the same
picture. Control per instance belongs to the follow-up with nodes.
- A video plays in real time, the game's time scale does not slow it.
- The container may use 3 of the 4 cores of stein2.
Findings:
- The first real upload (279 MB) got 413: the API's own ceiling of
256 MB for every request, not nginx or the Brandmauer.
- Chrome has no picture of a video that never played, and a Pixi
VideoSource drawn before the first frame stays empty for good. The
texture is made in the first frame callback (openVideo).
- A player nobody asks for in 2 s is let go. The inspector's PREVIEW
asked only on an edit, so with the sprite not on screen its texture
was destroyed under it and the batcher threw on every frame. The
preview now redraws every frame while it shows a video, like a Time
shader. A let-go texture keeps an empty source instead of none.
- VideoSource.load() reloads the element and cuts off an earlier
play(). Playing starts after loadeddata.
Tests:
- PHP videos.test.php: 68 checks, with the real ffmpeg
- 300 MB upload through Brandmauer and nginx: 201 in 21 s, php-fpm at
13.7 MB RSS at most
- Unit videos.test.ts: 20 tests
- e2e 66 (stein2, atx was off): ALL PASSED, 18 checks; e2e 04 with the
new asset count green
- Gate (atx): 294 files, 4520 tests. serialize.test.ts used video as
its example of an unknown type and now uses a made-up one.
- Counter-checks: a keyframe gap of 30 fails the PHP check, a key that
keeps the video's end fails 2 unit tests, a clip without its end
fails "plays only its stretch" in e2e 66
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
stein2 should stop carrying the full e2e run. The new runner lives in
the WSL2 distro game-maker-ci on melektaus-atx and uses the same image
and fonts. Its GPU sits behind /dev/dxg and Mesa's d3d12 driver, which
headless chromium cannot reach, so the harness gets a second way to
start the browser.
- GAME_MAKER_BROWSER=wsl starts an invisible Xvfb and an X11 chromium
on ANGLE/GL. Without the variable, stein2 keeps the headless Vulkan
launch exactly as before.
- The harness logs the renderer and stops on software rendering.
Under WSL a missing d3d12 driver falls back to llvmpipe, which still
offers WebGL 2 and would pass unnoticed.
- The CI image gains xvfb. The font set is unchanged: fc-list gives
the same 149 fonts with the same hash.
- ci.yml runs both jobs on the new label game-maker-wsl. The stein2
runner keeps game-maker-ci, so moving back is one line per job.
Findings:
- Wayland on weston reached the GPU too, but drew at about 40 fps and
let the editor clock stall in long runs (GM_STEPS=1-17: 2 failed).
- Vulkan through a self-built dzn caps ANGLE at ES 2.0 because
VK_EXT_provoking_vertex is missing, so chromium drops the GPU.
- The flaky check in e2e 41 (#282) fails more often under WSL: two of
three solo runs were red.
Tests:
- ./check.sh: 195 files, 2823 tests passed
- WSL container, GM_STEPS=1-17: ALL PASSED, 553 checks
- WSL container, full run: 1589 of 1590, the one FAIL is #282
- WSL container, smokes: 24 / 19 / 21 checks
- stein2 headless, e2e 39+40: ALL PASSED, 100 checks
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Until now every account could do the same, and managing accounts
meant running make-user.php on the server. Accounts now carry a role,
and admins get a tab in the editor to create, rename, re-role, reset
and delete accounts. Both issues share the same server files, so they
land in one commit.
#180 Roles:
- Every account is admin or user. A missing or unknown role counts as
user, on the server and in the client.
- auth/session and auth/login return {user, role}.
- Auth::requireAdmin() answers everyone else with 403.
- make-user.php takes the role as a third argument. Without it an
existing account keeps its role, so a password reset from the CLI
never demotes an admin.
- Admins see and save other users' projects like their own. Saving
keeps the original owner.
#179 User management:
- The account menu gets "User management" (admins only) and "Plugins"
(everyone). Both open the same closable tab, accounts on top and
plugins below. The fixed Plugins tab is gone.
- Per account: Rename, Role, Password (no old password needed) and
Delete with a confirmation. "New user..." creates one.
- Each account lists its projects with an Open button.
- Delete is refused while the account still owns projects.
- Renaming moves the projects along and ends every session of the
account. transfer takes the same lock as save.
- On their own row an admin can only set the password. The last admin
cannot be demoted or deleted. The server enforces both.
- The account rules live in AccountRules.php and accountRules.ts as
pure functions, so they are testable without a server.
Findings:
- At 1280 px the Delete button reached past the column edge and was
not clickable. The name column is flexible now, and module 49 checks
the layout.
- The server lets an admin delete other users' projects, but the
editor has no button for it yet. Left open in the issue.
Tests:
- ./check.sh: 148 files, 2214 tests, exit 0 (was 147 / 2204).
- New tests/php/accounts.test.php, 51 checks, plain PHP. CI runs it
as its own step in the gate job, the host has no PHP.
- New e2e module 49 with 18 checks. CI creates the e2e-admin account
in serve.sh. Modules 14, 38, 46 and the scaffold follow the new tab.
- e2e 1-16,37,38,45,46,49: all passed, 581 checks.
- Counter-checks: owner on save, admin view, default role and self
delete in PHP fail 7, 5, 5 and 1 checks. Unchecked requireAdmin,
a wider column and the caller as owner each fail exactly their
e2e check.
- Check sum 1314 -> 1333 (+1 in 38, +18 in 49), computed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
game_maker_serve runs project-shells.mjs unconditionally, so running the CI
smoke runner on a development machine overwrote the four project documents
with empty shells: revision 1301 became 1, and the name became the key from
PROJECTS, because the seeders keep whatever name the server already holds.
"Jump and Run" came back as "jumpRun". The shells are only ever needed on a
fresh checkout, where the directory is empty, so an existing file is kept.
The job image (tools/ci/Dockerfile, label game-maker-ci) carries chromium with the Vulkan
drivers, php-cli and the host's fonts; the render device itself comes from the runner's
container.options, so a job container gets the Intel GPU instead of llvmpipe.
tools/ci/serve.sh puts the checkout behind /game-maker/ with php -S and writes the project
shells the seeders need; every tool now takes its server from GAME_MAKER_BASE_URL rather than
from a project id repeated in shell scripts.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>