From 40a0eaf6d98c61f54f8efcba02ba805e7d77dd14 Mon Sep 17 00:00:00 2001 From: Daniel McCoy Stephenson Date: Wed, 28 Oct 2026 01:54:35 -0600 Subject: [PATCH 1/2] Load the browser page behind Strata's loading shell The page used to show "Loading env-lib-cpp on Strata..." while the engine downloaded. It now loads behind the Strata web kit's loading shell (strata-loader.js, vendored at Strata 901e6c9 with its PIN, SHA256SUMS, LICENSE and update.sh): the /play trailer's first frame as a blurred backdrop, in the page's colours, and byte-accurate progress with the size. The loader streams envlib-strata.wasm and hands the bytes to the engine, so nothing downloads twice. When the view can't run (no WebGL 2, the renderer fails, the engine stops, a lost WebGL context does not come back) the shell plays the trailer and says why; under prefers-reduced-motion it shows the still. A device drawing under 12 frames a second is offered the clip without losing the live view; that watch is skipped in automated browsers and ?bench runs. strata/web/strata-boot.js bridges this classic (non-MODULARIZE) build to the loader: emcc's script tag is kept inert in a template, the bridge starts it, and the engine waits in Module.instantiateWasm for the loader's bytes. After each link strata/web/strata_page.cmake puts the loader and the bridge inline in the page, so the site is still the same four files, and stamps the download's size, since the arcade compresses on the fly with no Content-Length. The smoke test now checks that the shell finishes, and that without WebGL 2 it says why and downloads nothing of the engine. drafted by Claude on behalf of Daniel Stephenson Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01LYNeuo5Ry76i84tz6WXQSE --- docs/STRATA.md | 20 ++ strata/CMakeLists.txt | 10 + strata/web/shell.html | 29 ++- strata/web/smoke/smoke.cjs | 31 +++ strata/web/strata-boot.js | 180 +++++++++++++ strata/web/strata-kit/LICENSE | 21 ++ strata/web/strata-kit/PIN | 1 + strata/web/strata-kit/SHA256SUMS | 2 + strata/web/strata-kit/strata-loader.js | 341 +++++++++++++++++++++++++ strata/web/strata-kit/update.sh | 19 ++ strata/web/strata_page.cmake | 47 ++++ 11 files changed, 699 insertions(+), 2 deletions(-) create mode 100644 strata/web/strata-boot.js create mode 100644 strata/web/strata-kit/LICENSE create mode 100644 strata/web/strata-kit/PIN create mode 100644 strata/web/strata-kit/SHA256SUMS create mode 100644 strata/web/strata-kit/strata-loader.js create mode 100755 strata/web/strata-kit/update.sh create mode 100644 strata/web/strata_page.cmake diff --git a/docs/STRATA.md b/docs/STRATA.md index ce20091..27b7a29 100644 --- a/docs/STRATA.md +++ b/docs/STRATA.md @@ -155,6 +155,26 @@ text. `?bench=30` runs for 30 seconds. Nothing is sent anywhere. CI that a run finishes and shows its card on both profiles (it keeps no numbers: headless Chromium draws on the CPU). +### The loading shell + +The page loads behind the Strata web kit's loading shell +(`strata/web/strata-kit/strata-loader.js`, vendored from Strata at the commit in +`strata/web/strata-kit/PIN`; `strata/web/strata-kit/update.sh ` re-vendors it). It shows +the trailer's first frame (the one on ) as a blurred backdrop and real progress with the size ("0.5 of 1.3 MB"). The loader streams +the `.wasm` and hands its bytes to the engine, so nothing downloads twice. If +env-lib-cpp can't run (no WebGL 2, the renderer fails, the engine stops, a lost +WebGL context does not come back), the shell says why, and plays the trailer instead (the still under `prefers-reduced-motion`). +A device that draws under 12 frames a second is offered the clip without +losing the game (not in automated browsers or `?bench` runs). + +`strata/web/strata-boot.js` bridges this classic (non-`MODULARIZE`) build to the +loader: emcc's script tag sits inert in `