Commit graph

254 commits

Author SHA1 Message Date
monkey-w1n5t0n
4e46036191 feat: add visual preset chips (calm-to-chaotic, rainbow, vortex, spiral, embers) that load predefined examples and trigger training (f12)
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2026-04-07 20:28:17 +02:00
monkey-w1n5t0n
b90a7177fd feat: add training sync/async/loss tests validating VAL-ML-006 through VAL-ML-010 (f11)
17 e2e tests covering thumbsUp example capture, sync train returning
finite loss, training convergence, async train via worker resolving to
finite loss, and loss history population. All existing and new tests pass.
2026-04-07 20:18:16 +02:00
monkey-w1n5t0n
fad057a108 feat: add undo stack with weight/noise restoration, undo button, and randomize/clear examples validation (f10)
- Implement undo stack (max 20 entries) in ML store with pushUndoSnapshot before thumbsDown/randomise
- Add undo() method that restores weights within 1e-4 tolerance and noise level
- Add reactive undoDepthSignal for UI button state tracking
- Add undo button to RLButtons component between thumbs-down and thumbs-up
- Update debug probe with undo method
- Add 17 e2e tests covering VAL-ML-003, VAL-ML-013, VAL-ML-014, VAL-CROSS-007
- Update architecture docs with undo stack and RLButtons details

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2026-04-07 20:10:50 +02:00
monkey-w1n5t0n
1030b07de1 feat: add RL feedback controls with noise ring indicator (f09)
- Add RLButtons component with thumbs-up (+) and thumbs-down (−) buttons
- Thumbs-up adds example, triggers async training, and decays noise
- Thumbs-down changes outputs with spread-aware noise (moveWeights)
- Add noise ring indicator on joystick: border shows noise level
  - No border at noise ≤ 0.01
  - 3px orange border at noise > 0.01 (active)
  - 6px red border at noise > 0.15 (high)
- Wire RLButtons into App.tsx, pass mlStore to Joystick for noise tracking
- CSS matches old playground a-immersive.css noise-ring styling
- 17 new e2e tests covering VAL-ML-011, VAL-ML-012, VAL-JOY-004
- All 121 Playwright tests pass

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2026-04-07 19:53:08 +02:00
monkey-w1n5t0n
68bd756311 feat: add training drawer with dock, buttons, status line, and loss plot (f08)
Build training drawer UI for milestone training-rl:
- Dock component with 6 icons (Train, Mode, Synth, NISPS, FX, Help)
- TrainingDrawer with Add Example, Train, Clear Ex, Clear All, Randomize
- StatusLine showing 'N examples · loss/noise' reactively
- Loss plot canvas with training history visualization
- ML store: add noiseLevel, exampleCountSignal, lastLossSignal, clearAll, addExample
- Debug probe: add clearAll() and getLossHistory() methods
- 22 Playwright e2e tests covering VAL-TRAIN-001 through VAL-TRAIN-009

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2026-04-07 19:37:27 +02:00
monkey-w1n5t0n
f42732fa16 validation: add user-testing round 2 synthesis for ml-core-loop milestone (pass, 10/10 assertions)
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2026-04-07 19:12:41 +02:00
monkey-w1n5t0n
1127c8aac9 fix: default to visual mode (20 outputs) and fix FlowField canvas resize
Change default outputMode from 'synth' to 'visual' in ml-store.ts so
FlowField particles render immediately on page load. Fix FlowField
component canvas initialization: create visualizer in ResizeObserver
callback (after layout) instead of in createEffect (before layout
settles), preventing the default 300x150 canvas size issue. Add window
resize listener as fallback. Update all 13 affected tests to expect 20
outputs (visual mode default) instead of 126 (synth mode).

