Skip to content

Commit f64316a

Browse files
Merge pull request #661 from frankmcsherry/further_docs
Further articulate assumed properties
2 parents 72f34aa + 6b52aac commit f64316a

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

timely/src/progress/timestamp.rs

+9-5
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ use crate::order::PartialOrder;
1515
pub trait Timestamp: Clone+Eq+PartialOrder+Debug+Send+Any+ExchangeData+Hash+Ord {
1616
/// A type summarizing action on a timestamp along a dataflow path.
1717
type Summary : PathSummary<Self> + 'static;
18-
/// A unique minimum value in our partial order, suitable as a default.
18+
/// A unique minimum value in our partial order.
19+
///
20+
/// This value will often be used as an initial value, and should be cheap to construct.
1921
fn minimum() -> Self;
2022
}
2123

@@ -31,12 +33,14 @@ pub trait PathSummary<T> : Clone+'static+Eq+PartialOrder+Debug+Default {
3133
/// in computation, uses this method and will drop messages with timestamps that when advanced
3234
/// result in `None`. Ideally, all other timestamp manipulation should behave similarly.
3335
///
34-
/// This summary's partial order is expected to be compatible with the partial order of [T],
35-
/// in the sense that if `s1.less_equal(s2)`, then `s1.results_in(&t)` is less than or equal to
36-
/// `s2.results_in(&t)`.
36+
/// This function must be monotonic increasing in both inputs.
37+
/// If `s1.less_equal(&s2)` then for all `t` we have `s1.results_in(&t).less_equal(&s2.results_in(&t))`.
38+
/// If `t1.less_equal(&t2)` then for all `s` we have `s.results_in(&t1).less_equal(&s.results_in(&t2))`.
3739
///
3840
/// Note that `Self::default()` is expected to behave as an "empty" or "noop" summary, such that
39-
/// `Self::default().results_in(&t) == Some(t)`.
41+
/// `Self::default().results_in(&t) == Some(t)`. The default summary does not need to be a minimal
42+
/// summary, in that summaries are technically permitted to walk timestamps backwards. Care should
43+
/// be used when doing this to avoid potentially cyclic dataflows without strict timestamp advancement.
4044
///
4145
/// # Examples
4246
/// ```

0 commit comments

Comments
 (0)