Skip to content

refactor(dfir_lang): remove stratum, add push codegen, test reduce, reduce_keyed, reduce_no_replay#2966

Open
MingweiSamuel wants to merge 1 commit into
mingwei/newpush-foldfrom
mingwei/newpush-reduce
Open

refactor(dfir_lang): remove stratum, add push codegen, test reduce, reduce_keyed, reduce_no_replay#2966
MingweiSamuel wants to merge 1 commit into
mingwei/newpush-foldfrom
mingwei/newpush-reduce

Conversation

@MingweiSamuel

Copy link
Copy Markdown
Member

No description provided.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 19, 2026

Copy link
Copy Markdown

Deploying hydro with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8a2b324
Status: ✅  Deploy successful!
Preview URL: https://80ebb3ea.hydroflow.pages.dev
Branch Preview URL: https://mingwei-newpush-reduce.hydroflow.pages.dev

View logs

MingweiSamuel added a commit that referenced this pull request Jun 19, 2026
@MingweiSamuel MingweiSamuel force-pushed the mingwei/newpush-fold branch from 909fde1 to ecf3876 Compare June 19, 2026 20:31
@MingweiSamuel MingweiSamuel force-pushed the mingwei/newpush-reduce branch from 93d6298 to a23896f Compare June 19, 2026 20:31
@MingweiSamuel MingweiSamuel force-pushed the mingwei/newpush-fold branch from ecf3876 to f810461 Compare June 19, 2026 20:44
@MingweiSamuel MingweiSamuel force-pushed the mingwei/newpush-reduce branch 3 times, most recently from d8a1f65 to 870055e Compare June 19, 2026 21:02
@MingweiSamuel MingweiSamuel force-pushed the mingwei/newpush-fold branch from f810461 to 571efde Compare June 19, 2026 21:02
@MingweiSamuel MingweiSamuel marked this pull request as ready for review June 19, 2026 21:36
Copilot AI review requested due to automatic review settings June 19, 2026 21:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.

Refactors dfir_lang reduce-family operators to remove stratum-based delay typing and adds push-side codegen paths, with new/updated tests to validate push behavior (including no-replay semantics).

Changes:

  • Add push-side surface tests for reduce, reduce_keyed, and reduce_no_replay.
  • Update reduce, reduce_keyed, and reduce_no_replay operator codegen to support push outputs and remove DelayType::Stratum.
  • Refresh compile-fail .stderr expectations for reduce_keyed bad-type cases.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
dfir_rs/tests/surface_push_blocking.rs Adds new push-side tests for reduce, reduce_keyed, and reduce_no_replay.
dfir_rs/tests/compile-fail/stable/surface_reduce_keyed_badtype_option.stderr Updates expected compiler output for keyed-reduce bad option input.
dfir_rs/tests/compile-fail/stable/surface_reduce_keyed_badtype_int.stderr Updates expected compiler output for keyed-reduce bad int input.
dfir_lang/src/graph/ops/reduce_no_replay.rs Removes stratum delay typing and adds push codegen that attempts “no replay” gating.
dfir_lang/src/graph/ops/reduce_keyed.rs Removes stratum delay typing and adds push codegen path for keyed reduce.
dfir_lang/src/graph/ops/reduce.rs Removes stratum delay typing and adds push codegen that forwards output when downstream exists.

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

Comment on lines +119 to +128
let write_iterator = if !is_pull {
let output = &outputs[0];
quote_spanned! {op_span=>
let #ident = #root::dfir_pipes::push::ReduceKeyed::new(
&mut #singleton_output_ident,
#aggfn,
#output,
);
}
} else {
Comment on lines +125 to +144
let #was_updated_ident = ::std::cell::Cell::new(false);
let #ident = #root::dfir_pipes::push::reduce_ref(
&mut #singleton_output_ident,
|#accumulator_ident: &mut _, #item_ident| {
#was_updated_ident.set(true);
#[allow(clippy::redundant_closure_call)]
(#func)(#accumulator_ident, #item_ident);
},
#root::dfir_pipes::push::filter(
{
let __was_updated = &#was_updated_ident;
let __context: &_ = #context;
move |_| __was_updated.get() || __context.current_tick().0 == 0
},
#root::dfir_pipes::push::map(
|__val: &mut _| ::std::clone::Clone::clone(&*__val),
#output,
),
),
);
@MingweiSamuel MingweiSamuel force-pushed the mingwei/newpush-fold branch from 571efde to 36df39f Compare June 19, 2026 21:46
@MingweiSamuel MingweiSamuel force-pushed the mingwei/newpush-reduce branch 2 times, most recently from e565624 to c8d8e3a Compare June 19, 2026 22:05
@MingweiSamuel MingweiSamuel force-pushed the mingwei/newpush-fold branch 2 times, most recently from 18965f1 to d0bf7c3 Compare June 20, 2026 01:27
@MingweiSamuel MingweiSamuel force-pushed the mingwei/newpush-reduce branch from c8d8e3a to bc727b8 Compare June 20, 2026 01:27
@MingweiSamuel MingweiSamuel force-pushed the mingwei/newpush-reduce branch from bc727b8 to 8a2b324 Compare June 20, 2026 17:11
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