Repository navigation
DDIR: compile join, half-join and reduce lambdas once - #1070
Merged
frankmcsherry merged 1 commit intoNov 3, 2026
Merged
Conversation
`slot_graph` compiles each slot at the shapes it reads, and the join, half-join and reduce backends then compiled its graph again at the same input before narrowing it. `compile_projection` and `compile_reduce` now return the `corgi::Compiled` itself, and those backends narrow it directly; the map, filter, flatmap and join-function paths take its graph as before. Compiling again at the same input changed nothing: a temporary check over the interactive test suite compared the two graphs at all 53,801 slot compiles and found them equal. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01H6wB4H99TLw4tqu4x48pXL
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 join, half-join and reduce backends no longer compile their lambda a second time at the same input before narrowing it.
On the LDBC SF1 one-off replay this takes 70 µs off each IC read's install (757 to 687 µs), with identical answers.
Why
slot_graphcompiles every slot at the shapes it reads.The three backends then ran
corgi::compileagain on that graph, at the same input, beforecorgi::narrow.A profile of one-off installs put the second compile plus narrowing at 140 of IS2's 462 µs install, and 177 of the average IC read's 757.
What changes
slot_graphreturns thecorgi::Compiledit makes.compile_projectionandcompile_reducereturn thatCompiled, so the join, half-join and reduce backends narrow it directly..graph().Compiling again at the same input changed nothing.
A temporary check, not committed, compiled every slot a second time during the interactive test suite and compared the graphs: all 53,801 were equal.
Measurements
One run, mini-02, one worker, diagnostics on, against a stored run of
a6b7922awith the same uncommitted install timers on both sides.Answer and physical digests are identical on all 808 ticks.
Per IC family the saving ranges from 25 µs (IC13) to 171 µs (IC1).
Tests
cargo test -p interactive: 294 passed, 0 failed, 9 ignored; no warnings.Implemented and measured by Claude Code.
🤖 Generated with Claude Code
https://claude.ai/code/session_01H6wB4H99TLw4tqu4x48pXL