From 35a8bbba50687bd0a68599e1d18566428fbd2f9a Mon Sep 17 00:00:00 2001 From: AlexZ005 Date: Thu, 1 Oct 2026 00:24:04 +0300 Subject: [PATCH 1/5] [feat] perf probe: the roadmap-31 performance table for the seven games - scripts/perf-games.cjs: per game, a fresh page installs the game's modules from their real zips, loads its real .tpscene through the Games-tab path (importSessionZip + requestLoadSession) from the scenes repo at a git ref (PERF_SCENES_REF, default preview-1-17) or a directory, presses Play and the game's own HUD Play/Start, then measures 10 s at CPU throttle x4: draw calls + triangles per display frame (every render() pass summed), geometries/textures, a texture-MB estimate, lights and shadow-casting lights/meshes, meshes/instanced/unculled, p50/p95/p99 frame ms and the heap delta. Markdown + JSON into after-31/31-perf/. - --vr walks a fake XR session's left stick forward the whole window (fakeXR.cjs); --profile adds CDP CPU self-time and allocation sampling (collected objects included) per function, top 30 each. - Baseline on 1.17 (Radeon 890M): Waves p50 700 ms, Dungeon Realms ~10 MB/s heap churn, Football 336 calls + 7 lights, Jam Room 910 calls. No behaviour change (a script), so no counterfactual; the table is the artefact. Co-Authored-By: Claude Opus 5.5 (1M context) --- scripts/perf-games.cjs | 419 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 419 insertions(+) create mode 100644 scripts/perf-games.cjs diff --git a/scripts/perf-games.cjs b/scripts/perf-games.cjs new file mode 100644 index 00000000..01300c51 --- /dev/null +++ b/scripts/perf-games.cjs @@ -0,0 +1,419 @@ +#!/usr/bin/env node +// 31-perf P0 — THE PERF PROBE: the roadmap-31 Performance-protocol table for the seven +// Games-tab games, measured the same way every time so a before/after means something. +// +// node scripts/perf-games.cjs [--label baseline-1.17] [--only waves,football] [--vr] +// [--seconds 10] [--throttle 4] [--out ] +// +// Per game, on a FRESH page against a running dev server (APP_URL, default this lane's +// https://theprototype.app:5263/): +// 1 install the game's modules from their REAL zips (the sibling modules checkout, or +// PERF_MODULES_DIR), through the Modules manager's own zip input +// 2 load the game's REAL .tpscene through the Games-tab path (`importSessionZip` + +// `requestLoadSession`, what `sceneTemplates.loadRemoteScene` runs) — read from the +// scenes repo at a git REF (PERF_SCENES_REF, default `preview-1-17`: the games as 1.17 +// ships them) or a directory (PERF_SCENES_DIR) +// 3 press the real Play button, then the game's own HUD Play/Start button when it has one +// (else the shell is set to `playing`), and with `--vr` a fake XR session walks the left +// stick forward the whole time (tests/e2e/fakeXR.cjs — the real per-frame VR path) +// 4 settle 2 s, then CPU-throttle x4 (CDP `Emulation.setCPUThrottlingRate`) for the +// measured window and record: every render() call's draw calls + triangles (summed per +// display frame), every rAF frame's duration, and the JS heap before/after +// 5 read the scene: geometries/textures (renderer.info.memory), a texture-MB estimate +// (unique textures, w*h*4 x 4/3 for mips), lights, shadow-casting lights, shadow-casting +// meshes, meshes / instanced meshes / meshes with frustumCulled off, shader programs +// +// Writes `perf-