weirflow 0.1.0

GPU-first dataflow analysis primitives for Vyre and Santh compiler pipelines.
Documentation
use super::*;

bfs_test!(
    no_edges_multiple_seeds,
    1,
    3,
    1,
    &[],
    &[],
    &[],
    &[],
    &[(0, 0, 0), (0, 2, 0)],
    vec![(0, 0, 0), (0, 2, 0)]
);

bfs_test!(
    bidirectional_edge,
    1,
    2,
    1,
    &[(0, 0, 1), (0, 1, 0)],
    &[],
    &[],
    &[],
    &[(0, 0, 0)],
    vec![(0, 0, 0), (0, 1, 0)]
);

bfs_test!(
    tree_depth_3,
    1,
    7,
    1,
    &[
        (0, 0, 1),
        (0, 0, 2),
        (0, 1, 3),
        (0, 1, 4),
        (0, 2, 5),
        (0, 2, 6)
    ],
    &[],
    &[],
    &[],
    &[(0, 0, 0)],
    (0..7).map(|b| (0, b, 0)).collect()
);

bfs_test!(
    tree_depth_5,
    1,
    6,
    1,
    &[(0, 0, 1), (0, 1, 2), (0, 2, 3), (0, 3, 4), (0, 4, 5)],
    &[],
    &[],
    &[],
    &[(0, 0, 0)],
    (0..6).map(|b| (0, b, 0)).collect()
);

bfs_test!(
    self_loop_with_multiple_blocks,
    1,
    2,
    1,
    &[(0, 0, 0), (0, 1, 1)],
    &[],
    &[],
    &[],
    &[(0, 0, 0)],
    vec![(0, 0, 0)]
);

bfs_test!(
    two_self_loops_disconnected,
    1,
    2,
    1,
    &[(0, 0, 0), (0, 1, 1)],
    &[],
    &[],
    &[],
    &[(0, 0, 0), (0, 1, 0)],
    vec![(0, 0, 0), (0, 1, 0)]
);

bfs_test!(
    cycle_with_kill_breaks,
    1,
    3,
    1,
    &cycle_edges(3),
    &[],
    &[],
    &[(0, 1, 0)],
    &[(0, 0, 0)],
    vec![(0, 0, 0), (0, 1, 0)]
);

bfs_test!(
    gen_on_seed_block,
    1,
    2,
    2,
    &[(0, 0, 1)],
    &[],
    &[(0, 0, 1)],
    &[],
    &[(0, 0, 0)],
    vec![(0, 0, 0), (0, 1, 0), (0, 1, 1)]
);

bfs_test!(
    kill_removes_seed_fact_but_not_reached,
    1,
    2,
    1,
    &[(0, 0, 1)],
    &[],
    &[],
    &[(0, 0, 0)],
    &[(0, 0, 0)],
    vec![(0, 0, 0)]
);

bfs_test!(
    interproc_two_calls,
    3,
    2,
    1,
    &[(0, 0, 1), (1, 0, 1), (2, 0, 1)],
    &[(0, 1, 1, 0), (0, 1, 2, 0)],
    &[],
    &[],
    &[(0, 0, 0)],
    vec![
        (0, 0, 0),
        (0, 1, 0),
        (1, 0, 0),
        (1, 1, 0),
        (2, 0, 0),
        (2, 1, 0)
    ]
);

bfs_test!(
    interproc_chain_3_procs,
    3,
    2,
    1,
    &[(0, 0, 1), (1, 0, 1), (2, 0, 1)],
    &[(0, 1, 1, 0), (1, 1, 2, 0)],
    &[],
    &[],
    &[(0, 0, 0)],
    vec![
        (0, 0, 0),
        (0, 1, 0),
        (1, 0, 0),
        (1, 1, 0),
        (2, 0, 0),
        (2, 1, 0)
    ]
);

bfs_test!(
    multiple_facts_gen_kill_interaction,
    1,
    2,
    3,
    &[(0, 0, 1)],
    &[],
    &[(0, 0, 2)],
    &[(0, 1, 0)],
    &[(0, 0, 0), (0, 0, 1)],
    vec![(0, 0, 0), (0, 0, 1), (0, 1, 0), (0, 1, 1), (0, 1, 2)]
);