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: d69aa91
Status: ✅  Deploy successful!
Preview URL: https://4d9d7437.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 thread dfir_lang/src/graph/ops/reduce_keyed.rs Outdated
Comment thread dfir_lang/src/graph/ops/reduce_no_replay.rs
@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 2 times, most recently from bc727b8 to 8a2b324 Compare June 20, 2026 17:11
@MingweiSamuel MingweiSamuel force-pushed the mingwei/newpush-fold branch from d0bf7c3 to 618e6fc Compare June 22, 2026 16:49
@MingweiSamuel MingweiSamuel force-pushed the mingwei/newpush-reduce branch 2 times, most recently from 86682ff to f836d0e Compare June 22, 2026 21:40
@MingweiSamuel MingweiSamuel force-pushed the mingwei/newpush-fold branch from 618e6fc to 8614b49 Compare June 22, 2026 21:40
… `reduce_keyed`, `reduce_no_replay`

PR: #2966

Handle outputs.is_empty() in reduce_keyed push path

Restructured the write_iterator logic in reduce_keyed.rs to follow the
standard pattern: `if is_pull { ... } else if outputs.is_empty() { ... } else { ... }`.

Previously, the `!is_pull` branch unconditionally accessed `outputs[0]`,
which would panic if reduce_keyed was used as a terminal push operator
with no downstream outputs (e.g., as a singleton reference target).

The new `outputs.is_empty()` branch generates a `for_each`-style sink
that accumulates into the hashtable without forwarding downstream,
matching the pattern used by reduce, fold, reduce_no_replay, and
fold_no_replay.

Co-authored-by: Infinity 🤖 <infinity@hydro.run>
PR: #2966
@MingweiSamuel MingweiSamuel force-pushed the mingwei/newpush-reduce branch from f836d0e to d69aa91 Compare June 22, 2026 21:40
@MingweiSamuel MingweiSamuel force-pushed the mingwei/newpush-fold branch from 8614b49 to 23dee17 Compare June 22, 2026 21:40

@shadaj shadaj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice! Very clean.

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.

3 participants