From 552143c37718a6fac90e6d854bba4196627f661f Mon Sep 17 00:00:00 2001 From: Frank McSherry Date: Wed, 29 Jul 2026 12:48:10 -0400 Subject: [PATCH 1/3] int_proxy join: draw the proxy collection lazily, a block at a time The proxy join performed the whole of a unit's work inside `prep`, and returned an iterator that spilled the finished containers. The driver's fuel budget was therefore spent after the fact. `present0`/`present1` are replaced by a single `advance`, which populates both bridges with the intersecting keys from `from` onward and updates `from`. This removes the two-phase presentation, in which the whole fresh side was materialized to derive the key filter for the other side. A unit's progress through the key space rides in `from` rather than in the backend, so the harness can interleave the calls of the many units it has in flight. `cross` populates a `Vec` rather than returning one container. Both granularities are the backend's: `advance` sizes the block it draws, `cross` the containers it cuts. The operator's own `JOIN_CHUNK` policy is gone, along with the mid-key flushing it needed; the operator draws a block, merge-matches it whole, and hands the matches back. A single key's matches are held whole, as under the cursor tactic. `JoinInstance` owns its batches, which drops its lifetime parameter and lets the iterator hold it as a single field. Debug assertions enforce the `advance` contract: bridges sorted and consolidated, `from` strictly increasing or exhausted, and each reported key hash confined to the block that first mentions it. The last guards the case that would otherwise be silently wrong rather than a panic, and the `from` check also guards liveness. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01ErrnMtBsvrvncVeYL51TMv --- .../src/operators/int_proxy/join.rs | 274 ++++++++++++------ 1 file changed, 183 insertions(+), 91 deletions(-) diff --git a/differential-dataflow/src/operators/int_proxy/join.rs b/differential-dataflow/src/operators/int_proxy/join.rs index 7a02d1b1f..05d6b1a9d 100644 --- a/differential-dataflow/src/operators/int_proxy/join.rs +++ b/differential-dataflow/src/operators/int_proxy/join.rs @@ -3,8 +3,10 @@ //! A conventional differential join against `(u64, u64)` values, which are provided by //! and then interpreted by a backend, who is relieved of lattice-time reasoning. +use std::cell::RefCell; +use std::rc::Rc; + use timely::progress::{Antichain, Timestamp}; -use timely::progress::frontier::AntichainRef; use crate::difference::{Multiply, Semigroup}; use crate::lattice::Lattice; @@ -15,19 +17,27 @@ use crate::operators::join::{Fresh, JoinTactic}; use super::history::IdHistory; /// A unit of proxied join work, presented to the backend. -pub struct JoinInstance<'a, B0: BatchReader, B1: BatchReader