From cbb7c9f53d412c305bd70bb5db0158d1b95f7f90 Mon Sep 17 00:00:00 2001 From: Ben Stull Date: Tue, 23 Jun 2026 09:55:35 -0700 Subject: [PATCH] feat(sim): Right axis = deterministic real-time painterly dream MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the pre-baked SD restyle variants (too fluid — the painting re-rolled every keyframe and the flow-warp melted frames) with a deterministic, real-time dream that holds STILL across the loop; only the footage's own motion moves. Design: docs/superpowers/specs/2026-06-22-right-axis-deterministic-dream-design.md Engine (player/alteration.py): Restyle(variant) -> Dream(strength, intensity); Calibration.right_variant_map -> dream_gain. player/state.py: a Right change is a LIVE_UPDATE now, not a crossfade (only a clip swap crossfades). Plan dict restyle -> dream. Tests migrated; 233 green. (No new Python behavior for the client-render swap below.) Renderer (simulator front-end): the Right dream is a WebGL2 Kuwahara shader on a over the live video — edge-preserving, so motion/structure stay crisp; the dream is the same footage, just stylized (no blur). Ramped by the knob; max goes "trippy" (vivid saturation + ~45deg hue drift + posterize, concentrated near max via t=intensity^2). Phase-1 luminous-haze (CSS+bloom) was built then retired by eye (blur read as out-of-focus video). Mood grade rides as a CSS filter on the canvas; bloom layer removed. Dev ergonomics that fell out of the iteration: - /dev/version + a 1s client poll = live-reload (open tab never runs stale renderer code; reloads on my edits AND server restarts). - no-cache on the dev server; an on-screen error banner + crash-proof render so a silent throw can't masquerade as "nothing is changing". Co-Authored-By: Claude Opus 4.8 (1M context) --- ...2-right-axis-deterministic-dream-design.md | 109 +++++++++ player/alteration.py | 66 +++--- player/state.py | 12 +- simulator/app.py | 31 ++- simulator/static/app.js | 215 +++++++++++++++--- simulator/static/index.html | 1 + simulator/static/style.css | 6 + tests/test_player_alteration.py | 41 ++-- tests/test_player_state.py | 10 +- tests/test_simulator_api.py | 5 +- 10 files changed, 404 insertions(+), 92 deletions(-) create mode 100644 docs/superpowers/specs/2026-06-22-right-axis-deterministic-dream-design.md diff --git a/docs/superpowers/specs/2026-06-22-right-axis-deterministic-dream-design.md b/docs/superpowers/specs/2026-06-22-right-axis-deterministic-dream-design.md new file mode 100644 index 0000000..2ac9a89 --- /dev/null +++ b/docs/superpowers/specs/2026-06-22-right-axis-deterministic-dream-design.md @@ -0,0 +1,109 @@ +# Right axis as a real-time deterministic dream + +**Status:** built (session 0013, 2026-06-22) — Phase 1 superseded by Phase 2 in the +same session after by-eye review (the haze "looked like blurred video, not stylized"). +The shipped Right dream is the **Phase 2 painterly** path. +**Surface:** simulator preview (`simulator/`, `player/alteration.py`) +**Supersedes:** the "discrete pre-baked, flow-stabilized restyle variant" definition +of the Right axis in the machine-altered-perception design SPEC §4.1 — a deliberate +change to a core decision (see Why). + +## Why + +The pre-baked SD img2img variants (`bake_right_variants.py`) are **too fluid**: the +painting re-rolls every keyframe (~2 s) and the optical-flow tween warps frames into +each other, so across the loop the dream churns and melts. The right brain should be +a **still altered state** — a calm, holistic counterpart to the busy, accreting +analytical Left — not a restless morph. + +## Concept + +The Right knob no longer selects a pre-baked variant. It drives a **deterministic, +real-time filter** applied live to the base footage, scaled 0→4. The same filter runs +every frame, so the look is **stable by construction** — locked to scene content, +moving only where the footage already moves. Bonus: no baked variant videos to ship, +which simplifies the eventual hardware (Pi) story. + +Staged delivery (both built this session; Phase 2 is what shipped): +- **Phase 1: luminous haze** — soft-focus, blooming highlights, pastel desaturation. + CSS + a bloom layer. Built, then **retired** by eye: blur reads as *out-of-focus + video*, not stylized, and softens the base's crisp motion. +- **Phase 2: painterly flatten (shipped)** — a WebGL2 **Kuwahara** shader on a + `` restyling the live video frames. Edge-preserving, so motion/structure + stay as crisp as the source — the dream is the same footage, just stylized. No blur. + +## Phase 2 — the shipped painterly dream + +- **Renderer:** `` over `