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 applying divided_difference in SchubertPolynomialRing #23403
Comments
comment:1
Okay, I've traced the problem down to the fact that there might be no monomials in the Schubert polynomial. Yet it is still a pointer to a non- |
This comment has been minimized.
This comment has been minimized.
Changed keywords from none to Schubert, symmetrica |
comment:2
So the 0 Schubert polynomial is initialized to an empty list, which behaves differently from, e.g., Schur functions. Because of this, the code tries to get the next pointer starting from a null pointer, resulting in a crash within Symmetrica in a way that is not done within a New commits:
|
This comment has been minimized.
This comment has been minimized.
Commit: |
Author: Travis Scrimshaw |
comment:3
typos:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:5
I still don't understand which divided difference operator is meant, and what i is. Is it the delta^i in DIFF.2.4 of http://www.math.ku.dk/~thorup/notes/sympol.pdf ? |
comment:6
Here is what the code gives:
You can tell that |
comment:7
For the definition of the difference operator, see section 2 of http://www.math.cornell.edu/~allenk/schubnotes.pdf |
comment:8
Thanks Frédéric. I'm pushing an improved doc. However, I think the new behavior, raising errors when there are not enough variables, is wrong. The Schubert polynomial ring is in infinitely many variables by definition; a polynomial isn't "missing" a variable; it just happens to be degree-0 with respect to it.
This should yield 0, not an exception! |
comment:10
Replying to @darijgr:
That's not new behavior. The only change in behavior is for 0, which is a special case IMO. There is some reason to consider this an error by considering this as the restriction to a finite number of variables. So there is some room for debate, and as such, it should go on another ticket (there's enough "ticket creep" already). I do not disagree with you that it is more natural for it to be 0, but you also need the same behavior to happen for permutation input. If you're not careful with that input and let symmetrica try to handle it, it can result in crashes or other strange behavior (I can find the ticket that talks about it if you want). So I don't see this as being a simple change either and is another reason to put it on a separate ticket. |
comment:11
Oh, I just realized that you didn't add the "if i > max_a" check. I'll open a new ticket for this. |
comment:12
Why are you using |
comment:13
Created #23423 for the ValueError issue. |
comment:14
Replying to @darijgr:
Yes, and I am taking advantage of that because |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:17
It definitely makes things no worse than before. There is not really any coercion but instead is just trying to make a corresponding element in Sage; it is referencing an external library (symmetrica) that does not implement a notion of parents. So I think the result could be a little loose with the parent it returns. Again, another ticket. |
comment:18
Oh, but zeros should be removed by symmetrica IIRC. |
comment:19
OK, I'm just seeing that the method plainly doesn't work over non-ZZ/QQ base rings. At least it's being honest about it:
This is probably a BS restriction, and we should be using Symmetrica on monomials rather than on the whole polynomial. I'm getting more and more confused the longer I stare at the Schubert code. What exactly does the following method (in libs/symmetrica/sb.pxi) do?
I'm pretty sure there is at least one typo in the docstring. |
comment:20
I do not know if lrcalc can do these computations or not (I simply haven't looked), but there is a goal of replacing symmetrica by lrcalc IIRC. However, that is again for later. At least for now, can not have Sage crash when trying to do a computation rather than trying to completely clean this code? I am willing to split this ticket just to focus on the big problem at hand: the crash. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:22
I have rewritten In the current commit, for the sake of reviewing, both the new and the old method can be used (the default is the new one; get the old one by setting the optional |
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits: |
comment:24
This is a great improvement and is faster on all of the examples I tested (including some relatively large permutations). However, it must go on another ticket as this ticket is about fixing the crash in symmetrica, which is independent of the divided difference functionality. I guess it is somewhat my fault for starting this. Yet, I will revert all of the other little changes if that is what it takes for us to focus on the problem of this ticket. I will review the followup tickets in exchange. I reverted this branch to
|
comment:25
Is the crash actually independent from the divided difference functionality? I thought only the |
comment:26
Yes, the crash occurs because symmetrica returns an empty-list object to represent |
Replying to @tscrim:
Is that the exact (verbatim) output that you get? On which system is that? I get
|
comment:28
Symmetrica code: OP s_mo_k(a) OP a;
/* AK 100789 V1.0 */ /* AK 191289 V1.1 */ /* AK 200891 V1.3 */
{
OBJECTSELF c;
if (a == NULL)
return error("s_mo_k:a == NULL"),(OP)NULL;
if (S_O_K(a) != MONOM)
return error("s_mo_k:a != MONOM"),(OP)NULL;
c = s_o_s(a);
return(c.ob_monom->mo_koeff);
} Yup, totally clear what it does :-) |
comment:29
Let me guess, 100789 means 10th July 1989? That said, the English-German hodgepodge has probably not been up to standards even by the 80s standards... |
comment:30
Replying to @jdemeyer:
Yes (other than the number that changes every time).
Ubuntu 16.04 LTS (with 8.1.beta0) The segfault is definitely the "correct" failure, but for some reason it seems Python is attempting to handle the error. shrugs |
comment:32
Darij looked at this patch with me and gave a positive review. |
Reviewer: Darij Grinberg |
Changed branch from public/combinat/symmetrica_crash-23403 to |
Changed commit from |
The error number is random every time. The result should be 0.
CC: @sagetrac-sage-combinat @nthiery @VivianePons @fchapoton @darijgr
Component: combinatorics
Keywords: Schubert, symmetrica
Author: Travis Scrimshaw
Branch:
c3bfaaf
Reviewer: Darij Grinberg
Issue created by migration from https://trac.sagemath.org/ticket/23403
The text was updated successfully, but these errors were encountered: