Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
os:
- ubuntu
- macos
- windows
# - windows
toolchain:
- stable
- 1.78
Copy link
Member

Choose a reason for hiding this comment

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

1.79 should work!

Copy link
Member Author

Choose a reason for hiding this comment

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

Will fix!

Copy link
Member Author

Choose a reason for hiding this comment

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

Might also delete windows, but .. really would rather not. :D

- 1.79
name: cargo test on ${{ matrix.os }}, rust ${{ matrix.toolchain }}
runs-on: ${{ matrix.os }}-latest
steps:
Expand Down
6 changes: 2 additions & 4 deletions advent_of_code_2017/src/bin/day_09.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ fn main() {
/// Accumulate data in `collection` into all powers-of-two intervals containing them.
fn pp_aggregate<G, D, F>(collection: Collection<G, (usize, D)>, combine: F) -> Collection<G, ((usize, usize), D)>
where
G: Scope,
G::Timestamp: Lattice,
G: Scope<Timestamp: Lattice>,
D: Data,
F: Fn(D, &D) -> D + 'static,
{
Expand Down Expand Up @@ -132,8 +131,7 @@ fn pp_broadcast<G, D, B, F>(
zero: D,
combine: F) -> Collection<G, (usize, B)>
where
G: Scope,
G::Timestamp: Lattice+Ord+::std::fmt::Debug,
G: Scope<Timestamp: Lattice+Ord+::std::fmt::Debug>,
D: Data,
B: Data+::std::hash::Hash,
F: Fn(&B, &D) -> B + 'static,
Expand Down
7 changes: 4 additions & 3 deletions differential-dataflow/examples/bfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,10 @@ fn main() {
}

// returns pairs (n, s) indicating node n can be reached from a root in s steps.
fn bfs<G: Scope>(edges: &Collection<G, Edge>, roots: &Collection<G, Node>) -> Collection<G, (Node, u32)>
where G::Timestamp: Lattice+Ord {

fn bfs<G>(edges: &Collection<G, Edge>, roots: &Collection<G, Node>) -> Collection<G, (Node, u32)>
where
G: Scope<Timestamp: Lattice+Ord>,
{
// initialize roots as reaching themselves at distance 0
let nodes = roots.map(|x| (x, 0));

Expand Down
19 changes: 8 additions & 11 deletions differential-dataflow/examples/columnar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ mod container {
fn default() -> Self { Self::Typed(Default::default()) }
}

impl<C: Columnar> Clone for Column<C> where C::Container: Clone {
impl<C: Columnar<Container: Clone>> Clone for Column<C> {
fn clone(&self) -> Self {
match self {
Column::Typed(t) => Column::Typed(t.clone()),
Expand Down Expand Up @@ -213,7 +213,7 @@ mod container {
}

use timely::container::PushInto;
impl<C: Columnar, T> PushInto<T> for Column<C> where C::Container: columnar::Push<T> {
impl<T, C: Columnar<Container: columnar::Push<T>>> PushInto<T> for Column<C> {
#[inline]
fn push_into(&mut self, item: T) {
use columnar::Push;
Expand Down Expand Up @@ -286,7 +286,7 @@ mod builder {
}

use timely::container::PushInto;
impl<C: Columnar, T> PushInto<T> for ColumnBuilder<C> where C::Container: columnar::Push<T> {
impl<T, C: Columnar<Container: columnar::Push<T>>> PushInto<T> for ColumnBuilder<C> {
#[inline]
fn push_into(&mut self, item: T) {
self.current.push(item);
Expand Down Expand Up @@ -314,7 +314,7 @@ mod builder {
}

use timely::container::{ContainerBuilder, LengthPreservingContainerBuilder};
impl<C: Columnar> ContainerBuilder for ColumnBuilder<C> where C::Container: Clone {
impl<C: Columnar<Container: Clone>> ContainerBuilder for ColumnBuilder<C> {
type Container = Column<C>;

#[inline]
Expand Down Expand Up @@ -342,7 +342,7 @@ mod builder {
}
}

impl<C: Columnar> LengthPreservingContainerBuilder for ColumnBuilder<C> where C::Container: Clone { }
impl<C: Columnar<Container: Clone>> LengthPreservingContainerBuilder for ColumnBuilder<C> { }
}


Expand Down Expand Up @@ -396,12 +396,9 @@ pub mod batcher {

impl<'a, D, T, R, C2> PushInto<&'a mut Column<(D, T, R)>> for Chunker<C2>
where
D: Columnar,
for<'b> D::Ref<'b>: Ord + Copy,
T: Columnar,
for<'b> T::Ref<'b>: Ord + Copy,
R: Columnar + Semigroup + for<'b> Semigroup<R::Ref<'b>>,
for<'b> R::Ref<'b>: Ord,
D: for<'b> Columnar<Ref<'b>: Ord>,
T: for<'b> Columnar<Ref<'b>: Ord>,
R: for<'b> Columnar<Ref<'b>: Ord> + for<'b> Semigroup<R::Ref<'b>>,
C2: Container + for<'b> PushInto<&'b (D, T, R)>,
{
fn push_into(&mut self, container: &'a mut Column<(D, T, R)>) {
Expand Down
7 changes: 4 additions & 3 deletions differential-dataflow/examples/dynamic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,10 @@ fn main() {
}

// returns pairs (n, s) indicating node n can be reached from a root in s steps.
fn bfs<G: Scope>(edges: &Collection<G, Edge>, roots: &Collection<G, Node>) -> Collection<G, (Node, u32)>
where G::Timestamp: Lattice+Ord {

fn bfs<G>(edges: &Collection<G, Edge>, roots: &Collection<G, Node>) -> Collection<G, (Node, u32)>
where
G: Scope<Timestamp: Lattice+Ord>,
{
use timely::order::Product;
use iterate::Variable;
use differential_dataflow::dynamic::{feedback_summary, pointstamp::PointStamp};
Expand Down
11 changes: 6 additions & 5 deletions differential-dataflow/examples/graspan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ type Arrange<G,K,V,R> = Arranged<G, TraceValHandle<K, V, <G as ScopeParent>::Tim
///
/// An edge variable provides arranged representations of its contents, even before they are
/// completely defined, in support of recursively defined productions.
pub struct EdgeVariable<G: Scope> where G::Timestamp : Lattice {
pub struct EdgeVariable<G: Scope<Timestamp: Lattice>> {
variable: Variable<G, Edge, Diff>,
current: Collection<G, Edge, Diff>,
forward: Option<Arrange<G, Node, Node, Diff>>,
reverse: Option<Arrange<G, Node, Node, Diff>>,
}

impl<G: Scope> EdgeVariable<G> where G::Timestamp : Lattice {
impl<G: Scope<Timestamp: Lattice>> EdgeVariable<G> {
/// Creates a new variable initialized with `source`.
pub fn from(source: &Collection<G, Edge>, step: <G::Timestamp as Timestamp>::Summary) -> Self {
let variable = Variable::new(&mut source.scope(), step);
Expand Down Expand Up @@ -152,9 +152,10 @@ impl Query {
}

/// Creates a dataflow implementing the query, and returns input and trace handles.
pub fn render_in<G: Scope>(&self, scope: &mut G) -> IndexMap<String, RelationHandles<G::Timestamp>>
where G::Timestamp: Lattice+::timely::order::TotalOrder {

pub fn render_in<G>(&self, scope: &mut G) -> IndexMap<String, RelationHandles<G::Timestamp>>
where
G: Scope<Timestamp: Lattice+::timely::order::TotalOrder>,
{
// Create new input (handle, stream) pairs
let mut input_map = IndexMap::new();
for production in self.productions.iter() {
Expand Down
6 changes: 4 additions & 2 deletions differential-dataflow/examples/interpreted.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ fn main() {
}).unwrap();
}

fn interpret<G: Scope>(edges: &Collection<G, Edge>, relations: &[(usize, usize)]) -> Collection<G, Vec<Node>>
where G::Timestamp: Lattice+Hash+Ord {
fn interpret<G>(edges: &Collection<G, Edge>, relations: &[(usize, usize)]) -> Collection<G, Vec<Node>>
where
G: Scope<Timestamp: Lattice+Hash+Ord>,
{

// arrange the edge relation three ways.
let as_self = edges.arrange_by_self();
Expand Down
4 changes: 2 additions & 2 deletions differential-dataflow/examples/itembased_cf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ impl CRP {
CRP { alpha, discount, weight: 0.0, weights: Vec::new() }
}

fn sample<R>(&mut self, rng: &mut R) -> u32 where R: Rng {
fn sample<R: Rng>(&mut self, rng: &mut R) -> u32 {
let mut u = rng.gen::<f64>() * (self.alpha + self.weight);
for j in 0 .. self.weights.len() {
if u < self.weights[j] - self.discount {
Expand All @@ -164,7 +164,7 @@ impl CRP {
}

// Generate synthetic interactions with a skewed distribution
fn generate_interactions<R>(how_many: usize, rng: &mut R) -> Vec<(u32,u32)> where R: Rng {
fn generate_interactions<R: Rng>(how_many: usize, rng: &mut R) -> Vec<(u32,u32)> {
let mut interactions = Vec::with_capacity(how_many);

let mut user_sampler = CRP::new(6000.0, 0.35);
Expand Down
7 changes: 4 additions & 3 deletions differential-dataflow/examples/monoid-bfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,10 @@ fn main() {
}

// returns pairs (n, s) indicating node n can be reached from a root in s steps.
fn bfs<G: Scope>(edges: &Collection<G, Edge, MinSum>, roots: &Collection<G, Node, MinSum>) -> Collection<G, Node, MinSum>
where G::Timestamp: Lattice+Ord {

fn bfs<G>(edges: &Collection<G, Edge, MinSum>, roots: &Collection<G, Node, MinSum>) -> Collection<G, Node, MinSum>
where
G: Scope<Timestamp: Lattice+Ord>,
{
// repeatedly update minimal distances each node can be reached from each root
roots.scope().iterative::<u32,_,_>(|scope| {

Expand Down
3 changes: 1 addition & 2 deletions differential-dataflow/examples/pagerank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ fn main() {
// to its PageRank in the input graph `edges`.
fn pagerank<G>(iters: Iter, edges: &Collection<G, Edge, Diff>) -> Collection<G, Node, Diff>
where
G: Scope,
G::Timestamp: Lattice,
G: Scope<Timestamp: Lattice>,
{
// initialize many surfers at each node.
let nodes =
Expand Down
16 changes: 8 additions & 8 deletions differential-dataflow/examples/progress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,14 @@ fn main() {
///
/// The computation to determine this, and to maintain it as times change, is an iterative
/// computation that propagates times and maintains the minimal elements at each location.
fn frontier<G: Scope, T: Timestamp>(
fn frontier<G, T>(
nodes: Collection<G, (Target, Source, T::Summary)>,
edges: Collection<G, (Source, Target)>,
times: Collection<G, (Location, T)>,
) -> Collection<G, (Location, T)>
where
G::Timestamp: Lattice+Ord,
T::Summary: differential_dataflow::ExchangeData,
G: Scope<Timestamp: Lattice+Ord>,
T: Timestamp<Summary: differential_dataflow::ExchangeData>,
{
// Translate node and edge transitions into a common Location to Location edge with an associated Summary.
let nodes = nodes.map(|(target, source, summary)| (Location::from(target), (Location::from(source), summary)));
Expand All @@ -148,13 +148,13 @@ where
}

/// Summary paths from locations to operator zero inputs.
fn summarize<G: Scope, T: Timestamp>(
fn summarize<G, T>(
nodes: Collection<G, (Target, Source, T::Summary)>,
edges: Collection<G, (Source, Target)>,
) -> Collection<G, (Location, (Location, T::Summary))>
where
G::Timestamp: Lattice+Ord,
T::Summary: differential_dataflow::ExchangeData+std::hash::Hash,
G: Scope<Timestamp: Lattice+Ord>,
T: Timestamp<Summary: differential_dataflow::ExchangeData+std::hash::Hash>,
{
// Start from trivial reachability from each input to itself.
let zero_inputs =
Expand Down Expand Up @@ -196,8 +196,8 @@ fn find_cycles<G: Scope, T: Timestamp>(
edges: Collection<G, (Source, Target)>,
) -> Collection<G, (Location, Location)>
where
G::Timestamp: Lattice+Ord,
T::Summary: differential_dataflow::ExchangeData,
G: Scope<Timestamp: Lattice+Ord>,
T: Timestamp<Summary: differential_dataflow::ExchangeData>,
{
// Retain node connections along "default" timestamp summaries.
let nodes = nodes.flat_map(|(target, source, summary)| {
Expand Down
7 changes: 4 additions & 3 deletions differential-dataflow/examples/stackoverflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,10 @@ fn main() {
}

// returns pairs (n, s) indicating node n can be reached from a root in s steps.
fn bfs<G: Scope>(edges: &Collection<G, Edge>, roots: &Collection<G, Node>) -> Collection<G, (Node, u32)>
where G::Timestamp: Lattice+Ord {

fn bfs<G>(edges: &Collection<G, Edge>, roots: &Collection<G, Node>) -> Collection<G, (Node, u32)>
where
G: Scope<Timestamp: Lattice+Ord>,
{
// initialize roots as reaching themselves at distance 0
let nodes = roots.map(|x| (x, 0));

Expand Down
3 changes: 1 addition & 2 deletions differential-dataflow/src/algorithms/graphs/bfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ use crate::lattice::Lattice;
/// Returns pairs (node, dist) indicating distance of each node from a root.
pub fn bfs<G, N>(edges: &Collection<G, (N,N)>, roots: &Collection<G, N>) -> Collection<G, (N,u32)>
where
G: Scope,
G::Timestamp: Lattice+Ord,
G: Scope<Timestamp: Lattice+Ord>,
N: ExchangeData+Hash,
{
use crate::operators::arrange::arrangement::ArrangeByKey;
Expand Down
3 changes: 1 addition & 2 deletions differential-dataflow/src/algorithms/graphs/bijkstra.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ use crate::operators::iterate::Variable;
/// could be good insurance here.
pub fn bidijkstra<G, N>(edges: &Collection<G, (N,N)>, goals: &Collection<G, (N,N)>) -> Collection<G, ((N,N), u32)>
where
G: Scope,
G::Timestamp: Lattice+Ord,
G: Scope<Timestamp: Lattice+Ord>,
N: ExchangeData+Hash,
{
use crate::operators::arrange::arrangement::ArrangeByKey;
Expand Down
6 changes: 2 additions & 4 deletions differential-dataflow/src/algorithms/graphs/propagate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ use crate::operators::arrange::arrangement::ArrangeByKey;
/// method to limit the introduction of labels.
pub fn propagate<G, N, L, R>(edges: &Collection<G, (N,N), R>, nodes: &Collection<G,(N,L),R>) -> Collection<G,(N,L),R>
where
G: Scope,
G::Timestamp: Lattice+Ord,
G: Scope<Timestamp: Lattice+Ord>,
N: ExchangeData+Hash,
R: ExchangeData+Abelian,
R: Multiply<R, Output=R>,
Expand All @@ -34,8 +33,7 @@ where
/// method to limit the introduction of labels.
pub fn propagate_at<G, N, L, F, R>(edges: &Collection<G, (N,N), R>, nodes: &Collection<G,(N,L),R>, logic: F) -> Collection<G,(N,L),R>
where
G: Scope,
G::Timestamp: Lattice+Ord,
G: Scope<Timestamp: Lattice+Ord>,
N: ExchangeData+Hash,
R: ExchangeData+Abelian,
R: Multiply<R, Output=R>,
Expand Down
15 changes: 6 additions & 9 deletions differential-dataflow/src/algorithms/graphs/scc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ use super::propagate::propagate;
/// Iteratively removes nodes with no in-edges.
pub fn trim<G, N, R>(graph: &Collection<G, (N,N), R>) -> Collection<G, (N,N), R>
where
G: Scope,
G::Timestamp: Lattice+Ord,
N: ExchangeData+Hash,
G: Scope<Timestamp: Lattice+Ord>,
N: ExchangeData + Hash,
R: ExchangeData + Abelian,
R: Multiply<R, Output=R>,
R: From<i8>,
Expand All @@ -36,9 +35,8 @@ where
/// Returns the subset of edges in the same strongly connected component.
pub fn strongly_connected<G, N, R>(graph: &Collection<G, (N,N), R>) -> Collection<G, (N,N), R>
where
G: Scope,
G::Timestamp: Lattice+Ord,
N: ExchangeData+Hash,
G: Scope<Timestamp: Lattice + Ord>,
N: ExchangeData + Hash,
R: ExchangeData + Abelian,
R: Multiply<R, Output=R>,
R: From<i8>
Expand All @@ -53,9 +51,8 @@ where
fn trim_edges<G, N, R>(cycle: &Collection<G, (N,N), R>, edges: &Collection<G, (N,N), R>)
-> Collection<G, (N,N), R>
where
G: Scope,
G::Timestamp: Lattice+Ord,
N: ExchangeData+Hash,
G: Scope<Timestamp: Lattice+Ord>,
N: ExchangeData + Hash,
R: ExchangeData + Abelian,
R: Multiply<R, Output=R>,
R: From<i8>
Expand Down
6 changes: 2 additions & 4 deletions differential-dataflow/src/algorithms/graphs/sequential.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ use crate::hashable::Hashable;

fn _color<G, N>(edges: &Collection<G, (N,N)>) -> Collection<G,(N,Option<u32>)>
where
G: Scope,
G::Timestamp: Lattice+Ord,
G: Scope<Timestamp: Lattice+Ord>,
N: ExchangeData+Hash,
{
// need some bogus initial values.
Expand Down Expand Up @@ -45,8 +44,7 @@ pub fn sequence<G, N, V, F>(
edges: &Collection<G, (N,N)>,
logic: F) -> Collection<G, (N,Option<V>)>
where
G: Scope,
G::Timestamp: Lattice+Hash+Ord,
G: Scope<Timestamp: Lattice+Hash+Ord>,
N: ExchangeData+Hashable,
V: ExchangeData,
F: Fn(&N, &[(&V, isize)])->V+'static
Expand Down
7 changes: 3 additions & 4 deletions differential-dataflow/src/algorithms/identifiers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@ pub trait Identifiers<G: Scope, D: ExchangeData, R: ExchangeData+Abelian> {

impl<G, D, R> Identifiers<G, D, R> for Collection<G, D, R>
where
G: Scope,
G::Timestamp: Lattice,
D: ExchangeData+::std::hash::Hash,
R: ExchangeData+Abelian,
G: Scope<Timestamp: Lattice>,
D: ExchangeData + ::std::hash::Hash,
R: ExchangeData + Abelian,
{
fn identifiers(&self) -> Collection<G, (D, u64), R> {

Expand Down
Loading