POV-Ray : Newsgroups : povray.beta-test : Functions more than 65535 Server Time
29 Jul 2024 12:30:08 EDT (-0400)
  Functions more than 65535 (Message 1 to 10 of 34)  
Goto Latest 10 Messages Next 10 Messages >>>
From: R  Suzuki
Subject: Functions more than 65535
Date: 12 May 2002 11:00:09
Message: <3cde8379@news.povray.org>
I think the limit of functions per scene in POV3.5 is 65535.

I've tried to test the behavior when the number of functions is
more than 65535.  The below is the test code.
I expected an error message something like ""Maximum number of 
functions per scene reached." but the current RC crashes.

Win2000, 256M,  both Intel and VC++ compile

R. Suzuki

------------------------------------------------------
#version 3.5;
#include "functions.inc" 

#declare F1=65600;

camera { location  <0, 0, -6.5>  direction z }
light_source { <-0,10,-40>  color rgb 2}

#macro SPHERE11(P1,P2)
  sphere {0,1  
     texture{ pigment{ 
       function{(cos(f_th(x,0,z)*P1+f_r(x,0,z)*4)*f_r(x,0,z)+1.5)/2.5
                *f_r(x,0,z)}
       color_map{[0 rgb <0.5,0.25,0.1>] 
                 [.25 rgb <0.85,0.7,0.5>][.5 rgb 1][1 rgb 1]}}
       finish{ambient 0.35}
     }
     scale <1,0.12,1> *0.5
  }
#end

#declare R1 = seed(1);

#declare N1=0;

#while (N1<F1) 
   #declare P1=rand(R1);
   object{
     SPHERE11(5+int(rand(R1)*10), rand(R1)) 
     translate <rand(R1)*100-50, rand(R1)*100-50,rand(R1)*20> 
   }          
   #declare N1=N1+1;
   #if (mod(N1, 5000)=0)
     #debug  concat("N1:",str(N1,3,0),"\n")
   #end
#end


Post a reply to this message

From: Christoph Hormann
Subject: Re: Functions more than 65535
Date: 12 May 2002 11:40:09
Message: <3CDE8CD9.AC34C5E1@gmx.de>
"R. Suzuki" wrote:
> 
> I think the limit of functions per scene in POV3.5 is 65535.
> 
> I've tried to test the behavior when the number of functions is
> more than 65535.  The below is the test code.
> I expected an error message something like ""Maximum number of
> functions per scene reached." but the current RC crashes.
> 
> Win2000, 256M,  both Intel and VC++ compile

Confirmed for Linux RC4 (segmentation fault)

BTW, in the list of limits in docs section 6.1.6.2 am missing something
about the limit of nesting functions, i quite frequently get the error:
'Maximum function evaluation recursion level reached.'

Christoph

-- 
POV-Ray tutorials, IsoWood include,                 
TransSkin and more: http://www.tu-bs.de/~y0013390/  
Last updated 05 May. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Functions more than 65535
Date: 12 May 2002 13:06:13
Message: <3cdea105@news.povray.org>
In article <3CDE8CD9.AC34C5E1@gmx.de> , Christoph Hormann 
<chr### [at] gmxde>  wrote:

> BTW, in the list of limits in docs section 6.1.6.2 am missing something
> about the limit of nesting functions, i quite frequently get the error:
> 'Maximum function evaluation recursion level reached.'

It is 128.

What the hell are you doing with such complex function? ;-)

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Warp
Subject: Re: Functions more than 65535
Date: 12 May 2002 13:13:32
Message: <3cdea2bc@news.povray.org>
Thorsten Froehlich <tho### [at] trfde> wrote:
> It is 128.

> What the hell are you doing with such complex function? ;-)

  65535 functions and 128 recursion levels should be enough for anyone.
As well as 640 kilobytes of memory. ;)

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Functions more than 65535
Date: 12 May 2002 14:50:25
Message: <3cdeb971@news.povray.org>
In article <3cdea2bc@news.povray.org> , Warp <war### [at] tagpovrayorg>  wrote:

