strange jit.gen loop behavior

Sep 15, 2012 at 4:53pm

strange jit.gen loop behavior

I have a strange thing happening inside a jit.gen loop:

– Pasted Max Patch, click to expand. –

There is a counter on my macbbok always counting to 50001, although the condition is n

#64382
Sep 17, 2012 at 2:08am

Hi there,

What’s happened here is that you’ve hit the runaway loop trap. There’s a limitation in jit.gen that loops can only repeat up to 50001 times. To work around this currently you could duplicate the loop four times, but this might not always work. I’ve logged a feature request to make this loop limit configurable.

Full explanation: Gen generates machine code under the hood, which requires some extra precaution. For example, an infinite (or extremely large) loop could effectively lock up the system thread it is running in, which could make Max appear to have frozen. To prevent this happening, a loop will always exit after a certain number of iterations, which for jit.gen is currently set to 50001.

Hope that helps,

Graham

#232212
Dec 28, 2013 at 11:04am

Hi Graham,
is there any news regarding the possibility to set an arbitrary loop limit in gen?
Thank you.

#276826

You must be logged in to reply to this topic.