Skip to content

Comments

WIP: Differential corrected atop candidate timely 0.27#671

Draft
frankmcsherry wants to merge 3 commits intoTimelyDataflow:masterfrom
frankmcsherry:timely_27
Draft

WIP: Differential corrected atop candidate timely 0.27#671
frankmcsherry wants to merge 3 commits intoTimelyDataflow:masterfrom
frankmcsherry:timely_27

Conversation

@frankmcsherry
Copy link
Member

@frankmcsherry frankmcsherry commented Feb 24, 2026

Many things to discuss, but thought I'd put this up so we can see the horror. Only builds locally against a local timely check-out, so the red is not surprising.

The changes here are mainly in response to

  1. Streams are now consumed by most operators, rather than taken as a reference.
  2. Streams are now container-first, rather than vec-first.

The first one was the larger problem, as far as I could tell. There are a lot of new explicit .clone() calls, that were 100% implicit before. But they are here now and a bit in the way, often. There are a few painful moments that happened a lot:

  1. We needed a .scope() later on, but the stream has already been consumed.
  2. We have a Variable and it's Deref impl gave us access to the stream; now we call .clone() as a hack.
  3. Arranged is generally consumed as well, though there are moments where we don't need all of it, but can't deconstruct and share the parts around.

/// });
/// ```
pub fn concatenate<I>(&self, sources: I) -> Self
pub fn concatenate<I>(self, sources: I) -> Self
Copy link
Member

Choose a reason for hiding this comment

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

Consider removing the concatenate function as we did in Timely, or make it an associated function.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hrm. I'm looking at the implementation and it feels easy enough. Is the suggestion just to bring it to parity with timely? We could also add it back to timely, which lost it for an unclear to me reason (I agree I did it, but perhaps it shouldn't have).

Copy link
Member Author

Choose a reason for hiding this comment

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

I think the reason TD lost it is because the argument would need to change to self, which is totally possible (scopes can be cloned), but that wasn't as obvious at the moment.

.count();

let odds = counts.filter(|x| x.1 % 2 == 1);
let odds = counts.clone().filter(|x| x.1 % 2 == 1);
Copy link
Member Author

Choose a reason for hiding this comment

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

This change, and a few others like it, call out the benefit of partition.

Comment on lines -56 to +57
let propose0 = index_xz.propose(&parts[0].as_collection());
let propose1 = index_yz.propose(&parts[1].as_collection());
let propose0 = index_xz.propose(parts[0].clone().as_collection());
let propose1 = index_yz.propose(parts[1].clone().as_collection());
Copy link
Member Author

Choose a reason for hiding this comment

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

We used partition but end up preparing a clone anyhow. It won't actually clone, but the additional vcall will happen. Worth watching to see about improving the ergonomics / patterns.

@frankmcsherry
Copy link
Member Author

A next step I'm going to try out is understanding Variable and any ways in which we can avoid needing a .clone() to sneak access to the underlying collection through the Deref implementation. It all feels a bit complicated. Perhaps a .collection() method (which clones), and perhaps some follow-on thinking about whether stapling all of these types together is the best thing.

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.

2 participants