Expand description
WavDiff + DiffPool + RollbackBuffer — 18-byte diff protocol with pre-allocated ring buffers for deterministic rollback.
All world mutations flow through WavDiff. The DiffPool is a 1.1MB
pre-allocated ring buffer that never grows. The RollbackBuffer stores
exactly 120 frames (1.0 second at 120Hz) of FrameSnapshot metadata
for prediction/correction rollback.
Zero heap allocation. Integer-only. Bitwise deterministic.
Structs§
- Diff
Pool - Pre-allocated 1.1MB ring buffer of
WavDiffentries. - Frame
Diff Iter - Forward iterator over a frame’s diffs in the DiffPool.
- Frame
Diff Reverse Iter - Reverse iterator over a frame’s diffs in the DiffPool.
- Frame
Range Iter - Forward iterator over frames in a tick range.
- Frame
Range Reverse Iter - Reverse iterator over frames in a tick range.
- Frame
Snapshot - Metadata snapshot for a single simulation frame.
- Rollback
Buffer - 120-frame ring buffer for prediction/correction rollback.
- WavDiff
- 18-byte diff record for a single state mutation.
Constants§
- POOL_
CAPACITY - Pre-allocated DiffPool capacity. 18 bytes × 64000 ≈ 1.125 MB — fits the 1.1MB budget with margin.
- ROLLBACK_
FRAMES - Rollback window: exactly 120 frames = 1.0 second at 120Hz. Architecturally locked — do not change.
Functions§
- compute_
tick_ checksum - Compute a Blake3 checksum of a frame’s diffs in the DiffPool.
- replay
- Replay diffs forward (old→new) to restore state after rewind.
- rewind
- Rewind state by applying diffs in reverse (new→old).