Skip to content

Commit fb0c2a7

Browse files
cleanup: remove SubgraphId, SubgraphTag, LoopId, LoopTag, simplify StateLifespan
Remove `SubgraphTag`, `SubgraphId`, `LoopTag`, `LoopId` from `scheduled/mod.rs` — no longer used after removing the `sg_id` parameter from `schedule_subgraph`. Simplify `StateLifespan` to only have `Tick` variant — `Subgraph`, `Loop`, and `Static` variants were unused. Co-authored-by: Infinity 🤖 <infinity@hydro.run> PR: #2812
2 parents 13ed945 + 9a6d569 commit fb0c2a7

15 files changed

Lines changed: 12 additions & 95 deletions

File tree

dfir_lang/src/graph/meta_graph.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1497,15 +1497,9 @@ impl DfirGraph {
14971497
#( #subgraph_blocks )*
14981498

14991499
// For non-lazy defer_tick: if any deferred buffer has data,
1500-
// signal that another tick should run (sets can_start_tick).
1501-
// Inline DFIR doesn't dynamically schedule subgraph IDs, so the
1502-
// subgraph ID here is a meaningless placeholder.
1503-
// TODO(cleanup): remove the subgraph ID parameter once scheduled DFIR is gone.
1500+
// signal that another tick should run.
15041501
if false #( || !#defer_tick_buf_idents.is_empty() )* {
1505-
#df.schedule_subgraph(
1506-
#root::scheduled::SubgraphId::from_raw(0),
1507-
true,
1508-
);
1502+
#df.schedule_subgraph(true);
15091503
}
15101504

15111505
// End-of-tick state reset (e.g. 'tick persistence).

dfir_lang/src/graph/ops/cross_join_multiset.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ pub const CROSS_JOIN_MULTISET: OperatorConstraints = OperatorConstraints {
112112
.then(|| {
113113
quote_spanned! {op_span=>
114114
// Reschedule the subgraph lazily to ensure replay on later ticks.
115-
#context.schedule_subgraph(#context.current_subgraph(), false);
115+
116116
}
117117
});
118118
let write_iterator_after = quote_spanned! {op_span=>

dfir_lang/src/graph/ops/fold.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ pub const FOLD: OperatorConstraints = OperatorConstraints {
5050
input_delaytype_fn: |_| Some(DelayType::Stratum),
5151
write_fn: |wc @ &WriteContextArgs {
5252
root,
53-
context,
5453
op_span,
5554
work_fn,
5655
work_fn_async,
@@ -139,18 +138,9 @@ pub const FOLD: OperatorConstraints = OperatorConstraints {
139138
}
140139
};
141140

142-
let write_iterator_after = if let Persistence::Static | Persistence::Tick = persistence {
143-
quote_spanned! {op_span=>
144-
#context.schedule_subgraph(#context.current_subgraph(), false);
145-
}
146-
} else {
147-
Default::default()
148-
};
149-
150141
Ok(OperatorWriteOutput {
151142
write_prologue,
152143
write_iterator,
153-
write_iterator_after,
154144
write_tick_end,
155145
..Default::default()
156146
})

dfir_lang/src/graph/ops/fold_keyed.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ pub const FOLD_KEYED: OperatorConstraints = OperatorConstraints {
262262
Persistence::None | Persistence::Tick | Persistence::Loop => Default::default(),
263263
Persistence::Static | Persistence::Mutable => quote_spanned! {op_span=>
264264
// Reschedule the subgraph lazily to ensure replay on later ticks.
265-
#context.schedule_subgraph(#context.current_subgraph(), false);
265+
266266
},
267267
};
268268

dfir_lang/src/graph/ops/join.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -210,23 +210,12 @@ pub const JOIN: OperatorConstraints = OperatorConstraints {
210210
};
211211
};
212212

213-
let write_iterator_after =
214-
if persistences[0] == Persistence::Static || persistences[1] == Persistence::Static {
215-
quote_spanned! {op_span=>
216-
// TODO: Probably only need to schedule if #*_borrow.len() > 0?
217-
#context.schedule_subgraph(#context.current_subgraph(), false);
218-
}
219-
} else {
220-
quote_spanned! {op_span=>}
221-
};
222-
223213
Ok(OperatorWriteOutput {
224214
write_prologue: quote_spanned! {op_span=>
225215
#lhs_prologue
226216
#rhs_prologue
227217
},
228218
write_iterator,
229-
write_iterator_after,
230219
write_tick_end: quote_spanned! {op_span=>
231220
#lhs_tick_end
232221
#rhs_tick_end

dfir_lang/src/graph/ops/join_fused.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ pub const JOIN_FUSED: OperatorConstraints = OperatorConstraints {
113113
input_delaytype_fn: |_| Some(DelayType::Stratum),
114114
write_fn: |wc @ &WriteContextArgs {
115115
root,
116-
context,
117116
op_span,
118117
work_fn_async,
119118
ident,
@@ -170,23 +169,12 @@ pub const JOIN_FUSED: OperatorConstraints = OperatorConstraints {
170169
};
171170
};
172171

173-
let write_iterator_after =
174-
if persistences[0] == Persistence::Static || persistences[1] == Persistence::Static {
175-
quote_spanned! {op_span=>
176-
// TODO: Probably only need to schedule if #*_borrow.len() > 0?
177-
#context.schedule_subgraph(#context.current_subgraph(), false);
178-
}
179-
} else {
180-
quote_spanned! {op_span=>}
181-
};
182-
183172
Ok(OperatorWriteOutput {
184173
write_prologue: quote_spanned! {op_span=>
185174
#lhs_prologue
186175
#rhs_prologue
187176
},
188177
write_iterator,
189-
write_iterator_after,
190178
write_tick_end: quote_spanned! {op_span=>
191179
#lhs_tick_end
192180
#rhs_tick_end

dfir_lang/src/graph/ops/join_fused_lhs.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -127,23 +127,12 @@ pub const JOIN_FUSED_LHS: OperatorConstraints = OperatorConstraints {
127127
Persistence::Mutable => unreachable!(),
128128
};
129129

130-
let write_iterator_after =
131-
if persistences[0] == Persistence::Static || persistences[1] == Persistence::Static {
132-
quote_spanned! {op_span=>
133-
// TODO: Probably only need to schedule if #*_borrow.len() > 0?
134-
#context.schedule_subgraph(#context.current_subgraph(), false);
135-
}
136-
} else {
137-
quote_spanned! {op_span=>}
138-
};
139-
140130
Ok(OperatorWriteOutput {
141131
write_prologue: quote_spanned! {op_span=>
142132
#lhs_prologue
143133
#rhs_prologue
144134
},
145135
write_iterator,
146-
write_iterator_after,
147136
write_tick_end: lhs_tick_end,
148137
..Default::default()
149138
})

dfir_lang/src/graph/ops/persist.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ pub const PERSIST: OperatorConstraints = OperatorConstraints {
135135
};
136136

137137
let write_iterator_after = quote_spanned! {op_span=>
138-
#context.schedule_subgraph(#context.current_subgraph(), false);
138+
139139
};
140140

141141
Ok(OperatorWriteOutput {

dfir_lang/src/graph/ops/persist_mut.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ pub const PERSIST_MUT: OperatorConstraints = OperatorConstraints {
114114
};
115115

116116
let write_iterator_after = quote_spanned! {op_span=>
117-
#context.schedule_subgraph(#context.current_subgraph(), false);
117+
118118
};
119119

120120
Ok(OperatorWriteOutput {

dfir_lang/src/graph/ops/persist_mut_keyed.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ pub const PERSIST_MUT_KEYED: OperatorConstraints = OperatorConstraints {
127127
};
128128

129129
let write_iterator_after = quote_spanned! {op_span=>
130-
#context.schedule_subgraph(#context.current_subgraph(), false);
130+
131131
};
132132

133133
Ok(OperatorWriteOutput {

0 commit comments

Comments
 (0)