.zddsrec v1.0 — Recording format — Spec coverage

Source: docs/specs/zddsrec-1.0.md (ZeroDDS vendor spec, recording format for deterministic record-and-replay).

Context: .zddsrec is the ZeroDDS binary recording format — a header plus a frame stream with stable participant/topic indexes and a SampleKind encoding. Implemented in crates/recorder (forbid(unsafe_code)), 17 tests green.

Implementation:

  • crates/recorder/ · docs.rs — format codec (format.rs), writer (writer.rs), reader (reader.rs), thread-safe session (session.rs); 17 tests green.

§1 File structure — header + frames

Spec: docs/specs/zddsrec-1.0.md “File structure” — the file starts with a header (magic bytes + format version) followed by a stream of typed frames; the header appears exactly once and before all frames.

Repo: crates/recorder/src/format.rs (Header, MAGIC, Frame, FrameView), crates/recorder/src/writer.rs (RecordWriter), crates/recorder/src/reader.rs (RecordReader).

Tests: crates/recorder/src/format.rs::header_writes_magic_and_version, header_writes_magic_and_version, frame_roundtrip, header_must_come_before_frames, header_only_once, bad_magic_rejected, truncated_header_detected, truncated_frame_detected, write_all_helper.

Status: done

§2 Indexes — participant/topic tables

Spec: docs/specs/zddsrec-1.0.md “Indizes” — participant and topic entries are addressed via stable index references; frames carry a topic index instead of repeated strings.

Repo: crates/recorder/src/format.rs (ParticipantEntry, TopicEntry, TopicKey), crates/recorder/src/session.rs (index assignment + lookup).

Tests: crates/recorder/src/session.rs::tests::session_drops_unknown_topic, session_unknown_participant_falls_back_to_idx_zero, crates/recorder/src/writer.rs::frame_idx_must_be_in_range.

Status: done

§3 SampleKind encoding

Spec: docs/specs/zddsrec-1.0.md “SampleKind-Codierung” — every sample carries a SampleKind (Data / Dispose / Unregister …) as a compact wire code; unknown codes are rejected on read.

Repo: crates/recorder/src/format.rs (enum SampleKind + encode/decode).

Tests: crates/recorder/src/format.rs::tests::sample_kind_roundtrip, bad_sample_kind_rejected.

Status: done

§4 Versioning

Spec: docs/specs/zddsrec-1.0.md “Versionierung” — the format version is in the header; a reader explicitly rejects unsupported major versions (additive 2.0 hooks without breaking the 1.0 wire form).

Repo: crates/recorder/src/format.rs (Header version field + read-time check).

Tests: crates/recorder/src/reader.rs::unsupported_version_rejected, header_writes_magic_and_version.

Status: done

§5 Recording session — thread-safe, lazy header

Spec: docs/specs/zddsrec-1.0.md “File structure”/“Use cases” — a session records samples concurrently; the header is written on the first sample; several threads may record at the same time.

Repo: crates/recorder/src/session.rs (RecordingSession, SessionOptions, SessionStats).

Tests: crates/recorder/src/session.rs::tests::session_thread_safe_record, session_writes_header_lazy_on_first_sample.

Status: done

§6 Goals, use cases, stability and roadmap

Spec: docs/specs/zddsrec-1.0.md “Goals”, “Use cases”, “Stability and roadmap” — motivation, use cases (crash reproduction, forensic diff, soak replay) and the extensions planned for 2.0.

Repo: —

Tests: —

Status: n/a (informative) — purpose, use cases and outlook.

§6 Tooling

Spec: docs/specs/zddsrec-1.0.md “Tooling” — crates/recorder as the API for applications; tools/replay (zerodds-replay) to inspect, dump and replay (--time-scale); tools/recorder-bridge to record from a running domain.

Repo: —

Tests: —

Status: open — tools/replay/src/main.rs (commands inspect, dump, replay, option --time-scale) and tools/recorder-bridge/src/main.rs exist; neither binary has a test. The library crates/recorder is listed in §1 to §5.


Audit status

5 done / 0 partial / 1 open / 0 blocked / 1 n/a (informative).

Test run: cargo test -p zerodds-recorder — 17 tests green, 0 failed.

Open items: zddsrec-1.0.open.en.md.

.zddsrec v1.0 — Recording-Format — Spec-Coverage

Quelle: docs/specs/zddsrec-1.0.md (ZeroDDS-Vendor-Spec, Recording-Format für deterministisches Record-and-Replay).

Kontext: .zddsrec ist das binäre Aufzeichnungsformat von ZeroDDS — Header + Frame-Stream mit stabilen Indizes für Participant/Topic, plus SampleKind-Codierung. Implementiert in crates/recorder (forbid(unsafe_code)), 17 Tests grün.

