Repository navigation
Deprecate the session-less optimize and keep constructors lazy - #11091
Draft
robert3005 wants to merge 1 commit into
Draft
robert3005 wants to merge 1 commit into
robert3005 wants to merge 1 commit into
Conversation
This was referenced Nov 2, 2026
robert3005
force-pushed
the
rk/deprecate-sessionless-optimize
branch
2 times, most recently
from
November 2, 2026 12:28
b724ab6 to
083a5b5
Compare
robert3005
force-pushed
the
rk/deprecate-sessionless-optimize
branch
2 times, most recently
from
November 2, 2026 15:11
9d26236 to
45724a5
Compare
robert3005
force-pushed
the
rk/deprecate-sessionless-optimize
branch
from
November 2, 2026 16:53
45724a5 to
f9f348f
Compare
ArrayOptimizer::optimize uses only the static rules of the encodings, so it misses the kernels a session registers. It is now deprecated in favour of optimize_ctx, which takes the session or an ExecutionCtx created from it through the new AsOptimizerKernels trait. optimize_recursive takes the same argument. Constructors such as slice, filter, take, cast, fill_null, get_item and apply no longer optimize the arrays they build. Execution optimizes each node it reaches, and the callers that read an array's encoding directly optimize it with their session first: the scan tasks, the plan v2 operators, the dict layout writer, the FFI scan, and CUDA dispatch. The default append_to_builder optimizes the array first and appends through the encoding it reduces to, so a lazy slice of a constant appends as a constant. Signed-off-by: Robert Kruszewski <github@robertk.io>
robert3005
force-pushed
the
rk/deprecate-sessionless-optimize
branch
from
November 2, 2026 19:18
f9f348f to
37c91a6
Compare
This branch has not been deployed
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.
ArrayOptimizer::optimizeuses only the static rules of the encodings, so it misses the kernels that a session registers. This PR deprecates it, and array constructors no longer optimize the arrays they build.Changes
optimize_ctxandoptimize_recursivetake&impl AsOptimizerKernels, which is aVortexSessionor anExecutionCtxcreated from one. Existingoptimize_ctx(&session)callers compile without changes.slice,filter,take,cast,fill_null,get_itemandapplyreturn lazy arrays. Execution optimizes each node it reaches (Optimize arrays bottom up and as execution reaches them #11090). Callers that read the encoding of an array directly now optimize it with their session first: scan tasks, plan v2 operators, the dict layout writer, the FFI scan and CUDA dispatch.append_to_builderoptimizes the array first. It then appends through the encoding the array reduces to, so a lazy slice of a constant appends as a constant.optimize_ctx(&SESSION)instead ofoptimize().API Changes
ArrayOptimizer::optimizeis deprecated. Useoptimize_ctxwith the session or anExecutionCtx.ArrayOptimizer::optimize_ctxandoptimize_recursiveare generic overAsOptimizerKernels.ArrayRef::slice,filter,takeand theArrayBuiltinsmethods no longer return an optimized array.