LearnNewsExamplesServices
Frontmatter
id14945
titleScale changed-topology slot assignment before Demo B
stateOpen
labels
enhancementaiarchitectureperformance
assigneesneo-gpt
createdAt7:57 AM
updatedAt7:57 AM
githubUrlhttps://github.com/neomjs/neo/issues/14945
authorneo-gpt
commentsCount0
parentIssue13158
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]

Scale changed-topology slot assignment before Demo B

Open Backlog/active-chunk-5 enhancementaiarchitectureperformance
neo-gpt
neo-gpt commented on 7:57 AM

Context

PR #14925 makes the changed-topology reconciler correct and fail-closed, but its exact-head DockTopologyReconciler.assignSlots() implementation explores every skip/pair branch in the window-assignment space. Direct dense probes at 72da2822baad921c86404ae8a4d7be59fe748783 measured approximately 431 ms for 8×8 and 5.4 s for 9×9. That cost is not a merge-safety defect while there is no runtime consumer; it becomes one before Demo-B scene G4 consumes the result.

Live latest-open sweep: checked the latest 20 open issues plus GitHub search, repository issue/discussion artifacts, Knowledge Base tickets, and the latest 30 A2A messages at 2026-07-10T05:57:03.906Z; no equivalent successor was found.

The Problem

The current exhaustive search is a useful correctness oracle, but its combinatorial growth makes ordinary multi-window restore latency unpredictable. Replacing it carelessly would reintroduce the greedy trap already disproved during review or weaken the deterministic tie contract that makes topology restore permutation-stable.

The Architectural Reality

src/dashboard/DockTopologyReconciler.mjs owns a pure Body-side assignment boundary. Its ordered objective is part of the contract:

  1. maximize mapped-slot cardinality;
  2. maximize summed Jaccard affinity;
  3. maximize summed structural affinity;
  4. choose the lexicographically smallest content signature;
  5. use live-index order only for content-identical candidates.

The solver must remain id-free, preserve workspace-global uniqueness and captured-item conservation, create no windows, and leave the planner/reconciliation result vocabulary unchanged. ADR 0029 §2.2 and #14668 remain the authorities; #14590 is the first planned consumer.

The Fix

Replace the production exhaustive traversal with a polynomial/scalable assignment solver that preserves the full ordered objective. Keep a bounded form of the current exhaustive algorithm in tests as an independent oracle for small matrices. Add randomized equivalence and permutation probes, plus a reproducible dense-topology benchmark that demonstrates the runtime curve before the Demo-B integration is enabled.

Contract Ledger

Target Surface Source of Authority Proposed Behavior Fallback Docs Evidence
DockTopologyReconciler.assignSlots(capturedDocs, liveDocs) ADR 0029 §2.2 + #14668 Same mapping/unmapped/unmatchedLive contract and exact objective ordering, implemented with a documented polynomial bound Existing fail-closed validation and reason classes remain unchanged Update method JSDoc with the chosen algorithm and complexity Exhaustive-oracle equivalence, permutation properties, focused dashboard specs, dense benchmark

Decision Record impact: aligned-with ADR 0029.

Acceptance Criteria

  • Production assignment no longer enumerates the full skip/pair search tree; the chosen algorithm and worst-case complexity are documented.
  • For bounded randomized matrices, the new solver is output-equivalent to the exhaustive oracle across cardinality, both affinity sums, content-signature ties, and content-identical live-index ties.
  • Captured/live input permutations preserve the content-canonical result established by #14668.
  • Existing uniqueness, conservation, reason-class, pass-through, and no-window-creation specs remain green.
  • A reproducible dense 8×8 / 9×9 / 12×12 benchmark is recorded, demonstrating that the 9×9 case no longer incurs multi-second assignment latency.
  • Demo-B scene G4 does not enable the reconciler as a runtime path until this ticket lands.
  • Cross-family review.

Out of Scope

Changing affinity semantics; adding IDs; changing restore result shapes; UI work; window spawning; weakening validation; broad dashboard refactors.

Avoided Traps

  • Do not restore the greedy captured-order algorithm; the existing greedy-trap spec is authoritative.
  • Do not gain speed by dropping deterministic content ties or workspace-global invariants.
  • Do not turn a benchmark into a hardware-fragile wall-clock CI gate; correctness properties remain the merge gate and benchmark evidence records the scale curve.
  • Do not broaden this into Demo-B UI delivery.

Related

Parent: #13158
Related: #14668 #14925 #14590

Origin Session ID: de713f27-0e82-4960-b4c6-f281e0c36449

Retrieval Hint: "DockTopologyReconciler exhaustive assignment 8x8 9x9 polynomial solver content-stable tie conservation"