Unblocks VAL-VIS-001, VAL-VIS-002, VAL-VIS-003.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2026-04-07 19:01:55 +02:00
monkey-w1n5t0n
4e98228531 validation: add user-testing synthesis for ml-core-loop milestone (fail, 7/10 assertions)
7 passed (VAL-ML-001/002/004/005/022, VAL-JOY-001/005), 3 failed (VAL-VIS-001/002/003).
Root cause: app defaults to synth mode instead of visual mode, preventing
FlowField particle rendering. Single-line fix needed in ml-store.ts.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2026-04-07 18:49:35 +02:00
monkey-w1n5t0n
6f00465e22 validation: add scrutiny synthesis for ml-core-loop milestone (pass, 4/4 reviews)
All validators passed: 82 Playwright tests, tsc --noEmit clean, no lint issues.
Reviews: f04-ml-store-dual-iml, f05-reactive-inference-loop, f06-joystick-component,
f07-flowfield-canvas — all PASS. No blocking issues. 9 non-blocking observations
documented. Suggested skill update: solidjs-worker Step 3 should reference Playwright
instead of vitest.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2026-04-07 18:30:59 +02:00
monkey-w1n5t0n
ebeafbff29 docs: update architecture.md with FlowField component and flow-field core module details
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2026-04-07 18:16:57 +02:00
monkey-w1n5t0n
b9e330beb4 feat(solidjs): implement fullscreen Canvas2D flow-field particle system driven by ML outputs
Transplant FlowFieldVisualizer from playground/js/ui/visualizer.js with TypeScript
types. Create SolidJS FlowField component with own rAF render loop, reactive to
output mode changes. Canvas resizes via ResizeObserver. Add 8 e2e tests covering
VAL-VIS-001 (particles render), VAL-VIS-002 (joystick changes flow), VAL-VIS-003
(canvas resizes with window).

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2026-04-07 18:15:49 +02:00
monkey-w1n5t0n
d85f85f032 docs: update architecture.md with input store and joystick component details
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2026-04-07 17:52:30 +02:00
monkey-w1n5t0n
3c4e45aa5d feat(solidjs): implement joystick component with pointer events, input store, and follow mode
Build touch/mouse joystick component that tracks drag position as [0,1]
coordinates. Implements:
- Input store (src/stores/input-store.ts) with joyX/joyY signals
- Joystick component (src/components/input/Joystick.tsx) with canvas
  rendering, pointer events, and follow mode toggle
- Input clamping for out-of-range values (NaN, Infinity, negative, >1)
- Follow mode badge with pulse animation
- 12 e2e tests covering VAL-JOY-001, VAL-JOY-002, VAL-JOY-005

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2026-04-07 17:51:05 +02:00
monkey-w1n5t0n
9887bf50c9 feat(solidjs): implement reactive inference loop with NaN-safe clamping and comprehensive e2e tests
- Add NaN/Infinity guard in MLStore.setInputs() — non-finite values map to 0.5 (center)
- Add 14 e2e tests covering VAL-ML-004 (different inputs → different outputs) and
  VAL-ML-005 (synchronous inference — getOutputs immediately reflects setInputs)
- Tests cover: position differentiation, sequential consistency, clamping verification,
  boundary values, NaN handling, bus emission, and determinism

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2026-04-07 17:34:34 +02:00
monkey-w1n5t0n
3679f5c659 docs: update architecture.md with ML store implementation details
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2026-04-07 17:25:20 +02:00
monkey-w1n5t0n
6fdc2985f9 feat(solidjs): implement ML store with dual WasmIML instances and dynamic output count
Create ML store wrapping dual WasmIML instances (imlJoy for joystick with
2 inputs, imlHand for hand tracking with 14 inputs) with warm-start weight
transfer on mode switch. Outputs stored as Float32Array signal. Mode switching
triggers MLP resize (visual=20, synth=126, midi-cc=8, audio-canvas=36).
Initial state: 0 examples, null loss, all outputs bounded [0,1].

Fulfills: VAL-ML-001, VAL-ML-002, VAL-ML-022

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2026-04-07 17:23:06 +02:00
monkey-w1n5t0n
447ab54b54 validation(user-testing): skeleton-wasm milestone — all 6 assertions passed
User testing validation for skeleton-wasm milestone. Tested 6 assertions
via agent-browser flow validators: COOP/COEP headers (VAL-PROJ-001),
SolidJS rendering (VAL-PROJ-002), WASM engine loading (VAL-PROJ-003),
signal bus emit/receive/wildcard (VAL-PROJ-004), debug probe with
?debug=1 (VAL-PROJ-005), debug probe absent without ?debug=1 (VAL-PROJ-006).
Added Flow Validator Guidance section to user-testing.md.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2026-04-07 17:10:24 +02:00
monkey-w1n5t0n
4db11849e1 scrutiny: complete skeleton-wasm milestone validation (pass)
All validators passed: 35 e2e tests, TypeScript typecheck, lint.
Three features reviewed (f01, f02, f03) — all pass with no blocking issues.
Updated environment.md with WASM patterns, probe details, and platform notes.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2026-04-07 16:54:19 +02:00
monkey-w1n5t0n
4613cbbbde feat(solidjs): extract debug probe module with comprehensive e2e tests
Extract window.__nisps debug probe into its own module (src/probe/debug-probe.ts)
with typed DebugProbe interface. Probe is only exposed when ?debug=1 is present.
Add 17 Playwright e2e tests validating VAL-PROJ-005 and VAL-PROJ-006, including
method enumeration, smoke tests for all 15 methods, and undefined check without debug flag.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2026-04-07 16:42:15 +02:00
monkey-w1n5t0n
f3252008e5 feat(solidjs): implement reactive signal bus with wildcard matching
Add signal bus (src/bus/signal-bus.ts) with:
- Named topics using createSignal with equals:false for event semantics
- emit() triggers all subscribers even with identical data
- subscribe() returns unsubscribe function
- match() with wildcard patterns: * (single segment) and ** (multi-segment)
- Callable topic interface (topic() reads current value)

