Skip to content

refactor(dfir_rs,dfir_lang): remove schedule_subgraph's SubgraphId arg, no-op calls, and remove current_subgraph#2811

Open
MingweiSamuel wants to merge 4 commits intomainfrom
mingwei/delete-schedule-subgraph-args
Open

refactor(dfir_rs,dfir_lang): remove schedule_subgraph's SubgraphId arg, no-op calls, and remove current_subgraph#2811
MingweiSamuel wants to merge 4 commits intomainfrom
mingwei/delete-schedule-subgraph-args

Conversation

@MingweiSamuel
Copy link
Copy Markdown
Member

STACK: #2801

Remove the unused sg_id: SubgraphId parameter from
Context::schedule_subgraph — inline mode ignores it. Remove
Context::current_subgraph which always returned a dummy value.

Update all operator codegen call sites to drop the
#context.current_subgraph() argument.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 24, 2026

Deploying hydro with  Cloudflare Pages  Cloudflare Pages

Latest commit: 08d7f92
Status: ✅  Deploy successful!
Preview URL: https://a499fa70.hydroflow.pages.dev
Branch Preview URL: https://mingwei-delete-schedule-subg.hydroflow.pages.dev

View logs

@MingweiSamuel MingweiSamuel force-pushed the mingwei/delete-schedule-subgraph-args branch from 1eaa2d7 to f18330d Compare April 28, 2026 17:09
MingweiSamuel added a commit that referenced this pull request Apr 30, 2026
…urrent_subgraph

Remove the unused `sg_id: SubgraphId` parameter from
`Context::schedule_subgraph` — inline mode ignores it. Remove
`Context::current_subgraph` which always returned a dummy value.

Update all operator codegen call sites to drop the
`#context.current_subgraph()` argument.

Co-authored-by: Infinity 🤖 <infinity@hydro.run>
PR: #2811
@MingweiSamuel MingweiSamuel force-pushed the mingwei/delete-schedule-subgraph-args branch from f18330d to dff5ea2 Compare April 30, 2026 02:30
MingweiSamuel added a commit that referenced this pull request Apr 30, 2026
Remove all `schedule_subgraph(false)` calls from operator codegen —
these were no-ops since `schedule_subgraph` only acts when
`is_external` is `true`. Clean up the `schedule_subgraph(true)` call
in meta_graph.rs formatting.

Co-authored-by: Infinity 🤖 <infinity@hydro.run>
PR: #2811
MingweiSamuel added a commit that referenced this pull request Apr 30, 2026
@MingweiSamuel MingweiSamuel changed the base branch from main to mingwei/delete-state-api-usage April 30, 2026 02:30
@MingweiSamuel MingweiSamuel force-pushed the mingwei/delete-state-api-usage branch from 3f07d0e to c56d8d8 Compare April 30, 2026 18:57
@MingweiSamuel MingweiSamuel force-pushed the mingwei/delete-schedule-subgraph-args branch 2 times, most recently from 92141d6 to 8228f3a Compare April 30, 2026 23:18
@MingweiSamuel MingweiSamuel force-pushed the mingwei/delete-state-api-usage branch from c56d8d8 to 37ebe2e Compare April 30, 2026 23:18
@MingweiSamuel MingweiSamuel force-pushed the mingwei/delete-schedule-subgraph-args branch from 8228f3a to 2fda058 Compare May 1, 2026 16:43
@MingweiSamuel MingweiSamuel force-pushed the mingwei/delete-state-api-usage branch from 37ebe2e to af90c89 Compare May 1, 2026 16:43
@MingweiSamuel MingweiSamuel force-pushed the mingwei/delete-schedule-subgraph-args branch from 2fda058 to 9a6d569 Compare May 1, 2026 18:02
@MingweiSamuel MingweiSamuel force-pushed the mingwei/delete-state-api-usage branch from af90c89 to 094abd4 Compare May 1, 2026 18:02
@MingweiSamuel MingweiSamuel force-pushed the mingwei/delete-schedule-subgraph-args branch from 9a6d569 to 005e138 Compare May 1, 2026 18:44
Base automatically changed from mingwei/delete-state-api-usage to main May 1, 2026 21:33
MingweiSamuel and others added 3 commits May 1, 2026 22:43
…urrent_subgraph

Remove the unused `sg_id: SubgraphId` parameter from
`Context::schedule_subgraph` — inline mode ignores it. Remove
`Context::current_subgraph` which always returned a dummy value.

Update all operator codegen call sites to drop the
`#context.current_subgraph()` argument.

Co-authored-by: Infinity 🤖 <infinity@hydro.run>
PR: #2811
Remove all `schedule_subgraph(false)` calls from operator codegen —
these were no-ops since `schedule_subgraph` only acts when
`is_external` is `true`. Clean up the `schedule_subgraph(true)` call
in meta_graph.rs formatting.

Co-authored-by: Infinity 🤖 <infinity@hydro.run>
PR: #2811
@MingweiSamuel MingweiSamuel force-pushed the mingwei/delete-schedule-subgraph-args branch from 005e138 to 176446f Compare May 1, 2026 22:48
@MingweiSamuel MingweiSamuel marked this pull request as ready for review May 2, 2026 01:05
@MingweiSamuel MingweiSamuel requested review from a team and Copilot May 2, 2026 01:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR simplifies the inline DFIR runtime/context API by removing subgraph-ID plumbing that was effectively unused in inline mode, and updates dfir_lang operator codegen accordingly.

Changes:

  • Remove Context::current_subgraph() and drop the SubgraphId parameter from Context::schedule_subgraph(...).
  • Update operator codegen call sites to stop passing #context.current_subgraph() and to use the new schedule_subgraph(bool) signature where needed.
  • Adjust inline codegen in meta_graph to use the new scheduling API.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
dfir_rs/src/scheduled/context.rs Removes current_subgraph and simplifies schedule_subgraph to only accept is_external.
dfir_lang/src/graph/ops/spin.rs Updates to context.schedule_subgraph(true) with new signature.
dfir_lang/src/graph/ops/reduce_keyed.rs Drops old scheduling call (now leaves an empty quote_spanned! arm).
dfir_lang/src/graph/ops/reduce.rs Removes now-unused context binding and removes no-op iterator-after scheduling.
dfir_lang/src/graph/ops/persist_mut_keyed.rs Drops old scheduling call (now leaves an empty write_iterator_after).
dfir_lang/src/graph/ops/persist_mut.rs Drops old scheduling call (now leaves an empty write_iterator_after).
dfir_lang/src/graph/ops/persist.rs Drops old scheduling call (now leaves an empty write_iterator_after).
dfir_lang/src/graph/ops/join_fused_lhs.rs Removes no-op iterator-after scheduling logic.
dfir_lang/src/graph/ops/join_fused.rs Removes now-unused context binding and no-op iterator-after scheduling logic.
dfir_lang/src/graph/ops/join.rs Removes no-op iterator-after scheduling logic.
dfir_lang/src/graph/ops/fold_keyed.rs Drops old scheduling call (now leaves an empty quote_spanned! arm).
dfir_lang/src/graph/ops/fold.rs Removes now-unused context binding and removes no-op iterator-after scheduling.
dfir_lang/src/graph/ops/cross_join_multiset.rs Drops old scheduling call (now leaves dead replay_code / empty tokens).
dfir_lang/src/graph/meta_graph.rs Updates generated inline tick code to call df.schedule_subgraph(true) with new signature.
Comments suppressed due to low confidence (1)

dfir_lang/src/graph/ops/cross_join_multiset.rs:120

  • replay_code is now generated as an empty TokenStream (only a comment remains), so the whole then(|| { ... }) branch and write_iterator_after effectively do nothing. Consider removing this dead code (and/or replacing it with None / Default::default()), and update the comment since no rescheduling happens anymore.
        .then(|| {
            quote_spanned! {op_span=>
                // Reschedule the subgraph lazily to ensure replay on later ticks.
                
            }
        });
        let write_iterator_after = quote_spanned! {op_span=>
            #replay_code
        };

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread dfir_lang/src/graph/ops/reduce_keyed.rs Outdated
Comment thread dfir_lang/src/graph/ops/fold_keyed.rs Outdated
Comment thread dfir_lang/src/graph/ops/persist.rs Outdated
Comment thread dfir_lang/src/graph/ops/persist_mut.rs Outdated
Comment thread dfir_lang/src/graph/ops/persist_mut_keyed.rs Outdated
…bgraph removal

Remove now-empty `write_iterator_after` assignments in reduce_keyed.rs,
fold_keyed.rs, persist.rs, persist_mut.rs, and persist_mut_keyed.rs.
These were left as empty `quote_spanned!` blocks (some with stale
"Reschedule the subgraph" comments) after the schedule_subgraph call
was removed. Since `..Default::default()` is already used in the
OperatorWriteOutput construction, these fields can simply be omitted.

Co-authored-by: Infinity 🤖 <infinity@hydro.run>
PR: #2811
@MingweiSamuel MingweiSamuel changed the title refactor(dfir_rs,dfir_lang): remove SubgraphId argument from schedule_subgraph, remove current_subgraph refactor(dfir_rs,dfir_lang): remove schedule_subgraph's SubgraphId arg, no-op calls, and remove current_subgraph May 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants