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>