Skip to content

Commit bf6c8d3

Browse files
committed
refactor(dfir_lang): remove stratum from chain, chain_first_n
PR: #2967
1 parent 8a2b324 commit bf6c8d3

6 files changed

Lines changed: 33 additions & 49 deletions

File tree

dfir_lang/src/graph/ops/chain.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
use crate::graph::PortIndexValue;
2-
31
use super::{
4-
DelayType, OperatorCategory, OperatorConstraints, RANGE_0, RANGE_1
2+
OperatorCategory, OperatorConstraints, RANGE_0, RANGE_1
53
};
64

75
/// > 2 input streams of the same type, 1 output stream of the same type
@@ -32,11 +30,6 @@ pub const CHAIN: OperatorConstraints = OperatorConstraints {
3230
flo_type: None,
3331
ports_inn: None,
3432
ports_out: None,
35-
input_delaytype_fn: |idx| match idx {
36-
PortIndexValue::Int(idx) if idx.value == 0 => {
37-
Some(DelayType::Stratum)
38-
}
39-
_else => None,
40-
},
33+
input_delaytype_fn: |_| None,
4134
write_fn: super::union::UNION.write_fn,
4235
};

dfir_lang/src/graph/ops/chain_first_n.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
use quote::quote_spanned;
22

33
use crate::graph::{
4-
PortIndexValue,
54
ops::{OperatorWriteOutput, WriteContextArgs},
65
};
76

8-
use super::{DelayType, OperatorCategory, OperatorConstraints, RANGE_0, RANGE_1};
7+
use super::{OperatorCategory, OperatorConstraints, RANGE_0, RANGE_1};
98

109
/// > 2 input streams of the same type, 1 output stream of the same type
1110
///
@@ -36,13 +35,7 @@ pub const CHAIN_FIRST_N: OperatorConstraints = OperatorConstraints {
3635
flo_type: None,
3736
ports_inn: None,
3837
ports_out: None,
39-
input_delaytype_fn: |idx| match idx {
40-
PortIndexValue::Int(idx) if idx.value == 0 => {
41-
// will no longer be needed once subgraphs are always DAGs (only run once per tick)
42-
Some(DelayType::Stratum)
43-
}
44-
_else => None,
45-
},
38+
input_delaytype_fn: |_| None,
4639
write_fn: |wc @ &WriteContextArgs {
4740
root,
4841
op_span,

hydro_test/src/cluster/snapshots/compute_pi_ir@surface_graph_loc2v1.snap

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ _16v1 = cross_singleton ();
2121
_17v1 = map (stageleft :: runtime_support :: fn1_type_hint :: < ((u64 , u64) , bool) , (u64 , u64) > ({ use hydro_lang :: __staged :: __deps :: * ; use hydro_lang :: __staged :: live_collections :: optional :: * ; hydro_lang :: __stageleft_quote_src_live_collections_optional_rs_1103_51 ! ([] [| (d , _) | d]) }));
2222
_18v1 = for_each (stageleft :: runtime_support :: fnmut1_type_hint :: < (u64 , u64) , () > ({ use crate :: __staged :: __deps :: * ; use crate :: __staged :: cluster :: compute_pi :: * ; # [allow (unused_imports)] use crate :: * ; __stageleft_quote_src_cluster_compute_pi_rs_50_21 ! ([] [| (inside , total) | { println ! ("pi: {} ({} trials)" , 4.0 * inside as f64 / total as f64 , total) ; }]) }));
2323
_19v1 = handoff();
24-
_20v1 = handoff();
2524

2625
_1v1 -> _2v1;
2726
_2v1 -> _3v1;
@@ -32,13 +31,12 @@ _7v1 -> _8v1;
3231
_8v1 -> _9v1;
3332
_9v1 -> _10v1;
3433
_11v1 -> _12v1;
35-
_10v1 -> _19v1;
34+
_10v1 -> [0]_13v1;
3635
_12v1 -> [1]_13v1;
3736
_13v1 -> _14v1;
3837
_14v1 -> _15v1;
3938
_4v1 -> [input]_16v1;
40-
_15v1 -> _20v1;
39+
_15v1 -> _19v1;
4140
_16v1 -> _17v1;
4241
_17v1 -> _18v1;
43-
_19v1 -> [0]_13v1;
44-
_20v1 -> [single]_16v1;
42+
_19v1 -> [single]_16v1;

hydro_test/src/cluster/snapshots/paxos_ir@acceptor_mermaid.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ linkStyle default stroke:#aaa
6767
6v1-->7v1
6868
7v1-->8v1
6969
9v1-->10v1
70-
8v1--x|0|11v1; linkStyle 7 stroke:red
70+
8v1-->|0|11v1
7171
10v1-->|1|11v1
7272
11v1-->12v1
7373
6v1-->|input|13v1
@@ -88,12 +88,12 @@ linkStyle default stroke:#aaa
8888
52v1-->26v1
8989
26v1-->27v1
9090
28v1-->29v1
91-
27v1--x|0|30v1; linkStyle 28 stroke:red
91+
27v1-->|0|30v1
9292
29v1-->|1|30v1
9393
21v1-->|input|31v1
9494
12v1--x|single|31v1; linkStyle 31 stroke:red
9595
31v1-->32v1
96-
34v1--x|0|33v1; linkStyle 33 stroke:red
96+
34v1-->|0|33v1
9797
32v1-->34v1
9898
35v1-->|1|33v1
9999
26v1-->35v1
@@ -116,8 +116,8 @@ linkStyle default stroke:#aaa
116116
50v1-->51v1
117117
51v1-->52v1
118118
2v1
119-
34v1
120119
35v1
120+
34v1
121121
16v1
122122
17v1
123123
24v1

hydro_test/src/cluster/snapshots/paxos_ir@proposer_mermaid.snap

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -274,18 +274,18 @@ linkStyle default stroke:#aaa
274274
264v1["<div style=text-align:center>(264v1)</div> <code><br>map(|(id, data)| {<br> (<br> id.into_tagless(),<br> hydro_lang::runtime_support::bincode::serialize(&amp;data).unwrap().into(),<br> )<br>})</code>"]:::otherClass
275275
265v1["<div style=text-align:center>(265v1)</div> <code><br>dest_sink(DUMMY_SINK)</code>"]:::otherClass
276276
1v1-->2v1
277-
132v1--x|0|3v1; linkStyle 1 stroke:red
277+
132v1-->|0|3v1
278278
250v1-->|1|3v1
279-
3v1--x|0|4v1; linkStyle 3 stroke:red
279+
3v1-->|0|4v1
280280
50v1-->|1|4v1
281281
4v1-->5v1
282282
6v1-->7v1
283-
5v1--x|0|8v1; linkStyle 7 stroke:red
283+
5v1-->|0|8v1
284284
7v1-->|1|8v1
285285
8v1-->9v1
286286
17v1--o10v1; linkStyle 10 stroke:red
287287
11v1-->12v1
288-
10v1--x|0|13v1; linkStyle 12 stroke:red
288+
10v1-->|0|13v1
289289
12v1-->|1|13v1
290290
9v1-->|input|14v1
291291
13v1--x|single|14v1; linkStyle 15 stroke:red
@@ -310,7 +310,7 @@ linkStyle default stroke:#aaa
310310
33v1-->34v1
311311
34v1-->35v1
312312
36v1-->37v1
313-
35v1--x|0|38v1; linkStyle 37 stroke:red
313+
35v1-->|0|38v1
314314
37v1-->|1|38v1
315315
38v1-->39v1
316316
39v1-->40v1
@@ -340,7 +340,7 @@ linkStyle default stroke:#aaa
340340
62v1-->63v1
341341
63v1-->64v1
342342
65v1-->66v1
343-
64v1--x|0|67v1; linkStyle 67 stroke:red
343+
64v1-->|0|67v1
344344
66v1-->|1|67v1
345345
67v1-->68v1
346346
69v1-->70v1
@@ -349,7 +349,7 @@ linkStyle default stroke:#aaa
349349
72v1-->73v1
350350
73v1-->74v1
351351
75v1-->76v1
352-
74v1--x|0|77v1; linkStyle 76 stroke:red
352+
74v1-->|0|77v1
353353
76v1-->|1|77v1
354354
77v1-->78v1
355355
68v1-->|input|79v1
@@ -368,7 +368,7 @@ linkStyle default stroke:#aaa
368368
89v1-->90v1
369369
90v1-->91v1
370370
91v1-->92v1
371-
51v1--x|0|93v1; linkStyle 95 stroke:red
371+
51v1-->|0|93v1
372372
92v1-->|1|93v1
373373
93v1-->94v1
374374
94v1-->95v1
@@ -402,7 +402,7 @@ linkStyle default stroke:#aaa
402402
117v1-->118v1
403403
118v1-->119v1
404404
120v1-->121v1
405-
119v1--x|0|122v1; linkStyle 129 stroke:red
405+
119v1-->|0|122v1
406406
121v1-->|1|122v1
407407
122v1-->123v1
408408
9v1-->|input|124v1
@@ -426,7 +426,7 @@ linkStyle default stroke:#aaa
426426
140v1-->141v1
427427
141v1-->142v1
428428
143v1-->144v1
429-
142v1--x|0|145v1; linkStyle 153 stroke:red
429+
142v1-->|0|145v1
430430
144v1-->|1|145v1
431431
145v1-->146v1
432432
128v1-->|input|147v1
@@ -461,9 +461,9 @@ linkStyle default stroke:#aaa
461461
172v1-->173v1
462462
186v1--o174v1; linkStyle 186 stroke:red
463463
175v1-->176v1
464-
174v1--x|0|177v1; linkStyle 188 stroke:red
464+
174v1-->|0|177v1
465465
176v1-->|1|177v1
466-
173v1--x|0|178v1; linkStyle 190 stroke:red
466+
173v1-->|0|178v1
467467
177v1-->|1|178v1
468468
178v1-->179v1
469469
162v1-->|input|180v1
@@ -489,7 +489,7 @@ linkStyle default stroke:#aaa
489489
196v1-->197v1
490490
197v1-->198v1
491491
199v1-->200v1
492-
198v1--x|0|201v1; linkStyle 216 stroke:red
492+
198v1-->|0|201v1
493493
200v1-->|1|201v1
494494
201v1-->202v1
495495
195v1-->|input|203v1
@@ -504,9 +504,9 @@ linkStyle default stroke:#aaa
504504
208v1-->|input|209v1
505505
25v1--x|single|209v1; linkStyle 229 stroke:red
506506
209v1-->210v1
507-
204v1--x|0|211v1; linkStyle 231 stroke:red
507+
204v1-->|0|211v1
508508
210v1-->|1|211v1
509-
194v1--x|0|212v1; linkStyle 233 stroke:red
509+
194v1-->|0|212v1
510510
211v1-->|1|212v1
511511
128v1-->213v1
512512
212v1-->|input|214v1
@@ -521,7 +521,7 @@ linkStyle default stroke:#aaa
521521
221v1-->222v1
522522
222v1-->223v1
523523
223v1-->224v1
524-
187v1--x|0|225v1; linkStyle 248 stroke:red
524+
187v1-->|0|225v1
525525
224v1-->|1|225v1
526526
225v1-->226v1
527527
226v1-->227v1
@@ -538,7 +538,7 @@ linkStyle default stroke:#aaa
538538
231v1--x|neg|236v1; linkStyle 262 stroke:red
539539
236v1-->237v1
540540
247v1--o238v1; linkStyle 264 stroke:red
541-
238v1--x|0|239v1; linkStyle 265 stroke:red
541+
238v1-->|0|239v1
542542
216v1-->|1|239v1
543543
239v1-->240v1
544544
237v1--o241v1; linkStyle 268 stroke:red

hydro_test/src/cluster/snapshots/two_pc_ir@coordinator_mermaid.snap

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ linkStyle default stroke:#aaa
7676
13v1-->14v1
7777
14v1-->15v1
7878
15v1-->16v1
79-
1v1--x|0|17v1; linkStyle 14 stroke:red
79+
1v1-->|0|17v1
8080
16v1-->|1|17v1
8181
17v1-->18v1
8282
18v1-->19v1
@@ -102,7 +102,7 @@ linkStyle default stroke:#aaa
102102
39v1-->40v1
103103
40v1-->41v1
104104
41v1-->42v1
105-
29v1--x|0|43v1; linkStyle 40 stroke:red
105+
29v1-->|0|43v1
106106
42v1-->|1|43v1
107107
43v1-->44v1
108108
44v1-->45v1
@@ -117,14 +117,14 @@ linkStyle default stroke:#aaa
117117
53v1-->54v1
118118
55v1-->56v1
119119
48v1-->55v1
120+
28v1
120121
10v1
121122
11v1
122-
28v1
123-
36v1
124-
37v1
125123
54v1
126124
55v1
127125
56v1
126+
36v1
127+
37v1
128128
subgraph var_cycle_2 ["var <tt>cycle_2</tt>"]
129129
style var_cycle_2 fill:transparent
130130
24v1

0 commit comments

Comments
 (0)