Context
Surfaced during the #20022 AC-1 v13.3.1 release-gate audit of the two single-test hosted CI reds seen on dev this week (run 39853023569, commit 058e374357, shard e2e-brain (5/10) — PremeasureRowsNL.spec.mjs:77, "column resize and resetRowHeights re-measure hidden pre-rendered cells"). Full Playwright trace diagnosis (1-trace.trace DOM snapshots + test.trace call timeline) is recorded on #20022 (#20022#issuecomment-6354226190) with lead disposition in #20022#issuecomment-6354251452.
The Problem
In test/playwright/e2e/grid/PremeasureRowsNL.spec.mjs:77-92, after resizing textColumnId from 240 to 213.5 and calling view.resetRowHeights(), expect.poll at lines 88-90 timed out after 5,000 ms because .neo-grid-row-measure-cell[data-field="text"] remained at width: 240px (['240px']) instead of updating to ['213.5px'].
From 1-trace.trace (run 39853023569):
- Initial ahead-measure (
Snapshot 24, ts = 39748.65 ms): View#runAheadMeasure() renders #neo-grid-body-1__row_measure at generation = 1 with text column width: 240px (#neo-grid-row-2__measure_1_0_1__text).
- Column resize (
Snapshot 38, ts = 39923.28 ms): Resizing textColumnId to 213.5px triggers Body#afterExecuteVdomUpdate() → measureRowHeights().then(() => measureAheadRows()) (src/grid/View.mjs:1144). measureRowHeights() updates mounted row heights (totalHeight: 21665px → 21790px, Snapshot 40) and synchronously calls me.update() (View.mjs:1293), setting me.isVdomUpdating = true so the chained runAheadMeasure() returns early at View.mjs:832.
resetRowHeights() leaves stale ahead-measure DOM and layout cache (Snapshot 45, ts = 39965.40 ms): view.resetRowHeights() (src/grid/View.mjs:1114-1137) clears me.#measureKeys and resets rowGeometry back to the 32px estimate (totalHeight = 9632px), without clearing body.rowMeasureVdom (clearMeasureProjection()) or me.#measureLayout = [] (unlike updateRowGeometry() at View.mjs:1323). As a result, hidden.waitFor({state: 'attached'}) (PremeasureRowsNL.spec.mjs:86) resolves immediately against the stale generation = 1 (240px) measure node.
- Expanded estimate window poisons
#measureKeys for post-shrink ahead rows (Snapshots 45–52): Because resetRowHeights() resets all row heights to the 32px estimate in Snapshot 45, body.mountedRows temporarily expands from [0, 15] to [0, 29] (29 visible rows 0..28). When Snapshot 45 lands, measureRowHeights() runs on all 29 mounted rows (0..28), populates me.#measureKeys with width: '213.5px' for every index 0..28, and calls setRowHeights(heights) — which shrinks body.mountedRows back to [0, 15] (Snapshot 52, ts = 39987.38 ms, hiding rows 15..28 with display: none) while setting me.isVdomUpdating = true. When runAheadMeasure() finally runs on settled Snapshot 52 (View.mjs:859-869), [start, end] = body.mountedRows is [0, 15], so the ahead window [0, end + 8] (0..22) is a strict subset of 0..28 already recorded in me.#measureKeys at '213.5px'. Every ahead row is skipped at View.mjs:868, producing targets.length === 0 and leaving the stale 240px nodes in body.rowMeasureVdom for the entire 5,000 ms poll.
The Architectural Reality
Design authority: src/grid/View.mjs:1110-1113 (resetRowHeights JSDoc: "Clears measured row heights and re-runs measurement from the base estimate.") and src/grid/View.mjs:1321-1324 (updateRowGeometry: me.#measureLayout = []; me.body?.clearMeasureProjection()).
src/grid/View.mjs:1114-1137 (resetRowHeights): clears me.#measureKeys.clear() and me.#measureToken++, but omits me.#measureLayout = [] and me.body?.clearMeasureProjection().
src/grid/View.mjs:831-875 (runAheadMeasure) & src/grid/View.mjs:1210-1305 (measureRowHeights): when measureRowHeights() measures a transient estimate-expanded mountedRows range [0, 29] and setRowHeights() immediately shrinks mountedRows back to [0, 15], rows 16..28 are no longer mounted in the settled viewport, yet their #measureKeys entries prevent runAheadMeasure() from projecting the ahead-measure pool or clearing stale rowMeasureVdom.
The Fix
- In
Neo.grid.View#resetRowHeights() (src/grid/View.mjs:1114-1137), clear me.#measureLayout = [] and call me.body?.clearMeasureProjection() before triggering the reset VDOM update, matching updateRowGeometry() (line 1323).
- In
src/grid/View.mjs, ensure that when runAheadMeasure() evaluates the ahead window after resetRowHeights() / setRowHeights(), either body.rowMeasureVdom reflects the current column layout (#measureLayout) or #measureKeys entries for rows outside the post-setRowHeights mountedRows window do not suppress ahead-projection updates while rowMeasureVdom still holds stale-width cells.
Contract Ledger
| Target Surface |
Source of Authority |
Proposed Behavior |
Fallback / Edge |
Docs |
Evidence |
Neo.grid.View#resetRowHeights (src/grid/View.mjs) |
src/grid/View.mjs:1110-1137 |
Clears #measureLayout and body.clearMeasureProjection() alongside #measureKeys and rowGeometry.reset() |
No-op when rowGeometry or body is absent |
JSDoc on View#resetRowHeights |
PremeasureRows.spec.mjs (unit) + PremeasureRowsNL.spec.mjs (e2e) |
Neo.grid.View#runAheadMeasure (src/grid/View.mjs) |
src/grid/View.mjs:831-890 |
Re-projects or clears rowMeasureVdom when column layout changed while isVdomUpdating deferred runAheadMeasure |
Preserves existing #measureKeys deduplication for settled mounted/ahead rows |
JSDoc on View#runAheadMeasure |
PremeasureRowsNL.spec.mjs:77 3/3 pass |
Decision Record impact: none
Acceptance Criteria
Out of Scope
- Workstation / dock projection changes (
#20022).
- Replacing the main-thread hidden pre-render pass architecture established in Discussion
#19645.
Avoided Traps
- Do not increase the
expect.poll timeout in PremeasureRowsNL.spec.mjs:88-90: in the traced failure, Snapshot 52 settled at 39987.38 ms with targets.length === 0 and zero subsequent VDOM updates for the remaining 4,940 ms, so a longer timeout still fails.
Related
unowned-rationale: Pre-existing grid ahead-measure projection race surfaced during the #20022 AC-1 v13.3.1 release-gate audit; does not block the v13.3.1 patch cut per lead disposition (#20022#issuecomment-6354251452).
Live latest-open sweep: checked latest 20 open issues in neomjs/neo at 2026-10-23T00:26:37Z; no equivalent found (#20009 and #19515 are unrelated grid issues).
A2A in-flight claim sweep: checked latest 30 messages (status: 'all') at 2026-10-23T00:26:26Z; no competing claim.
MC sweep: neomjs/neo PremeasureRowsNL resetRowHeights measureRowHeights rowMeasureVdom runAheadMeasure, 5 results, no prior ticket or decline found.
Own-assignment sweep: 0 open in neomjs/neo, none overlapping.
Origin Session ID: 2ebc6210-9d88-4eb6-a97b-ee57663be8e2
Retrieval Hint: "PremeasureRowsNL resetRowHeights clearMeasureProjection measureKeys mountedRows 39853023569"
Context
Surfaced during the
#20022AC-1v13.3.1release-gate audit of the two single-test hosted CI reds seen ondevthis week (run39853023569, commit058e374357, sharde2e-brain (5/10)—PremeasureRowsNL.spec.mjs:77, "column resize and resetRowHeights re-measure hidden pre-rendered cells"). Full Playwright trace diagnosis (1-trace.traceDOM snapshots +test.tracecall timeline) is recorded on#20022(#20022#issuecomment-6354226190) with lead disposition in#20022#issuecomment-6354251452.The Problem
In
test/playwright/e2e/grid/PremeasureRowsNL.spec.mjs:77-92, after resizingtextColumnIdfrom240to213.5and callingview.resetRowHeights(),expect.pollatlines 88-90timed out after5,000 msbecause.neo-grid-row-measure-cell[data-field="text"]remained atwidth: 240px(['240px']) instead of updating to['213.5px'].From
1-trace.trace(run 39853023569):Snapshot 24,ts = 39748.65 ms):View#runAheadMeasure()renders#neo-grid-body-1__row_measureatgeneration = 1withtextcolumnwidth: 240px(#neo-grid-row-2__measure_1_0_1__text).Snapshot 38,ts = 39923.28 ms): ResizingtextColumnIdto213.5pxtriggersBody#afterExecuteVdomUpdate()→measureRowHeights().then(() => measureAheadRows())(src/grid/View.mjs:1144).measureRowHeights()updates mounted row heights (totalHeight: 21665px→21790px,Snapshot 40) and synchronously callsme.update()(View.mjs:1293), settingme.isVdomUpdating = trueso the chainedrunAheadMeasure()returns early atView.mjs:832.resetRowHeights()leaves stale ahead-measure DOM and layout cache (Snapshot 45,ts = 39965.40 ms):view.resetRowHeights()(src/grid/View.mjs:1114-1137) clearsme.#measureKeysand resetsrowGeometryback to the32pxestimate (totalHeight = 9632px), without clearingbody.rowMeasureVdom(clearMeasureProjection()) orme.#measureLayout = [](unlikeupdateRowGeometry()atView.mjs:1323). As a result,hidden.waitFor({state: 'attached'})(PremeasureRowsNL.spec.mjs:86) resolves immediately against the stalegeneration = 1(240px) measure node.#measureKeysfor post-shrink ahead rows (Snapshots 45–52): BecauseresetRowHeights()resets all row heights to the32pxestimate inSnapshot 45,body.mountedRowstemporarily expands from[0, 15]to[0, 29](29visible rows0..28). WhenSnapshot 45lands,measureRowHeights()runs on all29mounted rows (0..28), populatesme.#measureKeyswithwidth: '213.5px'for every index0..28, and callssetRowHeights(heights)— which shrinksbody.mountedRowsback to[0, 15](Snapshot 52,ts = 39987.38 ms, hiding rows15..28withdisplay: none) while settingme.isVdomUpdating = true. WhenrunAheadMeasure()finally runs on settledSnapshot 52(View.mjs:859-869),[start, end] = body.mountedRowsis[0, 15], so the ahead window[0, end + 8](0..22) is a strict subset of0..28already recorded inme.#measureKeysat'213.5px'. Every ahead row is skipped atView.mjs:868, producingtargets.length === 0and leaving the stale240pxnodes inbody.rowMeasureVdomfor the entire5,000 mspoll.The Architectural Reality
Design authority:
src/grid/View.mjs:1110-1113(resetRowHeightsJSDoc: "Clears measured row heights and re-runs measurement from the base estimate.") andsrc/grid/View.mjs:1321-1324(updateRowGeometry:me.#measureLayout = []; me.body?.clearMeasureProjection()).src/grid/View.mjs:1114-1137(resetRowHeights): clearsme.#measureKeys.clear()andme.#measureToken++, but omitsme.#measureLayout = []andme.body?.clearMeasureProjection().src/grid/View.mjs:831-875(runAheadMeasure) &src/grid/View.mjs:1210-1305(measureRowHeights): whenmeasureRowHeights()measures a transient estimate-expandedmountedRowsrange[0, 29]andsetRowHeights()immediately shrinksmountedRowsback to[0, 15], rows16..28are no longer mounted in the settled viewport, yet their#measureKeysentries preventrunAheadMeasure()from projecting the ahead-measure pool or clearing stalerowMeasureVdom.The Fix
Neo.grid.View#resetRowHeights()(src/grid/View.mjs:1114-1137), clearme.#measureLayout = []and callme.body?.clearMeasureProjection()before triggering the reset VDOM update, matchingupdateRowGeometry()(line 1323).src/grid/View.mjs, ensure that whenrunAheadMeasure()evaluates the ahead window afterresetRowHeights()/setRowHeights(), eitherbody.rowMeasureVdomreflects the current column layout (#measureLayout) or#measureKeysentries for rows outside the post-setRowHeightsmountedRowswindow do not suppress ahead-projection updates whilerowMeasureVdomstill holds stale-width cells.Contract Ledger
Neo.grid.View#resetRowHeights(src/grid/View.mjs)src/grid/View.mjs:1110-1137#measureLayoutandbody.clearMeasureProjection()alongside#measureKeysandrowGeometry.reset()rowGeometryorbodyis absentView#resetRowHeightsPremeasureRows.spec.mjs(unit) +PremeasureRowsNL.spec.mjs(e2e)Neo.grid.View#runAheadMeasure(src/grid/View.mjs)src/grid/View.mjs:831-890rowMeasureVdomwhen column layout changed whileisVdomUpdatingdeferredrunAheadMeasure#measureKeysdeduplication for settled mounted/ahead rowsView#runAheadMeasurePremeasureRowsNL.spec.mjs:773/3 passDecision Record impact: none
Acceptance Criteria
Neo.grid.View#resetRowHeights()clears#measureLayoutand callsbody.clearMeasureProjection()so stalerowMeasureVdomnodes from a prior generation cannot remain attached across a height reset.view.resetRowHeights()deterministically updates or re-projects ahead-measure cells at the new column width withoutmeasureRowHeights()on the transient32px-estimate window suppressingrunAheadMeasure()whilerowMeasureVdomholds old-width cells.test/playwright/unit/grid/PremeasureRows.spec.mjsandtest/playwright/e2e/grid/PremeasureRowsNL.spec.mjspass3/3.Out of Scope
#20022).#19645.Avoided Traps
expect.polltimeout inPremeasureRowsNL.spec.mjs:88-90: in the traced failure,Snapshot 52settled at39987.38 mswithtargets.length === 0and zero subsequent VDOM updates for the remaining4,940 ms, so a longer timeout still fails.Related
#20022(AC-1,#20022#issuecomment-6354226190,#20022#issuecomment-6354251452)#19663,#19688unowned-rationale: Pre-existing grid ahead-measure projection race surfaced during the #20022 AC-1 v13.3.1 release-gate audit; does not block the v13.3.1 patch cut per lead disposition (#20022#issuecomment-6354251452).
Live latest-open sweep: checked latest 20 open issues in
neomjs/neoat 2026-10-23T00:26:37Z; no equivalent found (#20009and#19515are unrelated grid issues). A2A in-flight claim sweep: checked latest 30 messages (status: 'all') at 2026-10-23T00:26:26Z; no competing claim. MC sweep:neomjs/neo PremeasureRowsNL resetRowHeights measureRowHeights rowMeasureVdom runAheadMeasure, 5 results, no prior ticket or decline found. Own-assignment sweep: 0 open inneomjs/neo, none overlapping.Origin Session ID: 2ebc6210-9d88-4eb6-a97b-ee57663be8e2 Retrieval Hint: "PremeasureRowsNL resetRowHeights clearMeasureProjection measureKeys mountedRows 39853023569"