From ed5a4379dbcd8beacde499f5c3a5fd8b2f0cfffa Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Thu, 21 May 2026 20:33:49 +0100 Subject: [PATCH] Optimise --- .forgejo/workflows/deploy.yml | 15 +- README.md | 4 +- eslint.config.js | 2 +- index.html | 20 +- package.json | 12 +- public/manifest.webmanifest | 5 + src/audio/garden-audio-config.ts | 24 +- src/audio/garden-audio-input.ts | 5 +- src/audio/garden-audio.ts | 3 +- src/audio/generative-piano-tuning.ts | 36 +- src/audio/generative-piano.ts | 24 +- src/audio/piano-sampler.ts | 20 +- src/config.ts | 7 +- src/config/default-settings.ts | 2 +- src/config/normalize-runtime-settings.ts | 46 +++ src/config/runtime-controls.ts | 36 +- src/config/types.ts | 17 +- src/config/vibe-presets.ts | 311 +++++++++++------- src/consts.ts | 3 - src/game-loop/agent-population.test.ts | 166 ++++++++++ src/game-loop/agent-population.ts | 153 ++++++--- src/game-loop/export-snapshot-renderer.ts | 6 +- src/game-loop/game-loop-resources.ts | 20 +- src/game-loop/game-loop.ts | 36 +- src/game-loop/gpu-profiler.ts | 35 +- src/game-loop/intro-title-agents.ts | 21 +- src/game-loop/perf-stats-overlay.ts | 3 +- src/game-loop/pointer-input.ts | 14 +- src/game-loop/simulation-textures.ts | 19 +- src/game-loop/toolbar-contrast-monitor.ts | 5 +- src/index.ts | 61 ++-- src/page/audio-control.ts | 40 +-- src/page/config-pane.ts | 103 ++---- src/page/eraser-size-control.ts | 36 +- src/page/full-screen-handler.ts | 20 +- src/page/mirror-segment-control.ts | 38 +-- src/page/palette-control.ts | 30 +- src/page/splash-screen.ts | 17 +- src/pipelines/agents/agent-dispatch.ts | 17 +- .../agent-generation/agent-compaction.wgsl | 47 ++- .../agent-generation-pipeline.ts | 53 ++- .../agents/agent-generation/agent-resize.wgsl | 2 +- .../agents/agent-generation/agent-schema.wgsl | 2 +- src/pipelines/agents/agent-limits.ts | 43 ++- src/pipelines/agents/agent-pipeline.ts | 37 +-- src/pipelines/agents/agent.wgsl | 82 +---- src/pipelines/brush/brush-pipeline.ts | 13 +- src/pipelines/brush/brush.wgsl | 21 +- src/pipelines/common-state/common-state.ts | 18 +- src/pipelines/common/line-segment.wgsl | 7 +- src/pipelines/diffusion/diffuse.wgsl | 106 +++--- src/pipelines/diffusion/diffusion-pipeline.ts | 22 +- src/pipelines/eraser/eraser-agent-pipeline.ts | 26 +- src/pipelines/eraser/eraser-agent.wgsl | 8 +- .../eraser/eraser-texture-pipeline.ts | 20 +- src/pipelines/eraser/eraser-texture.wgsl | 4 +- src/pipelines/render/render-pipeline.ts | 47 +-- src/pipelines/render/render.wgsl | 61 +--- src/pipelines/texture-formats.ts | 2 + src/settings.ts | 65 +++- src/style/_app-shell.scss | 8 +- src/style/_config-pane.scss | 33 +- src/style/_loading.scss | 38 ++- src/style/toolbar/_buttons.scss | 6 +- src/style/toolbar/_garden-controls.scss | 2 +- src/style/toolbar/_layout.scss | 2 +- src/style/toolbar/_responsive.scss | 4 +- src/style/toolbar/_shared.scss | 3 +- src/utils/delta-time-calculator.ts | 11 +- src/utils/dom.ts | 37 --- .../graphics/cached-buffer-write.test.ts | 38 +++ src/utils/graphics/cached-buffer-write.ts | 40 ++- src/utils/graphics/initialize-context.ts | 12 +- src/utils/graphics/noise.ts | 25 +- src/utils/graphics/resizable-texture.ts | 16 +- vite.config.ts | 13 +- 76 files changed, 1418 insertions(+), 988 deletions(-) create mode 100644 src/config/normalize-runtime-settings.ts create mode 100644 src/game-loop/agent-population.test.ts create mode 100644 src/pipelines/texture-formats.ts create mode 100644 src/utils/graphics/cached-buffer-write.test.ts diff --git a/.forgejo/workflows/deploy.yml b/.forgejo/workflows/deploy.yml index 0c52ecd..3bb5949 100644 --- a/.forgejo/workflows/deploy.yml +++ b/.forgejo/workflows/deploy.yml @@ -29,18 +29,15 @@ jobs: npm ci npx playwright install --with-deps chromium - - name: Lint - run: npm run lint:check - - - name: Typecheck - run: | - npm run unused:check - npm run typecheck - npm run typecheck:e2e - - name: Test run: | + npm run lint:check + npm run typecheck + npm run typecheck:e2e npm test + + - name: Test E2E + run: | npm run test:e2e - name: Upload Playwright report diff --git a/README.md b/README.md index 77909bc..ec6f5d7 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,6 @@ Check out the [agent logic](./src/pipelines/agents/agent.wgsl). ## Testing - `npm test` runs the Vitest unit suite. -- `npm run test:e2e` builds the production bundle and runs the Playwright Chromium - smoke test. +- `npm run test:e2e` runs the Playwright Chromium smoke test. The Playwright + config builds the production bundle before serving it. - `npx playwright install chromium` installs the local browser binary when needed. diff --git a/eslint.config.js b/eslint.config.js index d6ef9c4..db8b127 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,7 +1,7 @@ import js from '@eslint/js'; -import tseslint from 'typescript-eslint'; import prettierConfig from 'eslint-config-prettier'; import globals from 'globals'; +import tseslint from 'typescript-eslint'; export default tseslint.config( { diff --git a/index.html b/index.html index 25ae55e..fadc28f 100644 --- a/index.html +++ b/index.html @@ -88,14 +88,14 @@
-
+

Fleeting Garden

Tend it while you can. The garden returns to weather either way.

-