Wire bus into App.tsx, expose as window.__nispsBus for tests.
10 e2e tests covering all bus behaviors (VAL-PROJ-004).

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2026-04-07 16:29:09 +02:00
monkey-w1n5t0n
7337e8eaed feat(solidjs): set up Vite + SolidJS project with WASM inference
- Vite config with COOP/COEP headers for SharedArrayBuffer
- SolidJS app renders at root URL without JS errors
- WASM ML engine loads and inference returns 126 bounded [0,1] outputs
- Debug probe (window.__nisps) exposed only with ?debug=1
- TypeScript strict mode with complete type coverage
- Playwright e2e tests (8 tests) for VAL-PROJ-001/002/003
- WasmIML TypeScript port from playground/js/nisps/nisps-wasm.js
- Dataset TypeScript port with FIFO ring buffer and sample weighting

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2026-04-07 16:17:08 +02:00
monkey-w1n5t0n
13112cf447 Add mission infrastructure for SolidJS migration
- Worker skill: solidjs-worker (SKILL.md)
- Services manifest (services.yaml)
- Init script (init.sh)
- Library: architecture.md, environment.md, user-testing.md, solidjs-patterns.md

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2026-04-07 08:49:52 +02:00
w1n5t0n
445bc48c24 Improve solidjs migration plan 2026-04-07 03:44:36 +01:00
w1n5t0n
47b6b1466b Add SolidJS migration plan 2026-04-07 03:29:34 +01:00
w1n5t0n
b72914813c test(shapeseq): add test runner + smoke tests
Shell runner for the shapeseq unit test suite and a smoke test that
exercises the core import paths.
2026-04-07 00:03:29 +01:00
w1n5t0n
d10f80210c feat(playground): add ShapeSeq container to immersive layout
Add #shapeseq-container div with a canvas and chain mount point,
positioned above the bottom controls. Visible when ?shapeseq=1 is
set and synth mode is active.
2026-04-07 00:01:57 +01:00
w1n5t0n
1e9dda6e38 fix(a-app): create AudioCanvas before computing target output count
Move the lazy AudioCanvas initialization above the outputCountForMode()
call in setOutputMode() so that the real output count is available
instead of the 12-output fallback.
2026-04-07 00:01:37 +01:00
w1n5t0n
9ebfec8814 feat(shapeseq): session serialization + preset integration
Add serializeShapeSeqState/restoreShapeSeqState for complete ShapeSeq
state capture (chain config, primitive states, projection knobs, voice
mode, MLP weights, freeze state, clock config). SessionPresetManager
lazily imports the session module when a ShapeSeq engine is registered,
including ShapeSeq state in save/load without a hard dependency.
2026-04-07 00:01:12 +01:00
w1n5t0n
70da83d6dc feat(freeze-ui): freeze/live param toggle interaction
When frozen, param rows dim to indicate frozen state. Tapping a row
toggles it to "live" (highlighted, receives ML deltas). Unfreezing
clears all visual indicators.
2026-04-07 00:00:56 +01:00
w1n5t0n
8bb965740e feat(chain-ui): drawer layout + signal-based reactive updates
Replace the inline chain builder with a full-screen slide-up drawer
(overlay + glass backdrop + drag handle). Param sliders now subscribe
to a vanilla signal (createArraySignal) for O(changed params) updates
instead of querySelectorAll sweeps. Card list uses keyed reconciliation.
2026-04-06 23:59:25 +01:00
w1n5t0n
4240b03c1c feat(sequencer): mono/poly voice mode
Mono mode (default) kills the previous note before firing a new one —
classic monophonic synth behavior. Poly mode retriggers same-pitch
notes without killing others. All active notes are released on mode
switch.
2026-04-06 23:59:04 +01:00
w1n5t0n
4aedc92bf9 feat(shapeseq): unified/dual MLP mode switching
Unified mode: a single MLP drives both timbre and sequence — the timbre
MLP's outputs are partitioned and a configurable slice feeds the
sequencer pipeline via setSequenceOutputsFromTimbre().

