#13413: fix integer overflow (?) in conversion of powersums to Schur functions
---------------------------------------+------------------------------------
       Reporter:  saliola              |         Owner:  sage-combinat
           Type:  defect               |        Status:  new          
       Priority:  major                |     Milestone:  sage-5.4     
      Component:  combinatorics        |    Resolution:               
       Keywords:  symmetric functions  |   Work issues:               
Report Upstream:  N/A                  |     Reviewers:               
        Authors:                       |     Merged in:               
   Dependencies:                       |      Stopgaps:               
---------------------------------------+------------------------------------
Changes (by mguaypaq):

 * cc: mguaypaq (added)


Comment:

 Running the attached file {{{symmetrica-test.py}}} exhibits the problem on
 some machines (e.g., a Mac of some sort, I don't have the specs with me)
 but on my own laptop (ancient Dell laptop running Ubuntu 10.04 LTS) the
 test runs out of memory before finding a problem. Curiously enough, for
 the Mac I tried the problem appears at size 47, same as in the problem
 description.

 I think this shows that the problem is in (or extremely close to)
 Symmetrica, not Sage itself.

 Also, given that the coefficients change even without any intervening
 computations, I strongly suspect that we're seeing a memory leak in
 Symmetrica, not an integer overflow error. Most likely,
 1. Symmetrica computes some result,
 1. caches a pointer to the result,
 1. frees the memory containing the result,
 1. this memory eventually gets reused,
 1. so the cached result now points to garbage.

 It's interesting to note that the error only seems to happen when dealing
 with coefficients in {{{QQ}}}, not in {{{ZZ}}}, as Anne's testing shows.
 However, given the state of the Symmetrica source code, I'm not optimistic
 about actually finding (and fixing) the bug.

 Do we know if there are other changes of basis which exhibit similar
 problems?

 For convenience, note that the content of {{{symmetrica-test.py}}} is
 simply:

 {{{
 from sage.all import QQ, ZZ, Partition
 from sage.libs.symmetrica.all import t_POWSYM_SCHUR as convert
 from time import time

 one = QQ(1)
 bad_input = {Partition([ZZ(2)] * 2): one}

 good_output = convert(bad_input)

 start_time = time()
 k = 1
 while True:
     dummy = convert({Partition([ZZ(1)] * k): one})
     if convert(bad_input) != good_output: break
     print 'Size %d seems fine after %d seconds.' % (k, time() -
 start_time)
     k += 1

 print 'Found a problem at size %d:' % k
 for k in range(10):
     print convert(bad_input)
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13413#comment:3>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to