Skip to content

Explorables + WASM playground for evo.fugue.run (real crate in the browser) - #14

Merged
alexnodeland merged 4 commits into
mainfrom
explorables-wasm
Jul 21, 2026
Merged

Explorables + WASM playground for evo.fugue.run (real crate in the browser)#14
alexnodeland merged 4 commits into
mainfrom
explorables-wasm

Conversation

@alexnodeland

Copy link
Copy Markdown
Owner

Closes #12. Closes #13.

The evo docs get the full fugue explorables treatment — and unlike the original fugue rollout, every widget runs the real crate via WebAssembly from day one. There is no mirrored-JS math anywhere: WASM computes, canvas draws.

Compute layer (crates/fugue-evo-wasm/src/explore.rs)

Seeded, incremental engines exposing generation-by-generation step() over the real algorithms, streaming state as JSON:

  • ExploreGa — drives the actual TournamentSelection/SbxCrossover/PolynomialMutation operators directly, exposing each generation's full anatomy (selected parents, pairs, pre/post-mutation offspring, elite)
  • ExploreCmaCmaEs::step, streaming mean/σ/covariance/eigenstructure per generation
  • ExploreNsga2Nsga2::step_bounded on ZDT1/2/3 + Schaffer, streaming objective points with Pareto rank and crowding
  • ExploreIslandIslandModel::step, streaming per-island populations, diversity, and migration events
  • ExploreUmda — the crate's ContinuousUnivariateModel (sample → select → refit), streaming the learned model
  • explore_landscape_grid/explore_landscape_info — heatmap backgrounds from the real benchmark functions

To compile the island model for wasm32, algorithms::island is no longer gated on the parallel feature: without rayon, islands evolve sequentially over the same per-island RNGs (bit-identical seeded results, pinned by test).

Docs (#12)

  • fugue-viz.js/css foundation ported from fugue; navy theme; fugue-evo-wasm-loader.js publishing FV.wasmReady
  • Six widget files → ten widgets: ga-anatomy, cmaes-ellipse (live covariance ellipse on Rosenbrock's valley), nsga2-front (Pareto front forming onto the analytic curve), island-migration (2×2 island panels + migration flashes + best-fitness strip), umda-contract, and five ambient minis (mini-convergence, mini-diversity, mini-sigma, mini-front, mini-migration)
  • Embedded with captions across 16 pages (getting-started, tutorials, how-tos, reference)
  • api-docs.md now links live docs.rs (was "(when published)")

Playground (#13)

/playground.html — algorithm × landscape × seed, per-algorithm knobs, run/step/reset, speed control, convergence strip, live readouts. All five algorithms.

Packaging

  • version 0.1.1 with documentation/homepage metadata — fixes the missing Documentation link on crates.io (fugue-ppl had documentation; fugue-evo didn't). Publish workflow picks it up on merge.
  • Docs workflow now wasm-packs the crate and serves the pkg at <site>/pkg/
  • CHANGELOG cut for 0.1.1

Validation

  • 658 core + 11 native wasm-crate tests + 4 new wasm-pack test --node tests, clippy clean, --no-default-features build checked
  • Headless Playwright against the built book: 25-page sweep — every widget on every page initializes with data-fugue-backend="wasm", zero console/page/request errors; blocked-pkg fallback renders notices (backend="none") without errors; light theme verified; playground exercised across all five algorithms
  • Visual review of every major widget (screenshots in session); one fix out of it: the CMA-ES heatmap needed a log ramp + ImageData scaling for Rosenbrock's 6-decade range

🤖 Generated with Claude Code

https://claude.ai/code/session_018yo1jdkckG7yQ9eBqLbaDB

alexnodeland and others added 3 commits July 21, 2026 14:34
…l from rayon

- crates/fugue-evo-wasm/src/explore.rs: seeded step()-based engines
  (ExploreGa, ExploreCma, ExploreNsga2, ExploreIsland, ExploreUmda) plus
  landscape grid/info helpers, streaming real algorithm state as JSON for
  the explorable docs widgets (evo #12/#13)
- algorithms::island now compiles without the parallel feature (sequential
  fallback over the same per-island RNGs, bit-identical seeded results)
- Cargo.toml: 0.1.1, documentation + homepage metadata (fixes the missing
  crates.io Documentation link); CHANGELOG cut for 0.1.1; api-docs.md now
  links live docs.rs

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018yo1jdkckG7yQ9eBqLbaDB
- fugue-viz.js/css copied from fugue (shared foundation), navy theme,
  fugue-evo-wasm-loader.js publishing FV.wasmReady
- docs.yml builds the wasm pkg and serves it at <site>/pkg/
- playground.md + SUMMARY entry; explore-engine section in how-to/wasm.md;
  api-docs.md links live docs.rs
- widget embeds with captions across getting-started, tutorials, how-tos,
  and reference pages (ga-anatomy, cmaes-ellipse, nsga2-front,
  island-migration, umda-contract + five ambient minis)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018yo1jdkckG7yQ9eBqLbaDB
- docs/viz/{landscape,cmaes,nsga2,island,inline,playground}.js: six widget
  files registering ga-anatomy, umda-contract, cmaes-ellipse, nsga2-front,
  island-migration, five ambient minis, and the evo-playground - all
  compute via FV.wasmReady on the real crate (data-fugue-backend attr for
  automated tests; .fv-pg-notice fallback when the pkg is absent)
- cmaes heatmap: log ramp + ImageData scaling so rosenbrock's valley
  reads (sqrt ramp washed it out; per-cell rects caused moire)
- crates/fugue-evo-wasm/tests/explore_node.rs: 4 wasm-pack --node tests
  (determinism, convergence, migration cadence, landscape helpers)

Validated headless (Playwright): 25-page sweep all widgets backend=wasm,
zero console/page/request errors; blocked-pkg fallback path; light theme;
playground exercised across all five algorithms.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018yo1jdkckG7yQ9eBqLbaDB
Copilot AI review requested due to automatic review settings July 21, 2026 19:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018yo1jdkckG7yQ9eBqLbaDB
@alexnodeland
alexnodeland merged commit c673814 into main Jul 21, 2026
8 checks passed
@alexnodeland
alexnodeland deleted the explorables-wasm branch July 21, 2026 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WASM playground: run real fugue-evo in the browser Explorables treatment for evo docs (port fugue's interactive doc system)

2 participants