Dual mode (default): separate MLPs for timbre and sequence with
independent training. The sequencer owns its own IML instance.
2026-04-06 23:57:41 +01:00
w1n5t0n
9b08918b1e feat(shapeseq): freeze-as-algorithm/pattern + delta controller
Two freeze modes for capturing and preserving musical state:

- Algorithm freeze: snapshot all primitive params + seeds. Individual
  params can be selectively unfrozen for ML-driven exploration via
  DeltaController (applies MLP deltas to frozen base values with
  per-param boundary enforcement).

- Pattern freeze: snapshot the realized note pattern. The sequencer
  bypasses the primitive chain entirely and loops the frozen pattern.

Extracts _runPipeline() from setSequenceInputs() for reuse.
2026-04-06 23:55:23 +01:00
w1n5t0n
122bdb9843 feat(sequencer): generation counter forces re-eval on config changes
The dirty-check that skips re-evaluation when inputs haven't changed now
also checks a generation counter. Config changes (tempo, step count,
projection, chain edits) bump the counter, ensuring the pipeline re-runs
even when joystick position is static.
2026-04-06 23:51:57 +01:00
w1n5t0n
5796d8fd35 feat(seq-iml): configurable output count with scaled architecture
The sequence MLP output count is now configurable (default 16). Hidden
layer widths scale with the output count to keep inference cheap while
providing sufficient capacity. The sequencer exposes setOutputCount()
to resize the MLP at runtime.
2026-04-06 23:45:55 +01:00
w1n5t0n
4cea170795 refactor(projection): simplify to 3 global knobs
Replace the composable transform chain (VelocityCurve, GateThreshold,
RangeMap, OctaveFolder, StutterMap, presets) with 3 straightforward
post-chain knobs: velocityCurve, gateThreshold, and pitchRange. The
old system was over-engineered for a research prototype — the new API
is easier to wire to UI controls and reason about.
2026-04-06 23:41:30 +01:00
w1n5t0n
af4f19bc72 refactor(PitchWalker): redesign as processor, add reEvalOnLoop
PitchWalker was classified as a generator but always consumed the
incoming pattern's triggers. Reclassify as a processor so it modifies
the pattern produced by an upstream generator (clonePattern instead of
createPattern). Add reEvalOnLoop flag on the Primitive base class; when
set, the sequencer re-evaluates the chain at each loop start so
stateful primitives produce evolving patterns across loops.
2026-04-06 23:37:32 +01:00
w1n5t0n
b4b4025f59 feat(shapeseq): polyrhythm — per-generator step counts with LCM tiling
Generators can now have independent step counts. When merging patterns
of different lengths, both are tiled to their LCM. Chain exposes
setGeneratorStepCount/getGeneratorStepCount for polyrhythmic control.
2026-04-06 23:31:45 +01:00
w1n5t0n
aec58537db feat(pattern): add midiNote field + trigger-aware merge
Replace the pitch*127 encoding hack with a dedicated midiNote field on
pattern steps. IntervalLock now writes integer MIDI notes to step.midiNote
while preserving the original [0,1] pitch for other consumers. The clock
and sequencer bridge pass midiNote through the event pipeline.

Also reworks mergePatterns to be trigger-aware: when only one generator
fires at a step, use its values directly instead of averaging with the
other generator's defaults.
2026-04-06 23:28:01 +01:00
w1n5t0n
3f4ffcd4f9 refactor(event-bus): extract to shared module
The EventBus was duplicated inside shapeseq/ but is used by other
playground code too. Move the canonical implementation to js/event-bus.js
and turn the shapeseq copy into a re-export shim.
2026-04-06 23:18:47 +01:00
w1n5t0n
452754f448 docs(playground): add ARCHITECTURE.md 2026-04-06 23:17:42 +01:00
w1n5t0n
41106f22c0 feat(audio-canvas): per-file loop count, beat-synced lengths, param range groups, pitch lock
- Per-file loop count (0-4) with stepper UI on each waveform cell;
  dynamic MLP output sizing (8 range + N_loops × 4 position outputs)
