Phase 0: Determinism and invariant test suite #62

Merged
erikinkinen merged 4 commits from 0-determinism-and-invariant-test-suite into main 2026-03-03 13:23:20 +01:00
Owner

Implemented #21 on branch 0-determinism-and-invariant-test-suite with the required four per-step commits:

  1. 73b4767 Phase 0: Test deterministic logs for same seed (#21)
  2. 83958ec Phase 0: Test replayed hash equals live hash (#21)
  3. 4efe21f Phase 0: Test deterministic invalid event rejection (#21)
  4. 6ad451a Phase 0: Add invariant property test after every event (#21)

Closes #21

What changed

  • Extended CLI determinism matrix (same seed + same args => identical JSONL logs across):

  • Added replay hash equivalence suite in:

    • tests/replay_hash_tests.cpp
    • includes live-vs-replay snapshot_hash_v0 equality, canonical snapshot equality, and verify_replay_matches_live_state.
  • Added deterministic invalid-event rejection suite in:

  • Added invariant property matrix suite in:

    • tests/invariant_property_tests.cpp
    • seed matrix {0, 1, 42, 0xabcdu, 0xdeadbeef}
    • requested workload scenarios
    • validates after every successful event:
      • validate_graph(...) succeeds
      • time, history.size(), next_event_value() consistency
      • snapshot_hash_v0(...) succeeds
  • Wired new test targets in:

  • Added Phase 0 note:

Validation

Ran after each commit:

  • cmake --build _build
  • ctest --test-dir _build --output-on-failure

Final suite result: 36/36 tests passing.
Working tree is clean.

Implemented `#21` on branch `0-determinism-and-invariant-test-suite` with the required four per-step commits: 1. `73b4767` `Phase 0: Test deterministic logs for same seed (#21)` 2. `83958ec` `Phase 0: Test replayed hash equals live hash (#21)` 3. `4efe21f` `Phase 0: Test deterministic invalid event rejection (#21)` 4. `6ad451a` `Phase 0: Add invariant property test after every event (#21)` Closes #21 ## What changed - Extended CLI determinism matrix (same seed + same args => identical JSONL logs across): - linear/accumulate - linear/transfer - branching/accumulate - branching/transfer in [tests/cli_simulate_tests.cpp](/home/erikinkinen/AES/tests/cli_simulate_tests.cpp) - Added replay hash equivalence suite in: - [tests/replay_hash_tests.cpp](/home/erikinkinen/AES/tests/replay_hash_tests.cpp) - includes live-vs-replay `snapshot_hash_v0` equality, canonical snapshot equality, and `verify_replay_matches_live_state`. - Added deterministic invalid-event rejection suite in: - [tests/invalid_event_determinism_tests.cpp](/home/erikinkinen/AES/tests/invalid_event_determinism_tests.cpp) - covers all requested invalid cases and asserts: - stable `Errc` and message - empty delta - no state mutation (`time`, `history`, `snapshot_hash` unchanged) - Added invariant property matrix suite in: - [tests/invariant_property_tests.cpp](/home/erikinkinen/AES/tests/invariant_property_tests.cpp) - seed matrix `{0, 1, 42, 0xabcdu, 0xdeadbeef}` - requested workload scenarios - validates after every successful event: - `validate_graph(...)` succeeds - `time`, `history.size()`, `next_event_value()` consistency - `snapshot_hash_v0(...)` succeeds - Wired new test targets in: - [tests/CMakeLists.txt](/home/erikinkinen/AES/tests/CMakeLists.txt) - Added Phase 0 note: - [docs/phase0.md](/home/erikinkinen/AES/docs/phase0.md) ## Validation Ran after each commit: - `cmake --build _build` - `ctest --test-dir _build --output-on-failure` Final suite result: `36/36` tests passing. Working tree is clean.
erikinkinen added this to the Phase 0 milestone 2026-03-03 13:22:32 +01:00
Phase 0: Add invariant property test after every event (#21)
All checks were successful
ci / smoke (push) Successful in 15s
clang-format / check-format (push) Successful in 9s
markdownlint / markdown-lint (push) Successful in 10s
markdownlint / markdown-lint (pull_request) Successful in 10s
ci / smoke (pull_request) Successful in 15s
clang-format / check-format (pull_request) Successful in 9s
db132c7f6e
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!62
No description provided.