-
Notifications
You must be signed in to change notification settings - Fork 35
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
docs: improve multiset_delta()
docs
#830
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revise, as I'm still finding it ambigous
/// released out. Conversely, `unique` take repeated items in, and only releases the new ones out. | ||
/// | ||
/// This operator does a similar inversion but for multiset semantics, with some caveats. When it | ||
/// receives duplicate items, instead of ignoring them, it "subtracts" them from the items received |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"subtracts" is confusing. Why not say "if we received k
copies of an item in the previous tick, and we receive l > k
copies in the current tick, we output l - k
copies of the item."
/// This operator does a similar inversion but for multiset semantics, with some caveats. When it | ||
/// receives duplicate items, instead of ignoring them, it "subtracts" them from the items received | ||
/// in the previous tick, and only releases new items if there are more than in the previous tick. | ||
/// However unlike `unique`, this count is only maintained for the previous tick, not over all time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given the proposed rewording above, maybe rephrase to match.
I'm actually confused as to whether it remembers the MAX number of copies over time, or just the last tick number? If it's MAX, then we should probably implement a generic lattice_delta
, where this is a specific one for multiset lattices. If it's not MAX, then I'd like to discuss semantics --- it'd be weird for this to be the only 1-tick windowed operator (other than next_tick
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is only the previous tick. The semantics become weird if it's not somewhere after a persist
operator
/// // 5, 3 | ||
/// // First two "3"s are removed due to previous tick. | ||
/// // 'c', 'a' | ||
/// // First two 'a's are removed due to previous tick. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Give an example of the 3rd tick to clarify what confuses me above about MAX over all time vs last tick?
OK as a separate issue we should review semantics, understand how Shadaj is
using it, see if we can design something less weird
…On Mon, Jul 10, 2023 at 10:51 PM Mingwei Samuel ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In hydroflow_lang/src/graph/ops/multiset_delta.rs
<#830 (comment)>
:
> @@ -5,30 +5,43 @@ use super::{
WriteContextArgs, RANGE_0, RANGE_1,
};
-// TODO(mingwei): more doc
-/// Multiset delta from the previous tick.
+/// The multiset inverse of [`persist()`](#persist).
+///
+/// > 1 input stream of `T`, 1 output stream of `T`, where `T: Eq + Hash`
+///
+/// For set semantics, [`unique()`](#unique) can be thought of as a "delta" operator, the inverse
+/// of [`persist()`](#persist). In `persist`, new items come in, and all items are repeatedly
+/// released out. Conversely, `unique` take repeated items in, and only releases the new ones out.
+///
+/// This operator does a similar inversion but for multiset semantics, with some caveats. When it
+/// receives duplicate items, instead of ignoring them, it "subtracts" them from the items received
+/// in the previous tick, and only releases new items if there are more than in the previous tick.
+/// However unlike `unique`, this count is only maintained for the previous tick, not over all time.
It is only the previous tick. The semantics become weird if it's not
somewhere after a persist operator
—
Reply to this email directly, view it on GitHub
<#830 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAC54QJZNSPYFPL5OGZV4XTXPTSV7ANCNFSM6AAAAAA2E2MYJY>
.
You are receiving this because your review was requested.Message ID:
***@***.***>
|
0cec25f
to
845c2a5
Compare
e9a87eb
to
6039078
Compare
4f84634
to
0e64791
Compare
fb8b3b3
to
a2ec110
Compare
No description provided.