# TimeWarp v0.2.0 - Table of Contents

> Optimistic parallel discrete-event simulation (Time Warp) on the BEAM: logical processes execute events speculatively and roll back automatically on causality violations, so models implement only pure event handling and never write rollback logic.

## Pages

- [TimeWarp](readme.md)
- [Changelog](changelog.md)
- [Contributing](contributing.md)
- [License](license.md)

## Modules

- [TimeWarp](TimeWarp.md): Optimistic parallel discrete-event simulation on the BEAM.
- [TimeWarp.Coordinator](TimeWarp.Coordinator.md): GVT computation, fossil-collect trigger, run control and termination.
- [TimeWarp.Event](TimeWarp.Event.md): Unit of both scheduling and inter-LP messaging.
- [TimeWarp.Examples.BufferedWindow](TimeWarp.Examples.BufferedWindow.md): Keyed tumbling windows, watermark-and-buffer style — the conservative-shaped OPPONENT
to `Examples.KeyedWindow`, for the eager-vs-buffered stream comparison.
- [TimeWarp.Examples.DecayingPHOLD](TimeWarp.Examples.DecayingPHOLD.md): A draining variant of PHOLD. Each processed event schedules one
follow-up to a random LP at `at + delay` — but only if that time is still below
the horizon. Tokens therefore fall off the end of the horizon over time and the
population drains to zero, driving the system to genuine quiescence.
- [TimeWarp.Examples.KeyedWindow](TimeWarp.Examples.KeyedWindow.md): Keyed tumbling-window aggregation — the output-commit *instrument*.
- [TimeWarp.Examples.NeighbourPHOLD](TimeWarp.Examples.NeighbourPHOLD.md): PHOLD with **locality** — the workload the placement option needs.
- [TimeWarp.Examples.PHOLD](TimeWarp.Examples.PHOLD.md): PHOLD — the standard PDES stress benchmark.
- [TimeWarp.Examples.Spin](TimeWarp.Examples.Spin.md): A synthetic per-fold compute cost for the eager-vs-buffered stream experiment.
- [TimeWarp.LP](TimeWarp.LP.md): A logical process. One GenServer per LP. Executes events
speculatively in `{timestamp, seq}` order, rolls back on stragglers and
processed-twin anti-messages, and un-sends downstream effects via anti-messages.
- [TimeWarp.Model](TimeWarp.Model.md): What a domain model implements. The engine handles all Time Warp
mechanics — rollback, anti-messages, GVT, fossil collection.
- [TimeWarp.Rand](TimeWarp.Rand.md): Sanctioned, purely-functional seeded PRNG.
- [TimeWarp.Telemetry](TimeWarp.Telemetry.md): Telemetry from the start. Every rollback, anti-message and GVT cycle emits an
event, because rollback rate is the diagnostic needed while debugging *the
engine itself* — not something to add once the engine works.

- Exceptions
  - [TimeWarp.CommitmentFloorViolation](TimeWarp.CommitmentFloorViolation.md): Raised by the **Commitment-Floor Guard**.
  - [TimeWarp.DivergenceError](TimeWarp.DivergenceError.md): Raised by the **Divergence Detector** under `check_purity: true`.
  - [TimeWarp.ThrashHalt](TimeWarp.ThrashHalt.md): Raised/reported when the **thrash circuit breaker** trips: a sustained rollback
rate above the configured threshold means optimism is losing to churn. Fail fast
rather than burn hours; the decomposition or workload is wrong for Time Warp.

