-
-
Notifications
You must be signed in to change notification settings - Fork 419
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
Calling mwrank(-10) hangs Sage, but uses very little CPU time #10108
Comments
Changed keywords from none to mwrank |
comment:1
I have a patch for this which I will post soon. |
comment:2
Replying to @JohnCremona:
Delays caused by break in internet access -- hope to post patch Sunday. |
applies to 4.6.alpha3 |
comment:3
Attachment: trac_10108-mwrank.patch.gz This was harder than expected. Without either (1) rewriting mwrank's in put parser or (2) writing a full parser within Sage and only sending to mwrank when certainly correct, which I do not want to do. If you feed mwrank correct but incomplete input (such as <5 integers separated by whitespace) it quietly waits for the rest of the input (with no prompts). To get around this I pad the strings sent to mwrank with ' 0 0 0 0 0 ' which means that this never happens, and then to get repeated calls to mwrank to work properly need a bit of fiddling. I tested the patch on two machines (4.6.alpha3). |
Author: John Cremona |
comment:4
Replying to @JohnCremona:
If this hard, then perhaps it's more effort to fix properly than it is worth. You are a better judge of that than me. I can't help feeling if this is supposed to take 5 integers then it should take 5, and not accept fewer or more, as it does. For example:
(It would also be nice if those Again, I don't feel able to review the Python. |
comment:5
Attachment: trac_10108-mwrank.2.patch.gz Looks good to me. I added a patch which fixes the indentation of the options blocks. |
Reviewer: Mike Hansen |
comment:6
Please fix the ticket number (10108, NOT 10105) in the patch |
Attachment: trac_10105-mwrank.patch.gz renamed version of previous -- applies to 4.6.rc0 |
comment:7
Attachment: trac_10108-mwrank.3.patch.gz Apply only trac_10108-mwrank.3.patch (and sorry for the mess -- previous ones can be deleted). |
Ticket number fixed, apply only this patch |
comment:8
Attachment: trac_10108-mwrank.4.patch.gz John, I seem to have confused you :-) |
comment:9
Replying to @jdemeyer:
Very sorry - -first I thought it was the patch's name, then the comment in the doctest... but at least the bugfix works! |
comment:10
This patch gives trouble for me when merging it as part of a potential sage-4.6.1.alpha0. For some reason I cannot explain, I get the following error when running
What is strange is that simply doing
in a "real" Sage session works. So it works in Sage, but not in a doctest. I will need to investigate further. |
comment:15
I have two tests that do not pass. (I have rebased the branch to 6.1.rc0; so maybe mwrank changed in the meantime.) I looks like
|
Changed reviewer from Mike Hansen to Mike Hansen, Chris Wuthrich |
Changed branch from u/cremona/ticket/10108 to u/wuthrich/ticket/10108 |
comment:17
Thanks. Since you did a rebase I can't see what you changed additionally, but I seem to have slipped up in testing (in one example) that the long-winded mwrank output is good where because of the time output one cannot just do a literal comparison. |
comment:18
OK, works for me (though I think my earlier branch did too!). I have set this back to "needs review" and Chris you can set it to positive review. |
comment:19
Ah interesting. I did not change anything. I litterally took your mwrank.py and copied it into a branch based at develop, checking that this file was not touch on since then. So I get the above errors and you do not get them. So it seems that mwrank does not give back the same string for you than for me. The issue (in both failures) is the final sentence. I get "The rank and full Mordell-Weil basis have been determined unconditionally." while we test for "The rank has been determined unconditionally." Is there a change in mwrank that I have missed? (I revert back to needs_work). |
comment:20
That is weird; I misunderstood. No changes at all in mwrank. But when I switch branches there is more recompilation than I would have expected (mpir rebuilds) for this. Very odd! I'll look into it further. |
comment:21
From my develop to this branch u/wuthrich/..., it only compiles mwrank.py (as I would expect). |
comment:22
I think there was some conflict between the state of the original branch of mine called ticket/10108 and the branch I had after checking out yours. So I switched back to develop, deleted the branch ticket/10108 altogether and re-pulled it. Now my git log has the right look to it:
so I rebuild (i.e. "make"). And sage/interfaces/mwrank.py passes its tests. And specifically when in Sage I run
the output string is
Now I see what is happening! The curve has rank 0; so mwrank does not do the usual saturation step of making sure that we have the full MW group and not a subgroup of finite index; there is a flag (in my C++ code) called sat_ok which is set to 1 if saturation suceeds, 0 if it fails -- and is uninitialized otherwise! So it will be random for a rank 0 curve where one sees the additional string "The rank and full Mordell-Weil basis have been determined" or "The rank and full Mordell-Weil basis have been determined". Obviously I will correct this in eclib, which is timely since I was planning tp update Sage's version sson anyway. Meanwhile we'll have to sidestep this by changing that doctest sneakily. I suggest first deleting the variable sentence, effectively moving the "..." forward; and in the next line just test for "Rank = 0" in s. Shall I do that or will you? |
comment:23
I can do it. Do you want to keep the lengthy output to be tested ? Or would not |
comment:24
Replying to @categorie:
Thanks.
That would be enough, certainly as we also check that "Rank = 0" is in there. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:26
I run the tests now. |
comment:27
Replying to @JohnCremona:
The eclib patch is visible here: and the new version (with a lot more than just this change) is in a new spkg at #15738. But this ticket does not need that. |
comment:31
See #15798 for a followup ticket |
Following some very quick hacks at using "fuzz testing" techniques, I found that
just hangs, but does not appear to be using any CPU time. Although I don't know what this is supposed to do, from discussions on sage-devel, I understand my suspicions this behavior is an error were correct.
Can someone please select the component appropriately, as I don't have a clue myself.
CC: @JohnCremona
Component: elliptic curves
Keywords: mwrank
Author: John Cremona
Branch/Commit: u/wuthrich/ticket/10108 @
0fb4c7d
Reviewer: Mike Hansen, Chris Wuthrich
Issue created by migration from https://trac.sagemath.org/ticket/10108
The text was updated successfully, but these errors were encountered: