1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/
//! Bounded observations of a faithful preemption replay leaving its history.
//! These observations do not establish a timer cause or a common replay prefix.
use serde::Deserialize;
use serde::Serialize;
use crate::pid::DetTid;
use crate::time::LogicalTime;
/// The production point that observed a nonadvancing change point.
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
pub enum Source {
/// The thread could not file its next change point.
ThreadFiling,
/// The scheduler omitted a change point from its output history.
SchedulerChangePoint,
}
/// One observed change point, with coordinates from the observing run.
#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
pub struct Finding {
/// The production observer, selected by the coordinator.
pub source: Source,
/// The authenticated thread, not an independently supplied payload ID.
pub thread: DetTid,
/// The preceding change point's logical time.
pub previous: LogicalTime,
/// The new change point's logical time, at or before `previous`.
pub observed: LogicalTime,
/// The thread's slice counter where the thread itself observed the finding.
pub slice: Option<u64>,
/// The new recording's observed event count at acceptance, if recording.
/// This is not an input-history index or an exact common-prefix length.
pub recorded_event_count: Option<u64>,
}
/// A bounded run diagnostic: detections are counted, only the first is retained.
#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
pub struct Summary {
/// Number of accepted detections, not distinct physical causes.
pub count: u64,
/// The first accepted observation in the run's deterministic order.
pub first: Finding,
}