Skip to content

[Pre-1.0] G4 — Deterministic time in the rtc core #146

Description

@rainliu

rtc is described as sans-I/O: the protocol core is told what happened and returns what to do,and the caller owns every side effect. Time is a side effect like any other, and the core does not own it — it reads it.

72 non-test clock reads across the workspace, 51 of which affect protocol behaviour.

This is not only a testability problem. It means:

  • The core is not actually sans-I/O. A caller cannot reproduce a run, because the core samples a clock the caller never sees.
  • Two time lines may disagree inside a single call.
  • no_std is foreclosed. sansio::Protocol deliberately makes Time an associated type so a target can use u64 ticks. Every Instant::now() hard-codes std.
  • Deterministic replay of a bug report is impossible, which for a protocol stack is the single most valuable debugging tool there is.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions