Repository navigation
DDIR: a delta join's strict paths drop the imports' history at the as-of time - #1026
Merged
frankmcsherry merged 1 commit intoOct 24, 2026
Conversation
…-of time A program reads every import as of `(e - 1, [])` and runs at times at or beyond it, so every time a half join's arrangement presents is at or beyond the as-of time. An update at exactly that time meets only arranged rows at it, and a strict half join meets none. An update keeps its own time along a chain of half joins, so once every path from a lifted stream reaches a strict half join, its updates at the as-of time produce nothing. In a delta join that is every path but the one that is non-strict throughout, which today carries the imports' whole history only to discard it. Install now drops those updates where the stream is lifted, with a filter on the time `lift` writes, so any backend runs it with the operators it has. A lift that other readers share, as both paths of a self-join do, keeps its rows, and the filter goes on the edges to the readers it is dead for. Only time-preserving stages may sit between the lift and the strict half join. The rewrite applies in nested scopes too, where the as-of time has zero coordinates. The shapes are inferred again after it, and install falls back to the program as written if they disagree. On a late-installed three-way delta join over imports with eight epochs of history, install plus first tick took 696-713 ms against 783-795 ms with dense keys and 61 ms against 124 ms with sparse ones; steady ticks are unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_019XsakwFGwtESwZ1gSYwG4o
This was referenced Oct 24, 2026
frankmcsherry
added a commit
that referenced
this pull request
Oct 24, 2026
…te (#1028) The as-of rewrite (#1026) re-checks shapes after it runs, which cannot show that results match. `Server::set_as_of_drop` (default on) turns the rewrite off for programs installed afterwards, and a new `asof` difftest oracle uses it: each case's delta form is installed after its inputs have history, once with the rewrite and once without, and every epoch's exports must agree. Over 2,000 seeds the rewrite fired 2,938 times in place and 1,264 times on shared-lift edges, 1,892 of them in nested scopes. When a lift is shared, the rewrite put filters on the dead readers' edges only if the lift was its node's last op. The filter reads the time `lift` wrote into the row, and `filter` and `negate` leave the row as it is, so the edge filters now also go after a node whose ops past the lift are only those. Other tails (`project`, `flat_map`, `lift_iter`) may move or drop the lifted time and are left alone; handling them would need tracking the time through lambdas, or duplicating the tail on the dead edges at a cost every tick. Claude-Session: https://claude.ai/code/session_019XsakwFGwtESwZ1gSYwG4o Co-authored-by: GPT-6 Sol (Codex) <[email protected]> Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since #1024 and #1025, a program reads every import as of its as-of time
(e - 1, []), and runs at times at or beyond it. So every time a half join's arrangement presents is at or beyond the as-of time.This is a certain rewrite, so it is automatic. Install runs it after the projection step, with the program's as-of time (
interactive/src/as_of.rs).filteron the timeliftwrites. Any backend runs it with the operators it has.lift_iter,flat_map. Any other reader makes the stream live.Tests
as_of.rs:delaybefore the half join, or an exported lift;server_late_import.rs: a three-way delta join over three imports, installed at epochs 0, 7 and 12, with column and arranged imports, matches the plain join. If the rule is deliberately broken so non-strict paths drop too, this test and the existing self-join delta test both fail.cargo test -p interactive -p ddir-server: 211 passed.cargo check --all-targets: no warnings. Clippy: nothing new.delta,split,bind,reinstall, 2,000 seeds with late installs: all passed.The saving
A three-way delta join over imports with eight epochs of history: three inputs, 50,000 rows each per epoch, with retractions, installed late. Install plus first tick, three alternated runs each:
Steady ticks are unchanged, and the outputs are identical. The probe is kept out of the tree.
🤖 Generated with Claude Code
https://claude.ai/code/session_019XsakwFGwtESwZ1gSYwG4o