Corgi join: one path for every projection - #899
Merged
Merged
Conversation
The corgi join routed projections that `compilable` rejected (a `case`, list intro, a data-driven tag) through a second path: join with the identity projection, then apply the terms as a rebased row-environment `Project`. The premise was that join projections are compiled before any container is in hand. They are not: `CorgiJoinBackend` compiles the projection per block against the matched columns' shapes, so every term it can lower as a `Project` it can lower in the join. Removes `compilable`, `rebase_join_term`, and the fallback branch; the `join_fallback` test program stays, with its header rewritten. Measured (ddir_server, corgi backend, joins of two random 1M-edge relations on 200k nodes, then 50 ticks of 1000 changes; two runs each, master-next -> this): a `case` projection loads in 1.43-1.46s -> 1.48s with churn unchanged (437-438ms -> 439-440ms for the 50 ticks); a plain projection is unchanged (1.44-1.45s, 436-438ms). The small load cost is the per-block compile of the `case` term, which the fallback compiled once; caching the graph by shape in the join would remove it if it matters. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
The corgi join routed projections that
compilablerejected (acase, listintro, a data-driven tag) through a second path: join with the identity
projection, then apply the terms as a rebased row-environment
Project. Thepremise was that join projections are compiled before any container is in
hand. They are not:
CorgiJoinBackendcompiles the projection per blockagainst the matched columns' shapes, so every term it can lower as a
Projectit can lower in the join.
Removes
compilable,rebase_join_term, and the fallback branch; thejoin_fallbacktest program stays, with its header rewritten.Measured (ddir_server, corgi backend, joins of two random 1M-edge relations
on 200k nodes, then 50 ticks of 1000 changes; two runs each, master-next ->
this): a
caseprojection loads in 1.43-1.46s -> 1.48s with churn unchanged(437-438ms -> 439-440ms for the 50 ticks); a plain projection is unchanged
(1.44-1.45s, 436-438ms). The small load cost is the per-block compile of the
caseterm, which the fallback compiled once; caching the graph by shape inthe join would remove it if it matters.
Validation: workspace tests pass (including
join_fallback, which checks agreement with the vec backend); clippy warning count unchanged.🤖 Generated with Claude Code