Opened 12 years ago

Closed 10 years ago

Last modified 10 years ago

#4782 closed defect (worksforme)

construction of some relative quadratic extensions is SERIOUSLY FRICKIN's FOO-bar'd

Reported by: was Owned by: was
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: number fields Keywords:
Cc: Merged in:
Authors: Reviewers: Robert Bradshaw
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

Try this carefully with your finger on kill -9:

sage: NumberField(x^2 + 79*x - 60, 'a').extension(x^2 - 69*x + 38,'b')

On sage.math top shows pretty quickly over 6.9GB memory usage!

15392 was       25   0 8219m 6.9g  21m R  100 10.9   0:53.76 sage-ipython                                                    

The discriminants aren't very big:

sage: R.<x> = QQ[]
sage: disc(x^2 + 79*x-60)
6481
sage: disc(x^2 - 69*x + 38)
4609

Same behavior with Proof false:

sage: proof.all(False)
sage: NumberField(x^2 + 79*x - 60, 'a').extension(x^2 - 69*x + 38,'b')
...hell....

Giving both polys at once (which maybe use polcompositum) works:

sage: NumberField([x^2 + 79*x-60, x^2 - 69*x + 38], 'a')

  ***   Warning: insufficient precision for fundamental units, not given.
Number Field in a0 with defining polynomial x^2 + 79*x - 60 over its base field

Basically there is something very wrong with how we make relative fields... probably because of something very very wrong in the core of pari itself (and it's relative number fields).

Change History (16)

comment:1 Changed 12 years ago by ncalexan

Verify this is a PARI bug and submit it. I've been amazed at how fast the PARI group addresses bugs! I haven't seen this particular one, BTW.

comment:2 Changed 12 years ago by was

I just tried this on sage.math with sage-3.3.alpha0:

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+ 
5160 wstein    20   0 61.7g  43g  21m R  102 34.4   2:48.35 sage-ipython

Oh my frickin' god?! That's nuts.

comment:3 Changed 12 years ago by ncalexan

This is a pari bug, fixed in svn already:

mero:pari-svn ncalexan$ ./gp
                                          GP/PARI CALCULATOR Version 2.4.3 (development svn-11539)
                                              i386 running darwin (ix86 kernel) 32-bit version
                                          compiled: Jan 22 2009, gcc-4.0.1 (Apple Inc. build 5484)
                                             (readline not compiled in, extended help enabled)

                                                   Copyright (C) 2000-2008 The PARI Group

PARI/GP is free software, covered by the GNU General Public License, and comes WITHOUT ANY WARRANTY WHATSOEVER.

Type ? for help, \q to quit.
Type ?12 for how to get moral (and possibly technical) support.

parisize = 4000000, primelimit = 500000
? nffactor(nfinit(y^2 + 79*y - 60), x^2 - 69*x + 38)
%1 = 
[x^2 - 69*x + 38 1]

comment:4 Changed 12 years ago by ncalexan

And here is gp svn running on sage.math:

/scratch/nca/pari-svn $ ./gp
            GP/PARI CALCULATOR Version 2.4.3 (development svn-11539)
               amd64 running linux (x86-64 kernel) 64-bit version
            compiled: Jan 22 2009, gcc-4.2.4 (Ubuntu 4.2.4-1ubuntu3)
                 (readline v5.2 enabled, extended help enabled)

                     Copyright (C) 2000-2008 The PARI Group

PARI/GP is free software, covered by the GNU General Public License, and comes
WITHOUT ANY WARRANTY WHATSOEVER.

Type ? for help, \q to quit.
Type ?12 for how to get moral (and possibly technical) support.

parisize = 8000000, primelimit = 500000

? nffactor(nfinit(y^2 + 79*y - 60), x^2 - 69*x + 38)
%1 =
[x^2 - 69*x + 38 1]

comment:5 Changed 12 years ago by ncalexan

After discussion at SD12, mabs, craigcitro, and ncalexan are going to try to update pari to unstable/trunk.

comment:6 Changed 12 years ago by was

  • Resolution set to fixed
  • Status changed from new to closed

I just checked and the stated problem (for this ticket) is gone in 3.3.rc2 some I'm closing this. (I tested on both sage.math and OS X)

sage: NumberField(x^2 + 79*x - 60, 'a').extension(x^2 - 69*x + 38,'b')
Number Field in b with defining polynomial x^2 - 69*x + 38 over its base field

comment:7 Changed 12 years ago by ncalexan

The problem is not gone, it's just hidden by #5231. Creation is lazy now: it doesn't actually call pari, which will still fail. This will be fixed when we upgrade to pari-svn. I suggest this ticket be re-opened.

comment:8 Changed 12 years ago by was

Nick -- post an example that illustrates things not working. Because I can't find one.

sage: K = NumberField(x^2 + 79*x - 60, 'a').extension(x^2 - 69*x + 38,'b')
sage: K._pari[try every possible function even class groups]
<works fine>

comment:9 Changed 12 years ago by mabshoff

  • Resolution fixed deleted
  • Status changed from closed to reopened

I just ran into Sage eating *122 GB* in the random ring test:

sage -t -long devel/sage/sage/rings/tests.py

Specifically

18203 mabshoff  25  5  122g 2.0g  23m R  100  1.6  4:00.82 /scratch/mabshoff/sage-3.3.rc3/local/bin/python /

So this is a problem, hence I will reopen it :)

Cheers,

Michael

comment:10 Changed 12 years ago by mabshoff

Ok, I also just hit this, which might be completely unrelated:

sage -t -long "devel/sage/sage/rings/tests.py"              
**********************************************************************
File "/scratch/mabshoff/sage-3.3.rc3/devel/sage/sage/rings/tests.py", line 251:
    sage: sage.rings.tests.test_random_arith(trials=1000)   # long time (5 seconds?)
Exception raised:
    Traceback (most recent call last):
      File "/scratch/mabshoff/sage-3.3.rc3/local/bin/ncadoctest.py", line 1231, in run_one_test
        self.run_one_example(test, example, filename, compileflags)
      File "/scratch/mabshoff/sage-3.3.rc3/local/bin/sagedoctest.py", line 38, in run_one_example
        OrigDocTestRunner.run_one_example(self, test, example, filename, compileflags)
      File "/scratch/mabshoff/sage-3.3.rc3/local/bin/ncadoctest.py", line 1172, in run_one_example
        compileflags, 1) in test.globs
      File "<doctest __main__.example_12[3]>", line 1, in <module>
        sage.rings.tests.test_random_arith(trials=Integer(1000))   # long time (5 seconds?)###line 251:
    sage: sage.rings.tests.test_random_arith(trials=1000)   # long time (5 seconds?)
      File "/scratch/mabshoff/sage-3.3.rc3/local/lib/python2.5/site-packages/sage/rings/tests.py", line 255, in test_random_arith
        for x in random_rings(level):
      File "/scratch/mabshoff/sage-3.3.rc3/local/lib/python2.5/site-packages/sage/rings/tests.py", line 209, in random_rings
        yield random.choice(v)[0]()
      File "/scratch/mabshoff/sage-3.3.rc3/local/lib/python2.5/site-packages/sage/rings/tests.py", line 131, in relative_number_field
        K = K.extension(f,var)
      File "/scratch/mabshoff/sage-3.3.rc3/local/lib/python2.5/site-packages/sage/rings/number_field/number_field.py", line 2616, in extension
        return NumberField_relative(self, poly, str(name), check=check, embedding=embedding)
      File "/scratch/mabshoff/sage-3.3.rc3/local/lib/python2.5/site-packages/sage/rings/number_field/number_field_rel.py", line 276, in __init__
        raise ValueError, "defining polynomial (%s) must be irreducible"%polynomial
    ValueError: defining polynomial (x^2 + 3*x - 20) must be irreducible
**********************************************************************

But the ring random test seems to flush out issues :)

Cheers,

Michael

comment:11 Changed 12 years ago by mabshoff

Remember to turn on relative number field in the ring tester once this spkg has made it - see #4779.

Cheers,

Michael

comment:12 Changed 12 years ago by davidloeffler

  • Component changed from number theory to number fields

comment:13 Changed 11 years ago by jdemeyer

  • Milestone changed from sage-4.6 to sage-duplicate/invalid/wontfix
  • Report Upstream set to N/A
  • Status changed from new to needs_review

Can we close this ticket in the light of #9343?

comment:14 Changed 10 years ago by lftabera

I cannot reproduce the problem with sage 4.6 on debian linux 32 bits. I just get the relative field and looks ok.

Does anyone still experience issues?

comment:15 Changed 10 years ago by robertwb

  • Resolution set to worksforme
  • Status changed from needs_review to closed

comment:16 Changed 10 years ago by jdemeyer

  • Reviewers set to Robert Bradshaw
Note: See TracTickets for help on using tickets.