Resonant Time Daemon (RTD) – Gen1
Purpose#
The RTD is the single source of truth for phase windows and cadence in Gen1.
It runs as a host‑level service, publishing timing events to all nine dimensions via a Unix domain socket and shared memory.
Responsibilities#
- Maintain a monotonic counter and phase window schedule.
- Publish
WINDOW_TICKmessages at the start of each dimension’s window. - Handle subscription and unsubscription requests from dimension workloads.
- Provide token minting for execution credits per window.
Socket Interface#
- Path:
/run/vcg/rt.sock - Message Types:
SUBSCRIBE {client_id, dimension_id}UNSUBSCRIBE {client_id, dimension_id}WINDOW_TICK {dimension_id, seq, t_start_ns, t_end_ns, phase_deg}REQUEST_TOKEN {client_id, dimension_id, budget_units, deadline_ns}TOKEN_GRANTED {dimension_id, budget_units, valid_from_ns, expires_ns, priority}TOKEN_DENIED {dimension_id, reason, retry_after_ns}
Timing Model#
- Cadence: Base frequency
fconfigurable; harmonics assigned perdimensions.yml. - Phase Offsets: Degrees offset from base cycle start.
- Window Duration: Derived from harmonic; e.g., harmonic 2 = half base period.
Implementation Notes#
- Language: Rust (preferred for low‑latency and safety).
- Time Source:
CLOCK_MONOTONIC_RAWfor stability. - Publish Mechanism:
- Unix datagram for control messages.
- Shared memory ring buffer for high‑rate tick events.
- Startup: Reads
dimensions.ymlto configure cadence and offsets. - Error Handling: Logs drift > threshold; can trigger orchestrator backpressure.
Metrics#
window_jitter_nsphase_skew_degtokens_mintedtokens_consumedtokens_dropped