johnny-morrice / godelbrot

Unix-style Mandelbrot set renderer in Golang
MIT License
8 stars 1 forks source link

Region optimisation render glitch with certain aspect ratio #9

Closed johnny-morrice closed 8 years ago

johnny-morrice commented 8 years ago

I don't know why but

godelbrot --palette pretty --width 1920 --height 1078 > error.png

Will produce a glitched image. Other resolutions seem okay.

johnny-morrice commented 8 years ago

Checked data races and unit tests; all is good there.

johnny-morrice commented 8 years ago

Glitch present regardless of aspect ratio fix

johnny-morrice commented 8 years ago

Glitch is in sequence delegation of region render algorithm.

This delegation has been a source of several bugs; will do performance analysis to make case for ditching it.

johnny-morrice commented 8 years ago

Glitch is only present with collapse param 8!

What luck to choose that default.

Quick fix by making the collapse size smaller; more regions.

johnny-morrice commented 8 years ago

Fixed with 9746769

johnny-morrice commented 8 years ago

That mitigated the problem but looking closer there is still some distortion.

johnny-morrice commented 8 years ago

The root cause is that my algorithm implementation is numerically unstable under certain conditions.

The algorithm is rather fiddly, in a few different aspects.

The fix is to have the configurator only choose this algorithm when stable sizes are used.

A longer term solution is to devise a successor algorithm that is more stable.