mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-09 08:04:45 +00:00
runCatchUpUp used negentropyReconcileIds, which builds the FULL need+have id lists in memory even though the up direction only needs haveIds — on a large window (e.g. 1M local events against an empty upstream) that is a ~100 MB+ heap spike per convergence round, plus a needIds list built and immediately discarded. Switch to the streaming negentropyReconcile: publish each haveIds batch as it arrives (bounded to one batch of ids) and drop the need direction via a no-op onNeedIds. The publish still suspends the reconcile round, so the back-pressure and the reconcile-as-delivery-check convergence loop are unchanged — only the peak memory drops from O(window) to O(batch). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012EZeWww5TJnzBZKPoc6mvU