Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document various trait invariants / requirements #516

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

bkirwi
Copy link

@bkirwi bkirwi commented Mar 17, 2023

Some of these I have picked up in conversation; others come from documenting what the code seems to assume. Happy to be corrected if I got something wrong!

@@ -28,14 +31,21 @@ pub trait PathSummary<T> : Clone+'static+Eq+PartialOrder+Debug+Default {
/// in computation, uses this method and will drop messages with timestamps that when advanced
/// result in `None`. Ideally, all other timestamp manipulation should behave similarly.
///
/// This summary's partial order is expected to be compatible with the partial order of [T],
/// in the sense that if `s1.less_equal(s2)`, then `s1.results_in(&t)` is less than or equal to
/// `s2.results_in(&t)`.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems clear that we do assume roughly that the smallest summary advances the timestamp the least, but I'm not confident I have this description exactly right.

/// `s2.results_in(&t)`.
///
/// Note that `Self::default()` is expected to behave as an "empty" or "noop" summary, such that
/// `Self::default().results_in(&t) == Some(t)`.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cycle checking seems to assume that non-default summaries always advance the timestamp. Is that a requirement?

At time of writing, I'm not sure about the exact relationship here, but
there definitely ought to be one!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant