memlnaut-nisps/playground
w1n5t0n f26ec923e1 feat(playground/wasm): WASM bridge between C++ core and SolidJS playground (meml-tgm)
Stream 7 wires nisps/ml + nisps/engines into the playground via Emscripten.

Highlights:
- nisps/wasm/bindings.cpp: flat C API per architecture.md §6.2. Fixed-arch
  MLP<2, 10, 14, 18, 126>; engine string→type dispatch table with NoOp
  fallback.
- scripts/build-wasm.sh: emcc invocation, MODULARIZE=1, exports listed
  explicitly; produces playground/public/nisps.{js,wasm}.
- playground/src/ml/wasm-iml.ts: main-thread MLP host (sync inference,
  sync training, RL ops, weights I/O, layer stats, localStorage).
- playground/src/ml/wasm-worker.ts: disposable Web Worker for off-thread
  async training, owns its own WASM instance.
- playground/src/ml/dataset.ts: Float32Array-backed FIFO with sample-weight
  modes (uniform/global/local/combined). Port of legacy dataset.js.
- playground/src/audio/engine-host.ts: AudioContext + AudioWorkletNode
  lifecycle, with start/stop/setEngine/setParams.
- playground/src/audio/worklet/nisps-processor.ts: WASM-loading
  AudioWorkletProcessor that runs engine.process_block per 128-sample
  block. Loads its own WASM instance from main-thread-supplied bytes
  (no fetch in worklet).
- playground/src/stores/ml-store.ts: wired stub methods to WasmIML
  singleton; lazy initialize().
- playground/src/debug/probe.ts: window.__nisps now calls real WasmIML
  via the store; lazy-init on first use.

Verified:
- bash scripts/build-wasm.sh succeeds (94 KB nisps.wasm)
- bun run typecheck OK
- bun run build OK (production bundle)
- vite dev server serves /nisps.{js,wasm} with COOP/COEP

Known limitation: WASM is fixed at one MLP shape. Multi-arch deferred —
documented in nisps/wasm/README.md.
2026-04-29 16:36:29 +03:00
..
public feat(playground/wasm): WASM bridge between C++ core and SolidJS playground (meml-tgm) 2026-04-29 16:36:29 +03:00
src feat(playground/wasm): WASM bridge between C++ core and SolidJS playground (meml-tgm) 2026-04-29 16:36:29 +03:00
.gitignore feat(playground): scaffold vite + solid + ts 2026-04-29 15:37:23 +03:00
index.html feat(playground): scaffold vite + solid + ts 2026-04-29 15:37:23 +03:00
package.json feat(playground): scaffold vite + solid + ts 2026-04-29 15:37:23 +03:00
tsconfig.json feat(playground): scaffold vite + solid + ts 2026-04-29 15:37:23 +03:00
vite.config.ts feat(playground): scaffold vite + solid + ts 2026-04-29 15:37:23 +03:00