Phase 0: Snapshot hashing and equality #57
No reviewers
Labels
No labels
bug
cli
core
docs
event
experiment
figure
invariant
metrics
oracle
phase-0
phase-1
phase-2
phase-3
phase-4
phase-5
phase-6
provenance
revocation
tests
workload
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
erikinkinen/AES!57
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "0-snapshot-hashing-and-equality"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Implements Snapshot Hashing and Equality v0 in
aes::simso snapshots can be compared exactly and deterministically.Closes #16.
What’s Included
1) Canonical snapshot serialization (v0)
Added canonical serializer API:
core::Result<std::string> canonical_snapshot_v0(const Engine &engine);Implemented deterministic ASCII serialization with fixed line grammar/order, terminal newline, and stable ordering of all graph/state components.
Behavior/details:
time,history, subject/object/edge stores, outgoing/incoming indices, and next ID cursors.seedand debug labels by design.Errc::InvariantViolationon invalid graph.2) Stable snapshot hash computation
Added hash API:
core::Result<std::uint64_t> snapshot_hash_v0(const Engine &engine);Behavior/details:
fnv1a64(canonical_snapshot_v0(engine)).3) Deep equality with mismatch diagnostics
Added equality API:
core::Error snapshot_equal(const Engine &lhs, const Engine &rhs);Behavior/details:
seedand debug labels):timeEventId, event type/payload)Errc::InvariantViolationmessage.4) Tests
Added new test target:
tests/snapshot_tests.cpptests/CMakeLists.txtasaes_snapshot_testsCoverage includes:
Files Changed
sim/include/aes/sim/snapshot.hpp(new)sim/src/snapshot.cpp(new)sim/CMakeLists.txttests/snapshot_tests.cpp(new)tests/CMakeLists.txtValidation
Executed successfully:
cmake --build _buildctest --test-dir _build --output-on-failureResult: all tests passing, including new snapshot tests.