Alternative approach#2
Draft
carlosdelest wants to merge 7 commits into
Draft
Conversation
Adds support for arithmetic operations - '+', '-', '*' and '/' when one operands is a dense_vector and other is scalar. Performs the arithmetic operation on each element of the dense_vector against the scalar operand. Closes elastic#140538
carlosdelest
commented
Feb 12, 2026
| return new Add(source(), left(), right(), configuration); | ||
| } | ||
|
|
||
| private static final DenseVectorBinaryEvaluator ADD_DENSE_VECTOR_EVALUATOR = new DenseVectorBinaryEvaluator() { |
Author
There was a problem hiding this comment.
I've moved the evaluators to their corresponding operations - kind of made more sense to me
Author
There was a problem hiding this comment.
I've removed this one in favor of DenseVectorScalarEvaluator - but it's a very similar solution, only using a single Evaluator and flipping the operation to do
| return warnings; | ||
| } | ||
|
|
||
| static float processAdd(double lhs, double rhs) { |
Author
There was a problem hiding this comment.
I moved the specific subclasses to the operations
| this.source = source; | ||
| this.scalar = lhs; | ||
| this.vector = rhs; | ||
| // flip the order of arguments for scalar-vector operations, as we assume the scalar is always the rhs in the processing |
Author
There was a problem hiding this comment.
Here is the trick - we use a single evaluator, and flip the operation args in case the scalar - vector are in different order than expected
| public interface DenseVectorBinaryEvaluator { | ||
| // when both arguments are dense_vectors | ||
| EvalOperator.ExpressionEvaluator.Factory apply( | ||
| EvalOperator.ExpressionEvaluator.Factory vectorOperation( |
Author
There was a problem hiding this comment.
Very similar to what you had - just renaming
kkharbas
force-pushed
the
dense_vector-arithmetic-scalar
branch
from
February 23, 2026 19:30
2e234fe to
a6ee999
Compare
kkharbas
pushed a commit
that referenced
this pull request
May 29, 2026
Without --foreground, GNU timeout(1) puts the wrapped bash (and its gradle child) into a fresh process group. The gradle CLI JVM then prints BUILD SUCCESSFUL + the build-scan URL but never exits — the develocity scan plugin's shutdown path stalls until our inner timeout fires SIGTERM, ~36 minutes wasted per flakiness step. Confirmed via a 4-variant matrix run as build #2 of elasticsearch-flakiness-detection-manual on branch wrapper-hang-diagnostic: D bare gradle, no wrapper 1m25s baseline B wrapper + --foreground 1m39s +14s vs baseline (clean) A current wrapper 3m23s killed by inner timeout C wrapper + gradle --no-daemon 3m31s killed by inner timeout Only A and C reproduce the production hang; --foreground (B) fixes it without changing gradle invocation. --no-daemon (C) does not help, ruling out the gradle daemon as the cause. Fixes the systematic 58-minute wall every recent flakiness-detection step has been hitting (builds 150149, 150259, 150411, 150439, 150444, 150445, 150515, ...).
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.
Hey Kishor:
I've been looking at this - didn't come with a better solution, but wanted to get your opinion on some changes. Feel free to dismiss!