Implementation:

  • crates/recorder/ · docs.rs — Format-Codec (format.rs), Writer (writer.rs), Reader (reader.rs), thread-safe Session (session.rs); 17 Tests grün.

§1 Datei-Struktur — Header + Frames

Spec: docs/specs/zddsrec-1.0.md „Datei-Struktur” — Datei beginnt mit einem Header (Magic-Bytes + Format-Version), gefolgt von einem Stream typisierter Frames; Header genau einmal und vor allen Frames.

Repo: crates/recorder/src/format.rs (Header, MAGIC, Frame, FrameView), crates/recorder/src/writer.rs (RecordWriter), crates/recorder/src/reader.rs (RecordReader).

Tests: crates/recorder/src/format.rs::header_writes_magic_and_version, header_writes_magic_and_version, frame_roundtrip, header_must_come_before_frames, header_only_once, bad_magic_rejected, truncated_header_detected, truncated_frame_detected, write_all_helper.

Status: done

§2 Indizes — Participant/Topic-Tabellen

Spec: docs/specs/zddsrec-1.0.md „Indizes” — Participant- und Topic-Einträge werden über stabile Index-Referenzen adressiert; Frames tragen einen Topic-Index statt wiederholter Strings.

Repo: crates/recorder/src/format.rs (ParticipantEntry, TopicEntry, TopicKey), crates/recorder/src/session.rs (Index-Vergabe + Lookup).

Tests: crates/recorder/src/session.rs::tests::session_drops_unknown_topic, session_unknown_participant_falls_back_to_idx_zero, crates/recorder/src/writer.rs::frame_idx_must_be_in_range.

Status: done

§3 SampleKind-Codierung

Spec: docs/specs/zddsrec-1.0.md „SampleKind-Codierung” — jedes Sample trägt einen SampleKind (Data / Dispose / Unregister …) als kompakten Wire-Code; unbekannte Codes werden beim Lesen abgewiesen.

Repo: crates/recorder/src/format.rs (enum SampleKind + Encode/Decode).

Tests: crates/recorder/src/format.rs::tests::sample_kind_roundtrip, bad_sample_kind_rejected.

Status: done

§4 Versionierung

Spec: docs/specs/zddsrec-1.0.md „Versionierung” — die Format-Version steht im Header; ein Reader weist nicht unterstützte Major-Versionen explizit ab (additive 2.0-Hooks ohne Bruch der 1.0-Wire-Form).

Repo: crates/recorder/src/format.rs (Header-Version-Feld + Check beim Read).

Tests: crates/recorder/src/reader.rs::unsupported_version_rejected, header_writes_magic_and_version.

Status: done

§5 Aufzeichnungs-Session — thread-safe, lazy Header

Spec: docs/specs/zddsrec-1.0.md „Datei-Struktur”/„Use-Cases” — eine Session nimmt nebenläufig Samples auf; der Header wird beim ersten Sample geschrieben; mehrere Threads dürfen gleichzeitig aufzeichnen.

Repo: crates/recorder/src/session.rs (RecordingSession, SessionOptions, SessionStats).

Tests: crates/recorder/src/session.rs::tests::session_thread_safe_record, session_writes_header_lazy_on_first_sample.

Status: done

§6 Ziele, Use-Cases, Stabilität und Roadmap

Spec: docs/specs/zddsrec-1.0.md „Goals”, „Use cases”, „Stability and roadmap” — Motivation, Anwendungsfälle (Crash-Reproduktion, forensischer Vergleich, Soak-Replay) und die für 2.0 geplanten Erweiterungen.

Repo: —

Tests: —

Status: n/a (informative) — Zweck, Anwendungsfälle und Ausblick.

§6 Tooling

Spec: docs/specs/zddsrec-1.0.md „Tooling” — crates/recorder als API für Anwendungen; tools/replay (zerodds-replay) zum Ansehen, Ausgeben und Wiedereinspielen (--time-scale); tools/recorder-bridge zum Aufzeichnen aus einer laufenden Domain.

Repo: —

Tests: —

Status: open — tools/replay/src/main.rs (Befehle inspect, dump, replay, Option --time-scale) und tools/recorder-bridge/src/main.rs sind vorhanden; keiner der beiden Binaries hat einen Test. Die Bibliothek crates/recorder ist in §1 bis §5 geführt.


Audit-Status

5 done / 0 partial / 1 open / 0 blocked / 1 n/a (informative).

Test-Lauf: cargo test -p zerodds-recorder — 17 Tests grün, 0 failed.

Offene Punkte: zddsrec-1.0.open.md.