There was fully wrong logic in comparison: was actually accessing memory past the array boundary. Run test manually and the figure seems correct to me now. Spotted by @LazyDodo, thanks!
There was fully wrong logic in comparison: was actually accessing memory past the array boundary. Run test manually and the figure seems correct to me now. Spotted by @LazyDodo, thanks!