Skip to content
Open
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
20 changes: 6 additions & 14 deletions dfir_lang/src/graph/graph_write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,10 @@ where
"{b:i$}{src}{arrow_body}{arrow_head}{label}{dst}",
src = src_str.trim(),
arrow_body = "--",
arrow_head = match delay_type {
None | Some(DelayType::MonotoneAccum) => ">",
Some(DelayType::Stratum) => "x",
Some(DelayType::Tick | DelayType::TickLazy) => "o",
arrow_head = if let Some(DelayType::Tick | DelayType::TickLazy) = delay_type {
"o"
} else {
">"
},
label = if let Some(label) = &label {
Cow::Owned(format!("|{}|", escape_mermaid(label.trim())))
Expand All @@ -194,16 +194,8 @@ where
b = "",
i = self.indent,
)?;
if let Some(delay_type) = delay_type {
write!(
self.write,
"; linkStyle {} stroke:{}",
self.link_count,
match delay_type {
DelayType::Stratum | DelayType::Tick | DelayType::TickLazy => "red",
DelayType::MonotoneAccum => "#060",
}
)?;
if let Some(DelayType::Tick | DelayType::TickLazy) = delay_type {
write!(self.write, "; linkStyle {} stroke:red", self.link_count)?;
}
writeln!(self.write)?;
self.link_count += 1;
Expand Down
3 changes: 1 addition & 2 deletions dfir_lang/src/graph/meta_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1980,9 +1980,8 @@ impl DfirGraph {
let Some(resolved_src) = resolved_src else {
continue;
};
let delay_type = Some(DelayType::Stratum);
let label = None;
graph_write.write_edge(resolved_src, dst_id, delay_type, label, true)?;
graph_write.write_edge(resolved_src, dst_id, None, label, true)?;
}
}
}
Expand Down
4 changes: 0 additions & 4 deletions dfir_lang/src/graph/ops/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ use crate::parse::{Operator, PortIndex};
/// The delay (soft barrier) type, for each input to an operator if needed.
#[derive(Clone, Copy, PartialOrd, Ord, PartialEq, Eq, Debug, Serialize, Deserialize)]
pub enum DelayType {
/// Input must be collected over the preceding stratum.
Stratum,
/// Monotone accumulation: can delay to reduce flow rate, but also correct to emit "early"
MonotoneAccum,
/// Input must be collected over the previous tick.
Tick,
/// Input must be collected over the previous tick but also not cause a new tick to occur.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ digraph {
n2v1 -> n3v1
n5v1 -> n6v1
n4v1 -> n5v1
n2v1 -> n5v1 [color=red]
n2v1 -> n5v1
subgraph sg_1v1 {
cluster=true
fillcolor="#dddddd"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ linkStyle default stroke:#aaa
2v1-->3v1
5v1-->6v1
4v1-->5v1
2v1--x5v1; linkStyle 4 stroke:red
2v1-->5v1
subgraph sg_1v1 ["sg_1v1"]
subgraph sg_1v1_var_my_val ["var <tt>my_val</tt>"]
1v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ digraph {
n1v1 -> n3v1
n5v1 -> n6v1
n4v1 -> n5v1
n1v1 -> n5v1 [color=red]
n1v1 -> n5v1
subgraph sg_1v1 {
cluster=true
fillcolor="#dddddd"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ linkStyle default stroke:#aaa
1v1-->3v1
5v1-->6v1
4v1-->5v1
1v1--x5v1; linkStyle 3 stroke:red
1v1-->5v1
subgraph sg_1v1 ["sg_1v1"]
subgraph sg_1v1_var_my_val ["var <tt>my_val</tt>"]
1v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ digraph {
n1v1 -> n2v1
n4v1 -> n5v1
n3v1 -> n4v1
n2v1 -> n4v1 [color=red]
n2v1 -> n4v1
subgraph sg_1v1 {
cluster=true
fillcolor="#dddddd"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ linkStyle default stroke:#aaa
1v1-->2v1
4v1-->5v1
3v1-->4v1
2v1--x4v1; linkStyle 3 stroke:red
2v1-->4v1
subgraph sg_1v1 ["sg_1v1"]
subgraph sg_1v1_var_my_val ["var <tt>my_val</tt>"]
1v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ digraph {
n5v1 [label="(n5v1) for_each(|v: i32| out.push(v))", shape=house, fillcolor="#ffff88"]
n4v1 -> n5v1
n3v1 -> n4v1
n1v1 -> n4v1 [color=red]
n1v1 -> n4v1
subgraph sg_1v1 {
cluster=true
fillcolor="#dddddd"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ linkStyle default stroke:#aaa
5v1[/"(5v1) <code>for_each(|v: i32| out.push(v))</code>"\]:::pushClass
4v1-->5v1
3v1-->4v1
1v1--x4v1; linkStyle 2 stroke:red
1v1-->4v1
subgraph sg_1v1 ["sg_1v1"]
subgraph sg_1v1_var_my_val ["var <tt>my_val</tt>"]
1v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ digraph {
n9v1 -> n10v1
n11v1 -> n9v1 [label="0"]
n12v1 -> n9v1 [label="1"]
n7v1 -> n9v1 [color=red]
n8v1 -> n9v1 [color=red]
n7v1 -> n9v1
n8v1 -> n9v1
subgraph sg_1v1 {
cluster=true
fillcolor="#dddddd"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ linkStyle default stroke:#aaa
9v1-->10v1
11v1-->|0|9v1
12v1-->|1|9v1
7v1--x9v1; linkStyle 11 stroke:red
8v1--x9v1; linkStyle 12 stroke:red
7v1-->9v1
8v1-->9v1
subgraph sg_1v1 ["sg_1v1"]
subgraph sg_1v1_var_lhs_op ["var <tt>lhs_op</tt>"]
1v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ digraph {
n9v1 -> n10v1
n11v1 -> n9v1 [label="0"]
n12v1 -> n9v1 [label="1"]
n7v1 -> n9v1 [color=red]
n8v1 -> n9v1 [color=red]
n7v1 -> n9v1
n8v1 -> n9v1
subgraph sg_1v1 {
cluster=true
fillcolor="#dddddd"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ linkStyle default stroke:#aaa
9v1-->10v1
11v1-->|0|9v1
12v1-->|1|9v1
7v1--x9v1; linkStyle 11 stroke:red
8v1--x9v1; linkStyle 12 stroke:red
7v1-->9v1
8v1-->9v1
subgraph sg_1v1 ["sg_1v1"]
subgraph sg_1v1_var_lhs_op ["var <tt>lhs_op</tt>"]
1v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ digraph {
n9v1 -> n10v1
n12v1 -> n9v1 [label="0"]
n13v1 -> n9v1 [label="1"]
n7v1 -> n9v1 [color=red]
n8v1 -> n9v1 [color=red]
n7v1 -> n9v1
n8v1 -> n9v1
subgraph sg_1v1 {
cluster=true
fillcolor="#dddddd"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ linkStyle default stroke:#aaa
9v1-->10v1
12v1-->|0|9v1
13v1-->|1|9v1
7v1--x9v1; linkStyle 12 stroke:red
8v1--x9v1; linkStyle 13 stroke:red
7v1-->9v1
8v1-->9v1
subgraph sg_1v1 ["sg_1v1"]
subgraph sg_1v1_var_lhs_op ["var <tt>lhs_op</tt>"]
1v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ digraph {
n9v1 -> n10v1
n11v1 -> n9v1 [label="0"]
n12v1 -> n9v1 [label="1"]
n7v1 -> n9v1 [color=red]
n8v1 -> n9v1 [color=red]
n7v1 -> n9v1
n8v1 -> n9v1
subgraph sg_1v1 {
cluster=true
fillcolor="#dddddd"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ linkStyle default stroke:#aaa
9v1-->10v1
11v1-->|0|9v1
12v1-->|1|9v1
7v1--x9v1; linkStyle 11 stroke:red
8v1--x9v1; linkStyle 12 stroke:red
7v1-->9v1
8v1-->9v1
subgraph sg_1v1 ["sg_1v1"]
subgraph sg_1v1_var_lhs_op ["var <tt>lhs_op</tt>"]
1v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ digraph {
n9v1 -> n10v1
n12v1 -> n9v1 [label="0"]
n13v1 -> n9v1 [label="1"]
n7v1 -> n9v1 [color=red]
n8v1 -> n9v1 [color=red]
n7v1 -> n9v1
n8v1 -> n9v1
subgraph sg_1v1 {
cluster=true
fillcolor="#dddddd"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ linkStyle default stroke:#aaa
9v1-->10v1
12v1-->|0|9v1
13v1-->|1|9v1
7v1--x9v1; linkStyle 12 stroke:red
8v1--x9v1; linkStyle 13 stroke:red
7v1-->9v1
8v1-->9v1
subgraph sg_1v1 ["sg_1v1"]
subgraph sg_1v1_var_lhs_op ["var <tt>lhs_op</tt>"]
1v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ digraph {
n10v1 -> n11v1
n13v1 -> n10v1 [label="0"]
n14v1 -> n10v1 [label="1"]
n8v1 -> n10v1 [color=red]
n9v1 -> n10v1 [color=red]
n8v1 -> n10v1
n9v1 -> n10v1
subgraph sg_1v1 {
cluster=true
fillcolor="#dddddd"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ linkStyle default stroke:#aaa
10v1-->11v1
13v1-->|0|10v1
14v1-->|1|10v1
8v1--x10v1; linkStyle 13 stroke:red
9v1--x10v1; linkStyle 14 stroke:red
8v1-->10v1
9v1-->10v1
subgraph sg_1v1 ["sg_1v1"]
subgraph sg_1v1_var_lhs_op ["var <tt>lhs_op</tt>"]
1v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ digraph {
n11v1 -> n12v1
n14v1 -> n11v1 [label="0"]
n15v1 -> n11v1 [label="1"]
n9v1 -> n11v1 [color=red]
n10v1 -> n11v1 [color=red]
n9v1 -> n11v1
n10v1 -> n11v1
subgraph sg_1v1 {
cluster=true
fillcolor="#dddddd"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ linkStyle default stroke:#aaa
11v1-->12v1
14v1-->|0|11v1
15v1-->|1|11v1
9v1--x11v1; linkStyle 14 stroke:red
10v1--x11v1; linkStyle 15 stroke:red
9v1-->11v1
10v1-->11v1
subgraph sg_1v1 ["sg_1v1"]
subgraph sg_1v1_var_lhs_op ["var <tt>lhs_op</tt>"]
1v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ digraph {
n1v1 -> n5v1
n8v1 -> n9v1
n4v1 -> n8v1
n4v1 -> n5v1 [color=red]
n4v1 -> n5v1
subgraph sg_1v1 {
cluster=true
fillcolor="#dddddd"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ linkStyle default stroke:#aaa
1v1-->5v1
8v1-->9v1
4v1-->8v1
4v1--x5v1; linkStyle 7 stroke:red
4v1-->5v1
subgraph sg_1v1 ["sg_1v1"]
subgraph sg_1v1_var_max_of_stream2 ["var <tt>max_of_stream2</tt>"]
3v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ digraph {
n6v1 -> n7v1
n5v1 -> n6v1
n1v1 -> n5v1
n4v1 -> n6v1 [color=red]
n4v1 -> n6v1
subgraph sg_1v1 {
cluster=true
fillcolor="#dddddd"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ linkStyle default stroke:#aaa
6v1-->7v1
5v1-->6v1
1v1-->5v1
4v1--x6v1; linkStyle 6 stroke:red
4v1-->6v1
subgraph sg_1v1 ["sg_1v1"]
subgraph sg_1v1_var_max_of_stream2 ["var <tt>max_of_stream2</tt>"]
3v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ digraph {
n1v1 -> n6v1
n9v1 -> n10v1
n4v1 -> n9v1 [label="items"]
n5v1 -> n6v1 [color=red]
n5v1 -> n6v1
subgraph sg_1v1 {
cluster=true
fillcolor="#dddddd"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ linkStyle default stroke:#aaa
1v1-->6v1
9v1-->10v1
4v1-->|items|9v1
5v1--x6v1; linkStyle 8 stroke:red
5v1-->6v1
subgraph sg_1v1 ["sg_1v1"]
9v1
10v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ digraph {
n1v1 -> n5v1
n9v1 -> n10v1
n4v1 -> n9v1
n4v1 -> n6v1 [color=red]
n4v1 -> n6v1
subgraph sg_1v1 {
cluster=true
fillcolor="#dddddd"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ linkStyle default stroke:#aaa
1v1-->5v1
9v1-->10v1
4v1-->9v1
4v1--x6v1; linkStyle 8 stroke:red
4v1-->6v1
subgraph sg_1v1 ["sg_1v1"]
subgraph sg_1v1_var_max_of_stream2 ["var <tt>max_of_stream2</tt>"]
3v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ digraph {
n6v1 -> n7v1
n5v1 -> n6v1
n1v1 -> n5v1
n4v1 -> n6v1 [color=red]
n4v1 -> n6v1
subgraph sg_1v1 {
cluster=true
fillcolor="#dddddd"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ linkStyle default stroke:#aaa
6v1-->7v1
5v1-->6v1
1v1-->5v1
4v1--x6v1; linkStyle 6 stroke:red
4v1-->6v1
subgraph sg_1v1 ["sg_1v1"]
subgraph sg_1v1_var_max_of_stream2 ["var <tt>max_of_stream2</tt>"]
3v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ digraph {
n1v1 -> n6v1
n10v1 -> n11v1
n4v1 -> n10v1 [label="items"]
n5v1 -> n7v1 [color=red]
n5v1 -> n7v1
subgraph sg_1v1 {
cluster=true
fillcolor="#dddddd"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ linkStyle default stroke:#aaa
1v1-->6v1
10v1-->11v1
4v1-->|items|10v1
5v1--x7v1; linkStyle 9 stroke:red
5v1-->7v1
subgraph sg_1v1 ["sg_1v1"]
10v1
11v1
Expand Down
Loading
Loading