-
-
Notifications
You must be signed in to change notification settings - Fork 520
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
Unstable plotting #29954
Comments
This comment has been minimized.
This comment has been minimized.
Replying to @kliem:
I think I have seen such sporadic plotting errors in the wild. |
comment:3
It's not like I tried many random seeds. For the first one, your chance is about 99 percent to get it right. The more complicated your object, the lower the chance obviously. For the last object, it appears to be about 64 percent. Of course, it is much harder to see the mistake there. |
comment:4
One more
|
comment:5
And more
|
comment:6
|
It's not like you wouldn't see it. |
comment:7
Attachment: tmp_768r4405.png I'm moving this up to critical, because there is a total of 1354 doctests while they are pretty unstable. |
Branch: public/29954 |
comment:10
I think this will be easy to fix. In fact, this PR may solve the problem, but I think we should do something more intelligent. The problem is a bug in the adaptive graphing code. It assumes that if two consecutive plot points This PR just changes "twice as far apart" to "five times as far apart". It seems to fix all of the examples listed above. But it should be easy to write a more intelligent patch that only puts gaps in regions where there is a problem evaluating the function. New commits:
|
Commit: |
comment:11
The ticket that introduced this part of the code is #13246 (merged in 6.3). The discussion on that ticket mentions the need for speed, so, although I think we do want to be more intelligent, perhaps we will decide to also offer a simple patch like this one (just changing "twice" to some other number) as an option (or maybe even as the default). |
comment:12
Thanks for figuring out the problem. The whole fix in #13246 seems strange to me and needs serious reworking:
This is awful and I don't like the approach done in #13246 for the following reasons:
However, none of this already collected information is returned by As you mentioned above, in our case It think this will also fix the errornous connection made above. |
Changed commit from |
Changed branch from public/29954 to -remove-failures-of-adaptive-recursionpublic/29954- |
comment:13
Actually, But, I don't think its okay to just connect things were
This thing isn't continuous and the only way to fix it, is to manually enter the points to exclude. However, the current code does a pretty good job in detecting those places, we just currently ignore everything that was obtained. |
New commits:
|
Commit: |
comment:16
But we could also just fix this bug here by changing from 2 times to 5 times as you suggested and move the other stuff to a seperate ticket, because in a way, it is a seperate issue. |
comment:17
I did not look at the details yet, but I fully agree that the approach in this PR is the correct direction: we should keep track of the unplottable points, and use those to determine the gaps in the graph. It is much better than changing 2 times to 5 times, which does not actually solve the problem (just makes it less common). When you set this ticket to "needs review", I will look at it more carefully. Let's get this PR merged, and open a separate ticket for additional improvements to the adaptive refinement. (I consider the issue in comment:12 to be a separate issue, unless this PR already fixes the problem as a side-effect.) |
This comment has been minimized.
This comment has been minimized.
Changed branch from public/29954-remove-failures-of-adaptive-recursion to public/29954-only-fix-bug |
Author: Jonathan Kliem |
comment:19
I think I seperated the bug fix from the behavior change. |
comment:20
Thanks, this is excellent! I do have a few minor suggestions, though: Would it be better to make These two lines (the definitions of In the docstring of The term "point" usually refers to an ordered pair For the same reason, in the INPUT section of the docstring for The term "value" usually refers to a value of the function, or, in other words, a y-value, so I find it confusing when this word is used for a value of x. Therefore, in the OUTPUT section of the docstring for The file sometimes has two blank lines after "INPUT:" or "OUTPUT:", and sometimes only one. Please standardize this, even though this was not your fault. (I think there is only supposed to be one.) (Let me know if you would like me to make these changes to the file for you.) |
Reviewer: Dave Morris |
comment:21
I opened ticket #31169 for additional improvements to (adaptive) plotting. |
comment:25
Thanks again! I made a few minor edits to some docstrings. If you agree with these changes, you can set to positive review on my behalf. |
comment:26
Sure. Thank you. |
Changed branch from public/29954-only-fix-bug to |
#29935 discovered unstable plotting with doctests. This causes the following failures:
In all of those instances, primitives where split into two (with a hole).
To reproduce
This is caused by #13246, which adds exclusion points in the plot, whenever two x-values are far apart. However, it seems more natural to actually keep track of those points where the computation failed.
Component: graphics
Keywords: plotting
Author: Jonathan Kliem
Branch/Commit:
d6e51f3
Reviewer: Dave Morris
Issue created by migration from https://trac.sagemath.org/ticket/29954
The text was updated successfully, but these errors were encountered: