LearnNewsExamplesServices
Frontmatter
id19502
titleSparse ancestors emit an included grandchild's delta twice
stateClosed
labels
bugaiperformancecore
assigneesneo-gpt-sophie
createdAtOct 9, 2026, 4:25 PM
updatedAtOct 9, 2026, 7:47 PM
githubUrlhttps://github.com/neomjs/neo/issues/19502
authorneo-gpt-sophie
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[x] 8890 Fix VDOM Update Collision Logic for Sparse Trees (Teleportation)
blocking[]
closedAtOct 9, 2026, 7:47 PM
milestonev13.2

Sparse ancestors emit an included grandchild's delta twice

Closed v13.2.0/archive-v13-2-0-chunk-24 bugaiperformancecore
neo-gpt-sophie
neo-gpt-sophie commented on Oct 9, 2026, 4:25 PM

Context

Ada's review of #19499 raised a finite-depth leapfrog hypothesis. A live unit-harness falsifier confirmed it: one sparse ancestor payload and its separately emitted grandchild both produce the same text delta. Executed receipt. This is extra work, not the lost update repaired by #8890; the final vnode is correct.

The Problem

Initialize and settle root → parent → B, then:

root.setSilent({style: {color: 'green'}, updateDepth: 2});
b.setSilent({text: 'B new'});
await root.promiseUpdate();

At 8f497d9f4e, root's merged IDs contain B and its bridge parent. The batch emits root and B, and returns two identical {id: B.id, textContent: 'B new'} deltas. No fabricated merge entries are needed.

The Architectural Reality

Design authority: VdomLifecycle.executeVdomUpdate publishes a disjoint batch and says to remove child roots already covered by a parent. VDomUpdate.getMergedChildIds explicitly includes bridge ancestors. TreeBuilder.#buildTree expands allowlisted descendants even at the nominal depth boundary. The retained depth-only half of the collision predicate does not describe that actual sparse coverage.

The historical intent is recorded in #8834's double-update investigation and later sparse-tree restoration. This leaf preserves both; it does not force every payload to depth 1.

The Fix

Refine collision filtering in src/mixin/VdomLifecycle.mjs:executeVdomUpdate so an actual sparse scope deduplicates by its retained allowlist, including a descendant at or beyond nominal depth. Dense scopes retain their depth coverage rule. Reuse the existing scope snapshot from #19499. A leapfrogged root whose payload is absorbed must retain its in-flight protection and callback ownership until adoption; the ancestor's nominal depth does not protect it. A predicate-only repair was falsified by the busy-Main browser control: a later promise observed the earlier vnode.

Extend the existing SparseUpdates.spec.mjs with the natural grandchild sequence and a dense-depth boundary control. No new module or public API is needed.

Decision Record impact: none; restoration of internal batch coverage. Contract Ledger: not applicable, no added or changed public/consumed signature.

Acceptance Criteria

  • AC-1 A naturally merged grandchild at distance 2 under a sparse depth-2 ancestor produces exactly one new-text delta and adopts its new vnode.
  • AC-2 A deeper bridge path is preserved, while clean sibling branches remain pruned.
  • AC-3 A finite dense parent that does not reach the grandchild keeps that grandchild's separate root; depth-1 disjoint and full-depth controls still pass.
  • AC-4 The excluded-sibling lost-update regression from #8890 remains fixed; related VDOM tests pass without adding a full-tree traversal or allowlist copy.
  • AC-5 Browser E2E coverage exercises the real App → VDom → Main → App pipeline with dedicated and shared workers: the old duplicate-delta case fails before repair and passes afterward; assert Main's delta stream, real DOM, and adopted vnode. Include a second write after payload collection while Main is busy: its promise must settle only after the newer vnode is adopted. Unit tests alone do not satisfy this gate (operator direction, 2026-10-09).

Out of Scope

No force-dense fallback, TreeBuilder protocol change, cross-window lifecycle redesign, claim of duplicated DOM content, or alteration of #19499's approved head.

Avoided Traps

Deduplicating equal deltas after Helper runs would hide redundant payload construction and processing. Fix ownership before dispatch instead. Nominal depth cannot stand in for actual sparse inclusion.

Ownership and sequencing

Sophie owns this bounded follow-up. Prerequisite #8890 / #19499 merged as a43fdd381b on 2026-10-09; implementation is now based on that accepted scope snapshot.

Related

#8890 · #19499 · #8834. Release focus: v13.2.

Live latest-open sweep: latest 20 open issues, created descending, and latest 30 all-state A2A messages read at 2026-10-09 14:25 UTC; no competing leaf/claim. Title searches for duplicate sparse / collision leapfrog returned no equivalent. KB surfaced #8834 and #17980; their bodies distinguish the historical epic and an in-flight escalation defect. MC problem-noun sweep recovered the January duplicate-text investigation (41248ce5), not a current leaf. Own-assignment sweep: only #8890, whose body addresses lost, excluded updates. Labels verified live.

Origin Session ID: e6ce4d70-a7ff-454e-996d-e7c25efdf4cf

Retrieval Hint: "sparse ancestor grandchild depth 2 duplicate text delta leapfrog"