|
5 | 5 |
|
6 | 6 | ## Unreleased |
7 | 7 |
|
| 8 | +### Added - SPEC-0004: Worldlines & Playback |
| 9 | + |
| 10 | +- **`worldline.rs`**: Worldline types for history tracking |
| 11 | + - `WorldlineId(Hash)`: Opaque worldline identifier (derived from initial state hash in production; tests use fixed bytes) |
| 12 | + - `HashTriplet`: state_root + patch_digest + commit_hash per tick |
| 13 | + - `WorldlineTickPatchV1`: Per-warp projection of global tick operations |
| 14 | + - `apply_warp_op_to_store()`: Apply WarpOp to GraphStore with explicit variant coverage |
| 15 | + |
| 16 | +- **`playback.rs`**: Playback cursor and session types |
| 17 | + - `PlaybackCursor`: Materialized viewpoint into worldline history |
| 18 | + - `PlaybackMode`: Paused, Play, StepForward, StepBack, Seek state machine |
| 19 | + - `ViewSession`: Client subscription binding with channel filtering |
| 20 | + - `TruthSink`: Minimal BTreeMap-based frame collector |
| 21 | + - `CursorReceipt`, `TruthFrame`: Cursor-addressed authoritative values |
| 22 | + |
| 23 | +- **`provenance_store.rs`**: Provenance store trait (hexagonal port) |
| 24 | + - `ProvenanceStore` trait: Seam for history access (patches, expected hashes, outputs) |
| 25 | + - `LocalProvenanceStore`: In-memory Vec-backed implementation |
| 26 | + - `add_checkpoint()`: Record checkpoint for fast seek during replay |
| 27 | + - `fork()`: Prefix-copy worldline up to fork_tick |
| 28 | + |
| 29 | +- **`retention.rs`**: Retention policy for worldline history |
| 30 | + - `RetentionPolicy` enum: KeepAll, CheckpointEvery, KeepRecent, ArchiveToWormhole |
| 31 | + |
| 32 | +- **`materialization/frame_v2.rs`**: MBUS v2 wire format with cursor stamps |
| 33 | + - `V2Packet`: Cursor-stamped truth frame packets |
| 34 | + - `encode_v2_packet()`, `decode_v2_packet()`: Roundtrip encoding |
| 35 | + - Inline unit tests T19-T22 (SPEC-0004 test IDs): `mbus_v2_roundtrip_single_packet`, `mbus_v1_rejects_v2`, `mbus_v2_rejects_v1`, `mbus_v2_multi_packet_roundtrip` |
| 36 | + |
| 37 | +#### Tests - SPEC-0004 |
| 38 | + |
| 39 | +- **All SPEC-0004 tests passing** (see test files for complete list; SPEC-0004 test IDs, not Rust function names) |
| 40 | +- **`crates/warp-core/tests/reducer_emission_tests.rs`**: Reducer integration tests (T11-T13) |
| 41 | +- **`crates/warp-core/tests/view_session_tests.rs`**: Worker count invariance tests (T16) |
| 42 | +- **Hexagonal testing**: Playback contract tested using ProvenanceStore fakes (T1, T7) |
| 43 | +- **Total warp-core tests**: all passing (run `cargo test -p warp-core -- --list 2>/dev/null | tail -1` for current count) |
| 44 | + |
| 45 | +### Added - Cross-Warp Parallelism (Phase 6B+) |
| 46 | + |
| 47 | +- **`WorkUnit` struct** (`boaw/exec.rs`): Work unit carrying `warp_id` + items for one shard |
| 48 | +- **`build_work_units()`** (`boaw/exec.rs`): Partitions items by warp then by shard into work units |
| 49 | +- **`execute_work_queue()`** (`boaw/exec.rs`): Global work queue with atomic unit claiming |
| 50 | + - Single spawn site (no nested threading) |
| 51 | + - Workers claim `(warp, shard)` units via `AtomicUsize` |
| 52 | + - Views resolved per-unit, dropped before claiming next unit |
| 53 | + - Fixed worker pool sized to `available_parallelism()` |
| 54 | + |
| 55 | +### Changed - Cross-Warp Parallelism |
| 56 | + |
| 57 | +- **Engine execution** (`engine_impl.rs`): Replaced serial per-warp for-loop with global work queue |
| 58 | + - Previous: `for (warp_id, rewrites) in by_warp { execute_parallel_sharded(...) }` |
| 59 | + - Now: `execute_work_queue(&units, workers, |warp_id| state.store(warp_id))` |
| 60 | + - Multi-warp ticks now parallelize across all `(warp, shard)` units simultaneously |
| 61 | + |
8 | 62 | ### Changed - API |
9 | 63 |
|
10 | 64 | - **`WarpOpKey` now public** (`tick_patch.rs`): Export `WarpOpKey` from `warp_core` public API |
11 | 65 | - **`WarpOp::sort_key()` now public**: Changed from `pub(crate)` to `pub` to enable external determinism verification |
| 66 | +- **`compute_commit_hash_v2` now public** (`snapshot.rs`): Promoted from `pub(crate)` to `pub` and re-exported from `warp_core`; enables external Merkle chain verification |
| 67 | + |
| 68 | +### Removed - Tier 0 Cleanup |
| 69 | + |
| 70 | +- **Stride fallback** (`boaw/exec.rs`): Deleted `execute_parallel_stride()` and `parallel-stride-fallback` feature |
| 71 | + - Phase 6A stride execution superseded by Phase 6B sharded execution |
| 72 | + - Removed feature gate, env var check, and ASCII warning banner |
| 73 | +- **Deprecated `emit_view_op_delta()`** (`rules.rs`): Deleted non-deterministic function that used `delta.len()` sequencing |
| 74 | + |
| 75 | +### Fixed - Review Feedback |
| 76 | + |
| 77 | +- **P0: Off-by-one in `publish_truth`** (`playback.rs`): Query `prov_tick = cursor.tick - 1` (0-based index of last applied patch) instead of `cursor.tick`; added early-return guard for `cursor.tick == 0` |
| 78 | +- **P0: Wrong package in bench docs** (`docs/notes/boaw-perf-baseline.md`): Corrected `warp-core` → `warp-benches` |
| 79 | +- **P1: Merkle chain verification** (`playback.rs`): `seek_to` now verifies `patch_digest`, recomputes `commit_hash` via `compute_commit_hash_v2`, and tracks parent chain per tick; added `SeekError::PatchDigestMismatch` and `SeekError::CommitHashMismatch` variants |
| 80 | +- **P1: Dead variant removal** (`playback.rs`): Removed `SeekThen::RestorePrevious` (broken semantics; treated identically to `Pause`) |
| 81 | +- **P1: OOM prevention** (`materialization/frame_v2.rs`): Bound `entry_count` by remaining payload size in `decode_v2_packet` to prevent malicious allocation |
| 82 | +- **P1: Fork guard** (`provenance_store.rs`): Added `WorldlineAlreadyExists` error variant; `fork()` rejects duplicate worldline IDs |
| 83 | +- **P1: Dangling edge validation** (`worldline.rs`): `UpsertEdge` now verifies `from`/`to` nodes exist in store before applying |
| 84 | +- **P1: Silent skip → Result** (`boaw/exec.rs`): `execute_work_queue` returns `Result<Vec<TickDelta>, WarpId>` instead of panicking on missing store; caller maps to `EngineError::InternalCorruption` |
| 85 | +- **P2: Tilde-pin bytes dep** (`crates/warp-benches/Cargo.toml`): `bytes = "~1.11"` for minor-version stability |
| 86 | +- **P2: Markdownlint MD060** (`.markdownlint.json`): Removed global MD060 disable (all tables are well-formed; no false positives to suppress) |
| 87 | +- **P2: Test hardening** (`tests/`): Real `compute_commit_hash_v2` in all test worldline setups, u8 truncation guards (`num_ticks <= 127`), updated playback tests to match corrected `publish_truth` indexing |
| 88 | +- **Trivial: Phase 6B benchmark** (`boaw_baseline.rs`): Added `bench_work_queue` exercising full `build_work_units → execute_work_queue` pipeline across multi-warp setups |
| 89 | +- **Trivial: Perf baseline stats** (`docs/notes/boaw-perf-baseline.md`): Expanded statistical context note with sample size, CI methodology, and Criterion report location |
12 | 90 |
|
13 | 91 | ### Fixed - PR #257 Review |
14 | 92 |
|
|
49 | 127 | - Items in same shard processed together for cache locality |
50 | 128 | - Worker count capped at `min(workers, NUM_SHARDS)` to prevent over-threading |
51 | 129 |
|
52 | | -- **Stride fallback** (`boaw/exec.rs`): Feature-gated Phase 6A fallback |
53 | | - - Requires `parallel-stride-fallback` feature + `ECHO_PARALLEL_STRIDE=1` env var |
54 | | - - Prints loud ASCII warning banner when activated |
55 | | - - Temporary A/B benchmarking path; will be removed in a future release |
56 | | - |
57 | | -- **5 new Phase 6B tests** (`tests/boaw_parallel_exec.rs`): |
58 | | - - `sharded_equals_stride`: Key correctness proof for 6A → 6B transition |
59 | | - - `sharded_equals_stride_permuted`: Permutation invariance with sharded execution |
| 130 | +- **3 new Phase 6B tests** (`tests/boaw_parallel_exec.rs`): |
60 | 131 | - `worker_count_capped_at_num_shards`: Verifies cap at 256 workers |
61 | 132 | - `sharded_distribution_is_deterministic`: Shard routing stability |
62 | 133 | - `default_parallel_uses_sharded`: Default path verification |
|
0 commit comments