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§
- Isomorphism
Proof - Evidence for an isomorphism proof.
- Schedule
Trace - The main schedule trace recorder.
- Trace
Config - Configuration for the schedule trace.
- Trace
Entry - A timestamped trace entry.
- Trace
Summary - Summary statistics for a trace.
Enums§
- Cancel
Reason - Reason for task cancellation.
- Golden
Compare Result - Result of comparing a trace against a golden checksum.
- Scheduler
Policy - Scheduler policy identifier.
- Task
Event - A scheduler event with deterministic ordering.
- Wakeup
Reason - Reason for task wakeup.
Functions§
- compare_
golden - Compare trace against expected golden checksum.