Skip to main contentThe Time Index Track adds deterministic timestamps to the file:
- Defined in
memvid-core/src/io/time_index.rs
- Uses
TIME_INDEX_MAGIC = MVTI header followed by entry count and (timestamp, frame_id) tuples
Memvid::commit() sorts buffered entries, writes them immediately before the TOC, calculates A BLAKE3 checksum, and updates Toc.time_index
Stats.has_time_index surfaces to CLI and SDKs to show readiness
Query behavior
- CLI/SDK builds a
TimelineQuery specifying start_ts, end_ts, and optional limit
- Core memory-maps the track and binary-searches for the first entry ≥
start_ts
- It iterates sequentially until
end_ts or limit is reached, returning TimelineEntry structs referencing the canonical frames
If the track is absent, the kernel falls back to scanning frames inside the TOC, which is slower but preserves correctness.
Repair commands
memvid doctor --file demo.mv2 --rebuild-time-index rebuilds the track from frame metadata, as mandated by the Golden Test Pack (CLI-009). The report lists action plans, severity, and status codes defined in DoctorReport/DoctorActionDetail.
Testing - The crash harness and determinism suite must validate timeline queries after every recovery scenario to ensure the track was correctly replayed from the WAL.