-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash with huge number of array concats. #808
Comments
I think this is because of the deep nesting of the You can work around this by using parentheses to reduce the maximum depth (parenthesising them to be a balanced binary tree). Even just putting parentheses around the first half and the last half of the terms will reduce the depth by half, which should succeed here. I did notice that the error message for me seems to mention a stack depth of 2, which makes it look rather strange, since we're actually not considering the flattening of the arguments as new call stack entries - so maybe that should be changed to at least give a more useful number. |
It looks like parentheses do not work. Dividing into two aux vars works fine. ~900 vars does not look enormously huge to me. Any chances it would be fixed in future versions? Thanks! |
Interestingly for me the parentheses work (i.e. parentheses around the first 512 terms, and then another set of parentheses around the last 512 terms). Unfortunately it's not really possible to fix this generally in the current compiler - I suppose we could add compiler flags when building the compiler on supported platforms to increase the stack size, or maybe we could specially recognise chained It seems odd that you would need to do this though - I would have imagined with a generated model it would probably make more sense to create the one big 2D array with everything in it and then use array slicing to get the smaller ones if you need them (which should also perform better than array concatenation). |
Hi!
I'm doing MiniZinc code generation, and I found that it crashes during compilation if I try to contact more than 866 arrays :-)
That's especially strange because I see this issue only in some of the latest versions; 2.6.2 works well. Please take a look at the attachment.
Thanks a lot in advance!
concats.txt
The text was updated successfully, but these errors were encountered: