- Add node id tie-breaker to sort comparator so equal-distance nodes
have deterministic ordering across renders (prevents flicker)
- Log validNodesCount instead of allNodes.length so the message
reflects the actual post-filter count
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sort nodes by squared distance from viewport center before applying the
render limit, so visible nodes always make the cut instead of arbitrary
selection causing gaps that shift as you pan.
Also: inject node provider for testability, deduplicate validity filter,
and reduce debug log spam to state transitions only.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>