Repository navigation
Conversation
chh-ay
added this pull request to stack #69
October 4, 2026 12:29
Spills are calculated in cell order. A spill that reads cells of a spill placed later in the same pass read the previous values and was not calculated again, so it stayed one edit behind. The recalculation now logs the cells each spill changes, finds the spills that read them before the change, and calculates those again. A spill that keeps coming back reads its own output through other spills and gets #CYCLE!.
chh-ay
force-pushed
the
fix/spill-references
branch
from
October 4, 2026 12:50
d2e3b1c to
e725d98
Compare
86 of 96 tasks
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
Spill references (
A1#) in both engines, and a fix for spills that read other spills. Part of #59. Stacked on #64 (basefix/array-constants).Problems
B1 = SORT(C1:C5)andC1 = SEQUENCE(5), B1 got[1,0,0,0,0]. Spills that read each other could also loop without an error.A1#was not supported. Excel uses it to refer to the whole current spill of a cell, and XLSX files store it as_xlfn.ANCHORARRAY(A1).Change
#CYCLE!.#after a cell reference (also with a sheet name:'Report'!B2#) asANCHORARRAY(cell).ANCHORARRAYcannot be typed as a function. The formula text keeps theA1#form.A1#becomes the range that the anchor spills into now, so SUM, INDEX, ROWS, COUNTIF, SORT and the other range functions accept it without special code. Only formulas that containA1#(a flag set at parse time) do this step.A1#returns#REF!when the anchor holds no spill (a value, or a blocked#SPILL!). Row and column edits move the reference with its anchor; deleting the anchor gives#REF!(Rust andremapFormulaA1Refs).A1#readers that already ran in the pass are queued again. This includes 1×1 spills._xlfn.ANCHORARRAY(ref)toref#; export converts back. Text in quotes is not changed.=J1#after its anchor column was deleted) does not enter the spill path. It returns#REF!instead of an empty spill bound.Limits
At this layer
=A1#*10returns#VALUE!, the same as=A1:A3*10: operators are scalar-only here. #71 adds element-wise array operators higher in the stack, after which=A1#*10spills the scaled values.Size
@sheetwrite/wasmraw@sheetwrite/wasmBrotli (q11)@sheetwrite/formulasrawVerification
[1,0,0,0,0]), mutual spills end as#CYCLE!,A1#parse/serialize, live resize with SUM/ROWS/INDEX/COUNTIF, shift and delete, readers before their anchor (also 1×1 and same-size value changes), and=J1#with an invalid anchor returns#REF!. A mutation that removes the anchor notice fails the reader-before-anchor test.--features analysis) pass; clippy passes in both configurations.SUM(_xlfn.ANCHORARRAY(A1))and reads back=SUM(A1#). A1 remap tests cover the#suffix.api:checkanddocs:checkpass.=SORT(A1#,1,-1)followsA1 = SEQUENCE(D1)from 3 to 5 rows, and becomes#REF!when A1 changes to a value.