-
-
Notifications
You must be signed in to change notification settings - Fork 85
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
sig abort after kiwi::InternalSolverError #15
Comments
Well, the crash is expected since the exception is unhandled. However, that exception should never actually be thrown. They are only thrown when the code hits a condition which should never occur. So, this is almost certainly a bug in Kiwi. Can you whittle down your code into a short reproducible example? That will be much easier for me to debug. |
okay i'll try to do that, but it may be hard, I use kiwi in a quite complex environnement. I'll keep you in touch, thanks for your answer. |
Hello, with regards to this bug, even if the exception is handled from user code, it will not work if the file that includes kiwi.h is compiled in C++11 mode. This is because an exception is thrown from
|
Closing this, since there's not much I can do without a reproducible example. Feel free to re-open it if you come up with one. |
I was getting this error too. It was also for a complicated system - one that worked for modest numbers of constraints, but then would crash when more contraints were added. My uneducated guess as to what is happening is that an "UnresolvableConstraint" error should be thrown, but the system is too complicated for that logic to catch, so the solver crashes. I (think) I can provide code that does this if it helps, but its not a trivial example. (I did attempt to craft a MNWE, but kiwi kept catching the error before However, I found the "fix" was to be more careful about setting constraint weights. I changed most of my constraints to 'strong' instead of the default 'required' (but left a few important ones as 'required', and so far I'm not getting crashes and I'm getting the right results for the solver. |
Reopening since we have another user affected by this. @jklymak Thanks for chiming in. I'll definitely take a look at a reproducible example, even if it's complicated. |
OK, great. You can have a look at https://github.com/jklymak/kiwierror I narrowed down the error to one line, so that helps, I hope. See the Note you need For some context, I'm trying to use Thanks a lot! |
Looking at the dump of the solver before adding the last constraint,
|
Based on my (limited) understanding of the algorithm, it seems to me that if an all dummy row enters the infeasible rows it should be discarded in the dualOptimize step since this constraint is redundant and entered the infeasible rows list only because the near zero constant happens to be negative. What seems to me like a proper fix would be to add an @sccolbert I would really appreciate your feedback here. |
Actually we should also check the constant for near zero. And if we only got dummies but non-zero constant I do not know what we should do ! |
This should be fixed in 1.1.0 |
This error can still be thrown with v1.2.0 when using MPL constrained layouts it seems. |
Ew, sorry about that. FWIW, Matplotlib is probably going to rewrite constrained_layout, and hopefully this won't be possible any longer. |
@jklymak do you know more about matplotlib plans. I have wanted to have a look at the implementation for a long time bit never got around to actually doing it. |
Sure, its this PR: matplotlib/matplotlib#17494 The main change is that there are far fewer constraints (they are by columns and rows of gridspec rather than for each axes in the gridspec) and that what is constrained is the margins around axes, so that the axes always fill the figure. Before we had the problem that zero was an acceptable solution of the constraints (i.e. a=b=2c has a trivial solution) and we had no outer constraint to fix that. It worked, but it was fragile. |
Out of curiosity are you planning to have any in-figure constraints (for example to place the colorbar next to a plot) separate from the rest (basically having a bit more hierarchy than the old code) ? I will try to have a look at the PR. |
@MatthieuDartiailh Not quite sure what you mean. If it weren't for colorbars, constrained_layout would be pretty easy 😉 - so most of the work was getting colorbars to work well. Is there a case that doesn't work? Its still feature matched to what's described in https://matplotlib.org/tutorials/intermediate/constrainedlayout_guide.html though colorbar placement has changed in the new code. |
Sorry about the noise, I am so used to attaching a colorbar to one graph and thinking of that as one unit in the grid that I forgot about other usecases. I really to check more the documents your wrote. |
Hello,
I am using kiwi on a project to move temporal element with flexible time intervals between them code here (https://github.com/OSSIA/i-score/tree/dev).
When manipulating, I often get a crash right after kiwi throw an InternalSolverError.
I am confused, do you think is is comming from my side?
regards,
Simon.
ps: sorry if bad english
The text was updated successfully, but these errors were encountered: