Skip to content

docs: Phase 2 — the engine is its own Rust→WASM crate - #6

Merged
Kinflou merged 1 commit into
mainfrom
docs/playground-simulation-phase-2
Sep 3, 2026
Merged

docs: Phase 2 — the engine is its own Rust→WASM crate#6
Kinflou merged 1 commit into
mainfrom
docs/playground-simulation-phase-2

Conversation

@Kinflou

@Kinflou Kinflou commented Sep 3, 2026

Copy link
Copy Markdown
Member

The simulation moved out of the playground TypeScript into ComlineProject/simulator — a Rust crate → WASM, built on comline-runtime directly and structured as a discrete-event simulation. This revises the Phase 2 spec to match 10 PRs of implementation.

  • New Architecture section — why a separate crate (real runtime contract, no vendored port / drift guard, sync DES engine, Shape-JSON boundary instead of linking comline-core), the module layout, the script cargo feature + wasm-size note.
  • §2f rewritten — a sandboxed Rhai script, not a Worker-sandboxed JS snippet. Safe by construction (no I/O), resource-limited (operations / call-level / size caps), state persists between calls.
  • 2h subsumed — the Rust engine already runs the real comline-runtime contract via GenericDispatch, so "route A vs route B" and the drift guard no longer exist. The esbuild-wasm risk is moot.
  • 2a–2f marked done (PRs docs: CC-BY-4.0 + record the licensing decision #1–#10 on the simulator repo); 2g, the playground rewire, and 2i remain.
  • §2c / 2d / 2e updated to the shipped behaviour (timeout/dead, the single stepped clock, deterministic-by-construction replay).
  • Open questions / Risks pruned of the esbuild-wasm and Worker-CSP items; added the scripting-wasm-size and playground-rewire-scope questions.

mkdocs build --strict clean.

The simulation moved out of the playground TypeScript into
ComlineProject/simulator, a Rust crate → WASM, built on comline-runtime
directly (no vendored port, no drift guard) and structured as a
discrete-event simulation. The playground / tutorial / docs become thin
hosts over its `Sim` wasm-bindgen surface.

- new Architecture section: why a separate crate, the module layout,
  the Shape-JSON boundary, the `script` cargo feature + wasm size
- 2f rewritten: a sandboxed Rhai script, not a Worker-sandboxed JS
  snippet — safe by construction, resource-limited, `state` persists
- 2h subsumed: the Rust engine already runs the real runtime contract,
  so "route A vs route B" and the drift guard no longer exist
- 2a–2f marked done (PRs #1–#10); 2g / playground-rewire / 2i remain
- open questions / risks pruned of the esbuild-wasm and Worker-CSP
  items; 2c/2d/2e sections updated to the shipped behaviour
@Kinflou
Kinflou merged commit 1604a9a into main Sep 3, 2026
2 checks passed
@Kinflou
Kinflou deleted the docs/playground-simulation-phase-2 branch September 3, 2026 14:49
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.

1 participant