Repository navigation
Conversation
The element-wise operator path assumed every operand it reached was an array. A scalar-producing operand made the unary path report `#VALUE!` instead of the scalar result, so `=-LET(x,SEQUENCE(3),1)` lost its `-1`, and a spill reference whose anchor holds no spill replaced the scalar expression's error, so `=H1#*10` reported `#VALUE!` instead of `#REF!`. Operands that `eval_dynamic_array` answers with no matrix now evaluate as scalars, and a resolved spill reference that leaves no array keeps the scalar error. Adds the regression cases for unary `-`, `+` and `%` over a scalar LET and for a missing spill, and marks the shared scalar helpers `#[inline]`.
chh-ay
added this pull request to stack #69
October 5, 2026 11:16
This was referenced Oct 5, 2026
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.
Scope
Element-wise array operators in both engines. Part of #59. Stacked on #70 (base
perf/formula-kernels).Problem
Operators accepted only scalars.
=A1:A3*10,=SUM(A1:A3*B1:B3),=FILTER(B1:B12, E1:E12>=1000), and=SUMPRODUCT((A1:A3>5)*B1:B3)returned#VALUE!(or0) in both engines, and=A1#*10could not scale a spill.Change
refactor(wasm): unary, binary, and comparison semantics move intoeval/operators.rs; scalar evaluation calls them unchanged.feat(formulas): an operator applies element by element when an operand is an array (range, array constant, spill reference, or array result). A scalar, a single row, or a single column expands to match the other operand (Excel broadcasting). Element errors stay in their cells. Array results spill, and functions such asSUM,SUMPRODUCT,INDEX,IF,FILTER, andSORTBYaccept them.fix(formulas): a formula classified as possibly array-valued that resolves to a scalar keeps its scalar result (=-LET(x,SEQUENCE(3),1)is-1), and#REF!from an invalid spill reference stays#REF!(=H1#*10).=A1#*10.Behavior change:
=VSTACK(B2,A1)+0now spills both values instead of returning the first one, as in Excel.Measurement
Interleaved ABBA capture, one fresh process per sample, each side loading its own built package, both locks held, CPU pinned. Untouched 100k independent recompute: +0.21% (bootstrap 95% CI 0.96–1.08), inside the A/A noise band. A sequential control gave −0.44%. An earlier +8.3% reading did not reproduce under either protocol.
Size
7f73dc7)8773d2a)Verification
#REF!fixes) fail on499570a(3 default, 4 analysis) and pass now.--features analysis) pass; clippy passes in both configurations.api:check, anddocs:checkpass.=A1:A3*10→ 10, 20, 30;=SUMPRODUCT((A1:A3>1)*B1:B3)→ 50;=FILTER(B1:B12,E1:E12>=1000)spills; before, all three were#VALUE!.