Phase 0: Deterministic simulation engine #52

Merged
erikinkinen merged 4 commits from 0-deterministic-simulation-engine into main 2026-02-17 07:54:34 +01:00
Owner

Closes #10


Summary

  • Add Engine::run() to execute workloads with a forked RNG and deterministic history logging.
  • Centralize ID allocation and event ordering inside the engine for reproducible runs.
  • Expand engine tests to cover history ordering, error handling, and RNG determinism.

Scope

Included

  • Engine workload execution and deterministic event logging.
  • Engine ID allocation helpers and event history tracking.
  • New/updated tests for run behavior and deterministic RNG usage.

Explicitly excluded

  • Event replay or IO/log serialization.
  • Changes to non-engine subsystems or metrics.

Design intent

  • Keep all simulation mutation and ID allocation inside Engine.
  • Ensure reproducibility by forking RNGs per workload and logging only successful events in order.
  • Preserve Phase 0 invariants around explicit events and deterministic runs.

Phase discipline

  • Phase 0: infrastructure and deterministic execution scaffolding only.
  • No changes to authority semantics beyond event ordering/logging.

Verification

  • Tests pass
  • Model is internally consistent
  • Documentation updated
  • No regressions in existing functionality

Notes

  • history records only successfully applied events; failed events do not advance time or appear in the log.
  • RNG determinism is validated via a workload that branches on uniform_u32() with a fixed seed.
Closes #10 --- ## Summary - Add `Engine::run()` to execute workloads with a forked RNG and deterministic history logging. - Centralize ID allocation and event ordering inside the engine for reproducible runs. - Expand engine tests to cover history ordering, error handling, and RNG determinism. --- ## Scope ### **Included** - Engine workload execution and deterministic event logging. - Engine ID allocation helpers and event history tracking. - New/updated tests for run behavior and deterministic RNG usage. ### **Explicitly excluded** - Event replay or IO/log serialization. - Changes to non-engine subsystems or metrics. --- ## Design intent - Keep all simulation mutation and ID allocation inside `Engine`. - Ensure reproducibility by forking RNGs per workload and logging only successful events in order. - Preserve Phase 0 invariants around explicit events and deterministic runs. --- ## Phase discipline - Phase 0: infrastructure and deterministic execution scaffolding only. - No changes to authority semantics beyond event ordering/logging. --- ## Verification - [ ] Tests pass - [ ] Model is internally consistent - [ ] Documentation updated - [ ] No regressions in existing functionality --- ## Notes - `history` records only successfully applied events; failed events do not advance time or appear in the log. - RNG determinism is validated via a workload that branches on `uniform_u32()` with a fixed seed.
erikinkinen added this to the Phase 0 milestone 2026-02-17 07:53:14 +01:00
Implement step(event) (#10)
All checks were successful
ci / smoke (push) Successful in 9s
clang-format / check-format (push) Successful in 8s
markdownlint / markdown-lint (push) Successful in 10s
3df0bb9daa
Implement run(workload, steps) (#10)
All checks were successful
ci / smoke (push) Successful in 9s
clang-format / check-format (push) Successful in 7s
markdownlint / markdown-lint (push) Successful in 11s
c18e5fecc3
Enforce deterministic ordering and RNG usage (#10)
All checks were successful
ci / smoke (push) Successful in 9s
clang-format / check-format (push) Successful in 8s
markdownlint / markdown-lint (push) Successful in 10s
ci / smoke (pull_request) Successful in 9s
clang-format / check-format (pull_request) Successful in 8s
markdownlint / markdown-lint (pull_request) Successful in 10s
e8366a9bc9
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
erikinkinen/AES!52
No description provided.