-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add defer() which is the same as defer_tick() except that it is…
… lazy (#945)
- Loading branch information
Showing
35 changed files
with
399 additions
and
33 deletions.
There are no files selected for viewing
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
56 changes: 56 additions & 0 deletions
56
hydroflow/tests/snapshots/surface_stratum__defer_lazy@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,56 @@ | ||
--- | ||
source: hydroflow/tests/surface_stratum.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) union()", shape=invhouse, fillcolor="#88aaff"] | ||
n2v1 [label="(n2v1) tee()", shape=house, fillcolor="#ffff88"] | ||
n3v1 [label="(n3v1) source_iter([1, 3])", shape=invhouse, fillcolor="#88aaff"] | ||
n4v1 [label="(n4v1) defer_tick_lazy()", shape=invhouse, fillcolor="#88aaff"] | ||
n5v1 [label="(n5v1) map(|x| 2 * x)", shape=invhouse, fillcolor="#88aaff"] | ||
n6v1 [label="(n6v1) for_each(|x| output_inner.borrow_mut().push(x))", shape=house, fillcolor="#ffff88"] | ||
n7v1 [label="(n7v1) handoff", shape=parallelogram, fillcolor="#ddddff"] | ||
n8v1 [label="(n8v1) handoff", shape=parallelogram, fillcolor="#ddddff"] | ||
n9v1 [label="(n9v1) identity()", shape=invhouse, fillcolor="#88aaff"] | ||
n10v1 [label="(n10v1) handoff", shape=parallelogram, fillcolor="#ddddff"] | ||
n1v1 -> n2v1 | ||
n3v1 -> n1v1 [label="0"] | ||
n5v1 -> n1v1 [label="1"] | ||
n4v1 -> n7v1 | ||
n2v1 -> n8v1 [label="0"] | ||
n2v1 -> n6v1 [label="1"] | ||
n7v1 -> n5v1 | ||
n8v1 -> n9v1 | ||
n9v1 -> n10v1 | ||
n10v1 -> n4v1 [color=red] | ||
subgraph "cluster n1v1" { | ||
fillcolor="#dddddd" | ||
style=filled | ||
label = "sg_1v1\nstratum 0" | ||
n4v1 | ||
} | ||
subgraph "cluster n2v1" { | ||
fillcolor="#dddddd" | ||
style=filled | ||
label = "sg_2v1\nstratum 0" | ||
n3v1 | ||
n5v1 | ||
n1v1 | ||
n2v1 | ||
n6v1 | ||
subgraph "cluster_sg_2v1_var_a" { | ||
label="var a" | ||
n1v1 | ||
n2v1 | ||
} | ||
} | ||
subgraph "cluster n3v1" { | ||
fillcolor="#dddddd" | ||
style=filled | ||
label = "sg_3v1\nstratum 1" | ||
n9v1 | ||
} | ||
} | ||
|
48 changes: 48 additions & 0 deletions
48
hydroflow/tests/snapshots/surface_stratum__defer_lazy@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,48 @@ | ||
--- | ||
source: hydroflow/tests/surface_stratum.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>union()</code>"/]:::pullClass | ||
2v1[/"(2v1) <code>tee()</code>"\]:::pushClass | ||
3v1[\"(3v1) <code>source_iter([1, 3])</code>"/]:::pullClass | ||
4v1[\"(4v1) <code>defer_tick_lazy()</code>"/]:::pullClass | ||
5v1[\"(5v1) <code>map(|x| 2 * x)</code>"/]:::pullClass | ||
6v1[/"(6v1) <code>for_each(|x| output_inner.borrow_mut().push(x))</code>"\]:::pushClass | ||
7v1["(7v1) <code>handoff</code>"]:::otherClass | ||
8v1["(8v1) <code>handoff</code>"]:::otherClass | ||
9v1[\"(9v1) <code>identity()</code>"/]:::pullClass | ||
10v1["(10v1) <code>handoff</code>"]:::otherClass | ||
1v1-->2v1 | ||
3v1-->|0|1v1 | ||
5v1-->|1|1v1 | ||
4v1-->7v1 | ||
2v1-->|0|8v1 | ||
2v1-->|1|6v1 | ||
7v1-->5v1 | ||
8v1-->9v1 | ||
9v1-->10v1 | ||
10v1--o4v1; linkStyle 9 stroke:red | ||
subgraph sg_1v1 ["sg_1v1 stratum 0"] | ||
4v1 | ||
end | ||
subgraph sg_2v1 ["sg_2v1 stratum 0"] | ||
3v1 | ||
5v1 | ||
1v1 | ||
2v1 | ||
6v1 | ||
subgraph sg_2v1_var_a ["var <tt>a</tt>"] | ||
1v1 | ||
2v1 | ||
end | ||
end | ||
subgraph sg_3v1 ["sg_3v1 stratum 1"] | ||
9v1 | ||
end | ||
|
56 changes: 56 additions & 0 deletions
56
hydroflow/tests/snapshots/surface_stratum__defer_meme@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,56 @@ | ||
--- | ||
source: hydroflow/tests/surface_stratum.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) union()", shape=invhouse, fillcolor="#88aaff"] | ||
n2v1 [label="(n2v1) tee()", shape=house, fillcolor="#ffff88"] | ||
n3v1 [label="(n3v1) source_iter([1, 3])", shape=invhouse, fillcolor="#88aaff"] | ||
n4v1 [label="(n4v1) defer()", shape=invhouse, fillcolor="#88aaff"] | ||
n5v1 [label="(n5v1) map(|x| 2 * x)", shape=invhouse, fillcolor="#88aaff"] | ||
n6v1 [label="(n6v1) for_each(|x| output_inner.borrow_mut().push(x))", shape=house, fillcolor="#ffff88"] | ||
n7v1 [label="(n7v1) handoff", shape=parallelogram, fillcolor="#ddddff"] | ||
n8v1 [label="(n8v1) handoff", shape=parallelogram, fillcolor="#ddddff"] | ||
n9v1 [label="(n9v1) identity()", shape=invhouse, fillcolor="#88aaff"] | ||
n10v1 [label="(n10v1) handoff", shape=parallelogram, fillcolor="#ddddff"] | ||
n1v1 -> n2v1 | ||
n3v1 -> n1v1 [label="0"] | ||
n5v1 -> n1v1 [label="1"] | ||
n4v1 -> n7v1 | ||
n2v1 -> n8v1 [label="0"] | ||
n2v1 -> n6v1 [label="1"] | ||
n7v1 -> n5v1 | ||
n8v1 -> n9v1 | ||
n9v1 -> n10v1 | ||
n10v1 -> n4v1 [color=red] | ||
subgraph "cluster n1v1" { | ||
fillcolor="#dddddd" | ||
style=filled | ||
label = "sg_1v1\nstratum 0" | ||
n4v1 | ||
} | ||
subgraph "cluster n2v1" { | ||
fillcolor="#dddddd" | ||
style=filled | ||
label = "sg_2v1\nstratum 0" | ||
n3v1 | ||
n5v1 | ||
n1v1 | ||
n2v1 | ||
n6v1 | ||
subgraph "cluster_sg_2v1_var_a" { | ||
label="var a" | ||
n1v1 | ||
n2v1 | ||
} | ||
} | ||
subgraph "cluster n3v1" { | ||
fillcolor="#dddddd" | ||
style=filled | ||
label = "sg_3v1\nstratum 1" | ||
n9v1 | ||
} | ||
} | ||
|
48 changes: 48 additions & 0 deletions
48
hydroflow/tests/snapshots/surface_stratum__defer_meme@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,48 @@ | ||
--- | ||
source: hydroflow/tests/surface_stratum.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>union()</code>"/]:::pullClass | ||
2v1[/"(2v1) <code>tee()</code>"\]:::pushClass | ||
3v1[\"(3v1) <code>source_iter([1, 3])</code>"/]:::pullClass | ||
4v1[\"(4v1) <code>defer()</code>"/]:::pullClass | ||
5v1[\"(5v1) <code>map(|x| 2 * x)</code>"/]:::pullClass | ||
6v1[/"(6v1) <code>for_each(|x| output_inner.borrow_mut().push(x))</code>"\]:::pushClass | ||
7v1["(7v1) <code>handoff</code>"]:::otherClass | ||
8v1["(8v1) <code>handoff</code>"]:::otherClass | ||
9v1[\"(9v1) <code>identity()</code>"/]:::pullClass | ||
10v1["(10v1) <code>handoff</code>"]:::otherClass | ||
1v1-->2v1 | ||
3v1-->|0|1v1 | ||
5v1-->|1|1v1 | ||
4v1-->7v1 | ||
2v1-->|0|8v1 | ||
2v1-->|1|6v1 | ||
7v1-->5v1 | ||
8v1-->9v1 | ||
9v1-->10v1 | ||
10v1--o4v1; linkStyle 9 stroke:red | ||
subgraph sg_1v1 ["sg_1v1 stratum 0"] | ||
4v1 | ||
end | ||
subgraph sg_2v1 ["sg_2v1 stratum 0"] | ||
3v1 | ||
5v1 | ||
1v1 | ||
2v1 | ||
6v1 | ||
subgraph sg_2v1_var_a ["var <tt>a</tt>"] | ||
1v1 | ||
2v1 | ||
end | ||
end | ||
subgraph sg_3v1 ["sg_3v1 stratum 1"] | ||
9v1 | ||
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
8 changes: 7 additions & 1 deletion
8
...c/snapshots/hydroflow_datalog_core__tests__aggregations_and_comments@datalog_program.snap
Large diffs are not rendered by default.
Oops, something went wrong.
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
Oops, something went wrong.