>> What the hell are you doing with such complex function? ;-)
>
>   65535 functions and 128 recursion levels should be enough for anyone.

Long, long ago the limit was a sufficient 256 operations per function... :-)

> As well as 640 kilobytes of memory. ;)

No, the VM won't be too happy with such a small amount of memory - with 2^16
functions and 2^16 instructions per function and the instructions usually
taking 4 bytes each you end up with 16 GB...

But who needs 64 bit address space? ;-)


    Thorsten


____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Christoph Hormann
Subject: Re: Functions more than 65535
Date: 12 May 2002 14:54:19
Message: <3CDEBA5B.A6AA7104@gmx.de>
Thorsten Froehlich wrote:
> 
> > BTW, in the list of limits in docs section 6.1.6.2 am missing something
> > about the limit of nesting functions, i quite frequently get the error:
> > 'Maximum function evaluation recursion level reached.'
> 
> It is 128.


User-Defined Float Functions':

Limits: 

- The maximum recursion depth for nesting functions is 128. 

> 
> What the hell are you doing with such complex function? ;-)
> 

Oh come on, povers are commonly not known for their temperance...  

Constructions like the following are very useful, but regularly exceed
this limit.

#while (...)  

  ...
  
  #local fn_new1 = function { fn_1(x, y, z) + fn_foo(x, y, z)
}              
  #undef fn_1                    
  #local fn_1 = function { fn_new1(x, y, z) } 
  #undef fn_new1 

  ...

#end


Christoph

-- 
POV-Ray tutorials, IsoWood include,                 
TransSkin and more: http://www.tu-bs.de/~y0013390/  
Last updated 05 May. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: ingo
Subject: Re: Functions more than 65535
Date: 12 May 2002 15:04:41
Message: <Xns920CD6E78133Aseed7@povray.org>
in news:3CDEBA5B.A6AA7104@gmx.de Christoph Hormann wrote:

> Ingo: I would suggest something like the following in

> 
> Limits: 
> 
> - The maximum recursion depth for nesting functions is 128. 
> 

Unless it changes the meaning completely, I think I'll leave out the word 
"recursion", to prevent the idea that recursive functions are possible.

Ingo


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Functions more than 65535
Date: 12 May 2002 15:06:01
Message: <3cdebd19@news.povray.org>
In article <3CDEBA5B.A6AA7104@gmx.de> , Christoph Hormann 
<chr### [at] gmxde>  wrote:


> User-Defined Float Functions':
>
> Limits:
>
> - The maximum recursion depth for nesting functions is 128.

In the docs this should be 1024 sand not 128.  Guess why! ;-)

BTW, the parameter limit is 56 and not 40 anymore.  This changed some time
ago. So the entry should be "The maximum number of allowed parameters per
function is 56"

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Functions more than 65535
Date: 12 May 2002 16:50:58
Message: <3cded5b2$1@news.povray.org>
In article <3CDEBA5B.A6AA7104@gmx.de> , Christoph Hormann 
<chr### [at] gmxde>  wrote:

> Constructions like the following are very useful, but regularly exceed
> this limit.
>
> #while (...)
>
>   ...
>
>   #local fn_new1 = function { fn_1(x, y, z) + fn_foo(x, y, z)
> }
>   #undef fn_1
>   #local fn_1 = function { fn_new1(x, y, z) }
>   #undef fn_new1
>
>   ...
>
> #end

So essentially what you want is a "sum" function?

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Christoph Hormann
Subject: Re: Functions more than 65535
Date: 12 May 2002 17:10:05
Message: <3CDEDA2C.8504C17C@gmx.de>
Thorsten Froehlich wrote:
> 
> [...]
> 
> So essentially what you want is a "sum" function?
> 

I'm not sure what you mean by 'sum' function, but of course this example
was very simple, usually there are a lot of '#if's etc. too.

Christoph

-- 
POV-Ray tutorials, IsoWood include,                 
TransSkin and more: http://www.tu-bs.de/~y0013390/  
Last updated 05 May. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.