Repository navigation
Determinism
Determinism in PWE is not a slogan; it is a compile-and-run gate.
Interpreter ≡ semantic baseline
JIT/AOT ≡ optimized implementations
The EIR interpreter is the semantic reference. Compiler optimization MUST NOT change semantics. Production execution must preserve WIR → Domain IR → EIR → execution — no undocumented bypasses.
step_cross runs both backends on identical state and requires:
- byte-identical writes, and
- identical event / queue streams,
on every step — not a summary comparison at the end.
let mut rt = pwe_reference::lang::LangRuntime::compile(SOURCE)?;
rt.step_cross()?; // interpreter == JIT, asserted
rt.step_cross_n(30)?;Every simulation is asserted against its closed form: Newton cooling, radioactive decay, logistic growth, Kepler orbits, harmonic energy, action–reaction, reversible kinetics, wall reflection, and more.
State hashes reproduce bit-for-bit across runs and snapshots. A successful commit increments WorldVersion.
The RFC set in rfc/ defines canonical bytes, schemas, and protocols; the conformance runner (RFC-0029) runs with zero skips.
cargo run -p pwe-conformance
cargo test --workspace- Authoritative mutation goes through
WorldTransactiononly — never opportunistic writes during Compute. - Time is explicit and domain-based; the step grid is the clock events land on.
- Structural changes are deferred to commit.
- Randomness (
random(),noise(),emit()) is seeded and replay-stable. - Grid fields are ordinary deterministic world state — snapshot and replay included.
- Presentation fields are excluded from the state hash by design.
- A mutable entity has exactly one authoritative owner; epochs reject stale commands, so split-brain authority is never silently allowed.
Observe → Compute → Prepare → Commit → Publish
You cannot. Determinism is an execution mode that is first-class and always available; the differential gate runs in tests and cross-backend execution paths. A runtime that cannot meet a MUST requirement fails closed: a defined error, no authoritative mutation.
See also: The Frozen Contract · Architecture
PWE Wiki
- Home
- Getting Started
- The PWE Language
- Standard Library
- Examples
- Determinism
- Architecture
- The Frozen Contract
- FAQ
Repository
The world is the single source of truth. Program it. Prove it. Watch it move.