Welcome to Fractal Forums

Fractal Software => Apophysis Programs => Topic started by: hansdampf on September 09, 2013, 05:13:02 PM




Title: Apophysis 7x16
Post by: hansdampf on September 09, 2013, 05:13:02 PM
Rendering a picture in apo 7x16 resulted in very different blue-colours only. I have long experiences with different apo-versions, but such phenomenon had never appeared before. The results are attached, first a screen-shot, second the render result. Until now, this never happened again, but I am nerveous it could (imagine: it may appeares after many hours of high-quality render!).
Is there somebody who knows something about that phenomenon?
In words: the screen-shot shows red green blue yellow and the rendered picture different blue colours only.
Greetings hansdampf


Title: Re: Apophysis 7x16
Post by: Nahee_Enterprises on September 10, 2013, 06:18:59 AM
    Rendering a picture in apo 7x16 resulted in very different blue-colours only.  I have long experiences with different
    apo-versions, but such phenomenon had never appeared before.  The results are attached, first a screen-shot,
    second the render result.  Until now, this never happened again, but I am nerveous it could (imagine: it may appeares
    after many hours of high-quality render!).    Is there somebody who knows something about that phenomenon?
    In words: the screen-shot shows red green blue yellow and the rendered picture different blue colours only.

I have seen something similar happen before, but it usually happens when I have been on the computer for a very long time, and have had many applications running during that time.  Usually I just close everything and shutdown the computer (a complete power-off).  Then wait a minute before booting back up.  When I try it again, the "problem" no longer happens.     :D
 


Title: Re: Apophysis 7x16
Post by: hansdampf on September 10, 2013, 05:13:48 PM
I have seen something similar happen before, but it usually happens when I have been on the computer for a very long time, and have had many applications running during that time.  Usually I just close everything and shutdown the computer (a complete power-off).  Then wait a minute before booting back up.  When I try it again, the "problem" no longer happens.     :D
 

thanks a lot! I will try this next time, may be that fix the problem. But it is not understood?  :) :flowers:


Title: Re: Apophysis 7x16
Post by: lycium on November 25, 2013, 02:58:55 AM
Hi, sorry for the extremely late reply to this - I've had this thread open in a tab for ages meaning to answer!

The problem has two root causes: incorrect generation and use of random numbers in the iteration core, basically just faulty statistics. The other problem is unguarded memory access by multiple threads to the histogram/image buffer. Both problems get much worse with multi-threading in various ways; FarDareisMai on deviantArt has made a comprehensive study of these problems, but it's still not published anywhere unfortunately. I've looked at the Apophysis code now and then over the years (to try and figure out weird render differences with Chaotica), and as far as I can tell this problem is deeply entrenched in the old codebase, and with the lack of developers working on it I don't imagine it'll be fixed anytime soon :S

I finally answer this now because there was recently some discussion about a new GPU renderer, with questions about correctness in this regard: http://www.fractalforums.com/announcements-and-news/fractorium-a-new-gpu-accelerated-flam3-fractal-flame-renderer/


Title: Re: Apophysis 7x16
Post by: mfeemster on November 25, 2013, 05:04:51 PM
This interests me a lot. I'm already familiar with the thread locking issue, so I'll skip that, but the randomness part sparks my interest.

I haven't looked too deeply into the Apo code, but I know flam3 inside out. Their statistics/RNG do the following:

-Use the high quality ISAAC algorithm for random numbers.
-Each thread gets its own copy of an ISAAC structure and initializes it with a different seed.
-Iteration is broken down into chunks of 10,000 called sub batches.
-For each sub batch, the first point is given random x,y coordinates.
-The rest of the points in the sub batch are iterated normally.

This has the effect of resetting the point trajectory every 10,000 iters. My question is:

-Is this statistically the wrong thing to do? As far as I know, flam3 has no issues with proper randomness.
-Does Apo do something different than this?

For the record, Fractorium does exactly what flam3 does in this regard.


Title: Re: Apophysis 7x16
Post by: thargor6 on November 26, 2013, 12:41:58 AM
I also did some investigation of this stuff for JWildfire, and found out in my case that attempts of "doing it right" are not worth the effort, i. E. there was no visible difference in the result in the most cases (I measured this by calculating the image using different methods and compared the results using an algorithm, not just by "looking" :D)

But, the really big deal was the chosen random-number-generator (in means of quality).

I also use one instance of such a random-number-generater per render thread which works very fine.

My currently favourite one is an algorithm described by Marsaglia, but you can choose from different random-number-generators in JWildfire, probably the best is MersenneTwister, but the current implementation is far from perfection.

But in real-world-scenarios (movies, images posted as JPG, ...) you wont see much differences in the most cases.


Title: Re: Apophysis 7x16
Post by: lycium on November 26, 2013, 02:58:55 AM
Apophysis doesn't use separate RNGs per thread I think, and gets blurs especially wrong, even with one thread. I pointed this out to two of the Apo authors some years back in Aposhack on deviantArt, but I don't think it was ever fixed (specifically line 1686: http://apophysis.cvs.sourceforge.net/viewvc/apophysis/2.10/Source/XForm.pas?revision=1.46&view=markup )

Chaotica uses the Mersenne Twister, for its high dimensional equidistribution guarantees.


Title: Re: Apophysis 7x16
Post by: mfeemster on November 26, 2013, 06:27:11 AM
Andreas, good to see you here!

Good info from both of you, thanks. What are your thoughts on ISAAC?