- Beat-synced loop length: global bars/beats selector (2/4/8/16/32/64)
  with per-loop overrides via long-press dropdown, persistent badges
- Global param range groups: dual-thumb range sliders (volume, pitch,
  position, filter) with ML-driven min/max and per-loop position mapping
- Pitch lock toggle (1×) to freeze playback rate across all submodes
- Fix: _resizeOutputs now syncs _loopOutputs to prevent stale reads
- Fix: granular visuals consolidated per-clip to prevent multi-loop flicker
2026-04-03 20:36:24 +01:00
w1n5t0n
960676acf3 feat(tests): add 24 Playwright e2e tests for engine switching + fix hidden param filtering
Tests cover:
- Default state (C15, 126 params, heatmap cells)
- Engine switcher UI (3 cards, active state)
- Switch to Additive (48 params, outputs bounded, training works)
- Switch to FM Matrix (55 params, outputs bounded, training works)
- Round-trip switching (C15→Add→C15, C15→FM→Add→C15)
- Warm-start weight preservation across resize
- EOC chain accessibility across engines
- SynthVisualizer visibility across engines
- No console errors during any switch

Also fixes: faustJsonToParamMeta now filters [hidden:1] params,
giving correct counts (48 additive, 55 FM) instead of including
freq/gate/_vel control inputs.
2026-04-03 19:28:23 +01:00
w1n5t0n
cb3bda034b fix(playground): FaustEngineBase creates AudioContext if none passed; add stop()/start() methods 2026-04-03 19:08:52 +01:00
w1n5t0n
3fabc342a0 fix(playground): getParamOverride uses engineParamOverrides for non-C15; guard undefined sectionMap entries 2026-04-03 19:01:14 +01:00
w1n5t0n
f19d5e5baa fix(playground): engine switch — eager paramMeta + engine-agnostic SynthVisualizer (meml-gdh8)
When switching from C15 to Additive or FM engines, the MLP was resized
to 0 outputs because paramMeta wasn't loaded until init() (which needs
AudioContext). The SynthVisualizer also disappeared because its section
map was hardcoded to C15's 18 param groups.

- Add FaustEngineBase.loadParamMeta() for eager JSON-only loading
- Call loadParamMeta() before setActiveEngine() in engine switch handler
- Add SynthVisualizer.rebuild(paramMeta) to derive sections from groups
- Add rebuildParamToSection() / restoreC15ParamToSection() for engine-agnostic
  param-to-section mapping
- Fix tooltip to use engineParamOverrides for non-C15 engines
2026-04-03 18:41:05 +01:00
w1n5t0n
78e9e64dee fix(playground): move engine switcher to synth drawer, fix output mode labels
- Engine switcher now lives in the Synth drawer (was incorrectly in NISPS params drawer)
- Params drawer renamed to "NISPS" (it's for ML engine tuning, not synth engine selection)
- Output mode button says "Synth" (generic) not "C15 Shaper-Feedback" (engine-specific)
- Dock icon for params drawer now labelled "NISPS" with correct tooltip
2026-04-03 18:30:20 +01:00
w1n5t0n
d5a315904a feat(playground): expand audio canvas import formats + add file picker button
Support opus, webm, mp4, wma, aif, aiff in addition to existing formats.
Add "+" button to control bar for importing files without drag-and-drop (mobile).
2026-04-03 18:29:59 +01:00
w1n5t0n
bc68ee64f8 Merge branch 'worktree-agent-a3abdb63' 2026-04-03 18:26:31 +01:00
w1n5t0n
329b326ede feat(playground): per-engine param presets for additive + FM (meml-ax4)
Additive engine: 5 presets across 3 tiers (Spectral Basics, Formant Play,
Harmonic Sculptor, Phase Explorer, Full Spectrum). FM engine: 5 presets
across 3 tiers (Simple FM, Bell Tones, Matrix Explorer, Feedback Machine,
Full Matrix).

Engine-aware preset system: applyPreset() dispatches to C15 groupOverrides
or new flat engineParamOverrides depending on active engine. Preset selector
dropdown rebuilds on engine switch. URL ?preset param searches all engines.
2026-04-03 18:26:12 +01:00