Skip to main content

Module schedule_trace

Module schedule_trace 

Source
Expand description

Schedule Trace Module (bd-gyi5).

Provides deterministic golden trace infrastructure for async task manager testing. Records scheduler events (task start/stop, wakeups, yields, cancellations) and generates stable checksums for regression detection.

§Core Algorithm

  • Events are recorded with monotonic sequence numbers (not wall-clock)
  • Traces are hashed using FNV-1a for stability across platforms
  • Isomorphism proofs validate that behavioral changes preserve invariants

§Example

use ftui_runtime::schedule_trace::{ScheduleTrace, TaskEvent};

let mut trace = ScheduleTrace::new();

// Record events
trace.record(TaskEvent::Spawn { task_id: 1, priority: 0 });
trace.record(TaskEvent::Start { task_id: 1 });
trace.record(TaskEvent::Complete { task_id: 1 });

// Generate checksum
let checksum = trace.checksum();

// Export for golden comparison
let json = trace.to_jsonl();

Structs§

IsomorphismProof
Evidence for an isomorphism proof.
ScheduleTrace
The main schedule trace recorder.
TraceConfig
Configuration for the schedule trace.
TraceEntry
A timestamped trace entry.
TraceSummary
Summary statistics for a trace.

Enums§

CancelReason
Reason for task cancellation.
GoldenCompareResult
Result of comparing a trace against a golden checksum.
SchedulerPolicy
Scheduler policy identifier.
TaskEvent
A scheduler event with deterministic ordering.
WakeupReason
Reason for task wakeup.

Functions§

compare_golden
Compare trace against expected golden checksum.