-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(hydroflow_lang): make fold output optional, usable as just a sin…
…gleton reference (#1134)
- Loading branch information
1 parent
994990b
commit 0f16d1f
Showing
4 changed files
with
173 additions
and
25 deletions.
There are no files selected for viewing
61 changes: 61 additions & 0 deletions
61
hydroflow/tests/snapshots/surface_singleton__fold_singleton_push@graphvis_dot.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
--- | ||
source: hydroflow/tests/surface_singleton.rs | ||
expression: "df.meta_graph().unwrap().to_dot(&Default::default())" | ||
--- | ||
digraph { | ||
node [fontname="Monaco,Menlo,Consolas,"Droid Sans Mono",Inconsolata,"Courier New",monospace", style=filled]; | ||
edge [fontname="Monaco,Menlo,Consolas,"Droid Sans Mono",Inconsolata,"Courier New",monospace"]; | ||
n1v1 [label="(n1v1) source_iter(10..=30)", shape=invhouse, fillcolor="#88aaff"] | ||
n2v1 [label="(n2v1) source_iter(15..=25)", shape=invhouse, fillcolor="#88aaff"] | ||
n3v1 [label="(n3v1) fold(|| 0, std::ops::AddAssign::add_assign)", shape=house, fillcolor="#ffff88"] | ||
n4v1 [label="(n4v1) inspect(|x| println!(\"inspect {}\", x))", shape=invhouse, fillcolor="#88aaff"] | ||
n5v1 [label="(n5v1) filter(|&value| { value <= sum_of_stream2 })", shape=invhouse, fillcolor="#88aaff"] | ||
n6v1 [label="(n6v1) for_each(|x| println!(\"filtered {}\", x))", shape=house, fillcolor="#ffff88"] | ||
n7v1 [label="(n7v1) handoff", shape=parallelogram, fillcolor="#ddddff"] | ||
n2v1 -> n7v1 | ||
n5v1 -> n6v1 | ||
n4v1 -> n5v1 | ||
n1v1 -> n4v1 | ||
n7v1 -> n3v1 [color=red] | ||
n5v1 -> n3v1 [color=red] | ||
subgraph "cluster n1v1" { | ||
fillcolor="#dddddd" | ||
style=filled | ||
label = "sg_1v1\nstratum 0" | ||
n2v1 | ||
subgraph "cluster_sg_1v1_var_stream2" { | ||
label="var stream2" | ||
n2v1 | ||
} | ||
} | ||
subgraph "cluster n2v1" { | ||
fillcolor="#dddddd" | ||
style=filled | ||
label = "sg_2v1\nstratum 1" | ||
n3v1 | ||
subgraph "cluster_sg_2v1_var_sum_of_stream2" { | ||
label="var sum_of_stream2" | ||
n3v1 | ||
} | ||
} | ||
subgraph "cluster n3v1" { | ||
fillcolor="#dddddd" | ||
style=filled | ||
label = "sg_3v1\nstratum 0" | ||
n1v1 | ||
n4v1 | ||
n5v1 | ||
n6v1 | ||
subgraph "cluster_sg_3v1_var_filtered_stream1" { | ||
label="var filtered_stream1" | ||
n4v1 | ||
n5v1 | ||
n6v1 | ||
} | ||
subgraph "cluster_sg_3v1_var_stream1" { | ||
label="var stream1" | ||
n1v1 | ||
} | ||
} | ||
} | ||
|
50 changes: 50 additions & 0 deletions
50
hydroflow/tests/snapshots/surface_singleton__fold_singleton_push@graphvis_mermaid.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- | ||
source: hydroflow/tests/surface_singleton.rs | ||
expression: "df.meta_graph().unwrap().to_mermaid(&Default::default())" | ||
--- | ||
%%{init:{'theme':'base','themeVariables':{'clusterBkg':'#ddd','clusterBorder':'#888'}}}%% | ||
flowchart TD | ||
classDef pullClass fill:#8af,stroke:#000,text-align:left,white-space:pre | ||
classDef pushClass fill:#ff8,stroke:#000,text-align:left,white-space:pre | ||
classDef otherClass fill:#fdc,stroke:#000,text-align:left,white-space:pre | ||
linkStyle default stroke:#aaa | ||
1v1[\"(1v1) <code>source_iter(10..=30)</code>"/]:::pullClass | ||
2v1[\"(2v1) <code>source_iter(15..=25)</code>"/]:::pullClass | ||
3v1[/"(3v1) <code>fold(|| 0, std::ops::AddAssign::add_assign)</code>"\]:::pushClass | ||
4v1[\"(4v1) <code>inspect(|x| println!("inspect {}", x))</code>"/]:::pullClass | ||
5v1[\"(5v1) <code>filter(|&value| { value <= sum_of_stream2 })</code>"/]:::pullClass | ||
6v1[/"(6v1) <code>for_each(|x| println!("filtered {}", x))</code>"\]:::pushClass | ||
7v1["(7v1) <code>handoff</code>"]:::otherClass | ||
2v1-->7v1 | ||
5v1-->6v1 | ||
4v1-->5v1 | ||
1v1-->4v1 | ||
7v1--x3v1; linkStyle 4 stroke:red | ||
5v1--x3v1; linkStyle 5 stroke:red | ||
subgraph sg_1v1 ["sg_1v1 stratum 0"] | ||
2v1 | ||
subgraph sg_1v1_var_stream2 ["var <tt>stream2</tt>"] | ||
2v1 | ||
end | ||
end | ||
subgraph sg_2v1 ["sg_2v1 stratum 1"] | ||
3v1 | ||
subgraph sg_2v1_var_sum_of_stream2 ["var <tt>sum_of_stream2</tt>"] | ||
3v1 | ||
end | ||
end | ||
subgraph sg_3v1 ["sg_3v1 stratum 0"] | ||
1v1 | ||
4v1 | ||
5v1 | ||
6v1 | ||
subgraph sg_3v1_var_filtered_stream1 ["var <tt>filtered_stream1</tt>"] | ||
4v1 | ||
5v1 | ||
6v1 | ||
end | ||
subgraph sg_3v1_var_stream1 ["var <tt>stream1</tt>"] | ||
1v1 | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters