1. 06 Mar, 2019 1 commit
  2. 02 Mar, 2019 8 commits
    • Volker Braun's avatar
      Updated SageMath version to 8.7.beta6 · c59b6881
      Volker Braun authored
      c59b6881
    • Release Manager's avatar
      Trac #27379: Speed up coercions · 1410d220
      Release Manager authored
      - Don't call `_repr_()` on the parents every time a coercion or
      conversion fails. (One could consider making `Parent.__repr__()` keep
      the name in cache instead, but we probably don't want that for things
      like finite fields, and in any case `__repr__()` is handled by
      `SageObject` at the moment.)
      - Add a fast path for trivial coercions in `Parent.coerce(foo)`.
      
      Before:
      {{{
      sage: R.<x,y,z> = ZZ[]
      sage: a = GF(3)(2)
      sage: %timeit x(a,a,a)
      The slowest run took 37.44 times longer than the fastest. This could
      mean that an intermediate result is being cached.
      100000 loops, best of 3: 13.1 µs per loop
      }}}
      After:
      {{{
      sage: R.<x,y,z> = ZZ[]
      sage: a = GF(3)(2)
      sage: %timeit x(a,a,a)
      The slowest run took 162.14 times longer than the fastest. This could
      mean that an intermediate result is being cached.
      100000 loops, best of 3: 3.98 µs per loop
      }}}
      
      URL: https://trac.sagemath.org/27379
      Reported by: mmezzarobba
      Ticket author(s): Marc Mezzarobba
      Reviewer(s): Travis Scrimshaw
      1410d220
    • Release Manager's avatar
      Trac #27001: py3: fix pip_installed_packages · 93923a82
      Release Manager authored
      by using pip3 when appropriate
      
      URL: https://trac.sagemath.org/27001
      Reported by: chapoton
      Ticket author(s): Frédéric Chapoton
      Reviewer(s): Erik Bray
      93923a82
    • Release Manager's avatar
      Trac #27381: Use of -valgrind/--valgrind in doctesting is broken · 6f4efa96
      Release Manager authored
      As reported [https://groups.google.com/forum/#!topic/sage-
      devel/DokUHxVQ6aA here]
      {{{
      ./sage -t --long --valgrind "doctest"
      }}}
      appears to be broken. For example
      {{{
      ./sage -t --long --valgrind src/sage/combinat/tableau.py
      }}}
      retuns one to the shell prompt and in `~/.sage/valgrind/sage-
      memcheck.8525` there is
      {{{
      ==8525== Memcheck, a memory error detector
      ==8525== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
      ==8525== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright
      info
      ==8525== Command: python /64bitdev/storage/sage-
      git_develop/sage/local/bin/sage-runtests --serial --long
      --timeout=172800 --memlimit=3300
      --stats_path=/home/volj/27/strogdon/.sage/timings2.json
      --optional=dochtml,memlimit,mpir,python2,sage
      src/sage/combinat/tableau.py
      ==8525== Parent PID: 8495
      ==8525==
      ==8525== FATAL: can't open suppressions file "/64bitdev/storage/sage-
      git_develop/sage/local/lib/valgrind/sage.supp"
      }}}
      So the `suppressions` files cannot be located.
      
      URL: https://trac.sagemath.org/27381
      Reported by: strogdon
      Ticket author(s): Steven Trogdon
      Reviewer(s): François Bissey
      6f4efa96
    • Release Manager's avatar
      Trac #27378: Py3: Fix graphic_matroids.py for python3 · 579dcfca
      Release Manager authored
      Fix graphic_matroids.py for python3.
      For graphs use edge_iterator() and vertex_iterator() instead of edges()
      and vertices() to avoid comparison operator bug when sort is called.
      The remaining failling doctests are should be fixed outside of this file
      ({{{graphs/connectivity.pyx}}} and {{{matroid.pyx}}}
      
      URL: https://trac.sagemath.org/27378
      Reported by: vklein
      Ticket author(s): Vincent Klein
      Reviewer(s): Frédéric Chapoton
      579dcfca
    • Release Manager's avatar
      Trac #27371: coxeter_diagram() of relabeled Cartan types should attempt to... · 59c9d07b
      Release Manager authored
      Trac #27371: coxeter_diagram() of relabeled Cartan types should attempt to relabel their base Coxeter diagram
      
      {{{
      sage: ct = CartanType(['H',3]).relabel({1:3, 2:2, 3:1})
      sage: ct.coxeter_diagram()
      ------------------------------------------------------------------------
      ---
      TypeError                                 Traceback (most recent call
      last)
      <ipython-input-31-25ab3e311718> in <module>()
      ----> 1 ct.coxeter_diagram()
      
      TypeError: 'NotImplementedType' object is not callable
      }}}
      It should simply try the base type and relabel the diagram
      appropriately, cf.:
      {{{
      sage: CartanType(['H',3]).coxeter_diagram()
      Graph on 3 vertices
      }}}
      
      URL: https://trac.sagemath.org/27371
      Reported by: tscrim
      Ticket author(s): Travis Scrimshaw
      Reviewer(s): Frédéric Chapoton
      59c9d07b
    • Release Manager's avatar
      Trac #27362: Setting PYTHONPATH in spkg-install for pip is fragile · c79e04f6
      Release Manager authored
      As reported in https://groups.google.com/d/msg/sage-
      devel/_UAIbMIKjEU/PBaAI28sBAAJ
      
      In the spkg-install script for pip we set
      
      {{{
      export PYTHONPATH=`cd src && pwd`
      }}}
      
      This invocation is broken if you have the `CDPATH` variable set in bash
      as it will auto-echo the new path cd'd into.
      
      It would be better to just do something like `PYTHONPATH="$(pwd)/src"`.
      
      URL: https://trac.sagemath.org/27362
      Reported by: embray
      Ticket author(s): Erik Bray, Samuel Lelièvre
      Reviewer(s): Andrew Mathas
      c79e04f6
    • Release Manager's avatar
      Trac #27238: use system's gf2x if available · 20c3d7a1
      Release Manager authored
      the usual spkg-configure.m4 thing
      
      URL: https://trac.sagemath.org/27238
      Reported by: dimpase
      Ticket author(s): Dima Pasechnik
      Reviewer(s): François Bissey
      20c3d7a1
  3. 28 Feb, 2019 8 commits
    • Release Manager's avatar
      Trac #25614: 2 internet doctest failing in misc/persist.pyx · 5717cdd0
      Release Manager authored
      With 8.3.beta6,
      
      {{{
      sage -t --long --optional=sage,internet src/sage/misc/persist.pyx
      }}}
      
      gives
      
      {{{
      sage -t --long src/sage/misc/persist.pyx
      **********************************************************************
      File "src/sage/misc/persist.pyx", line 78, in sage.misc.persist.load
      Failed example:
          s = load(u)                                                  #
      optional - internet
      Exception raised:
          Traceback (most recent call last):
            File "/home/slabbe/GitBox/sage/local/lib/python2.7/site-
      packages/sage/doctest/forker.py", line 573, in _run
              self.compile_and_execute(example, compiler, test.globs)
            File "/home/slabbe/GitBox/sage/local/lib/python2.7/site-
      packages/sage/doctest/forker.py", line 983, in compile_and_execute
              exec(compiled, globs)
            File "<doctest sage.misc.persist.load[1]>", line 1, in <module>
              s = load(u)                                                  #
      optional - internet
            File "sage/misc/persist.pyx", line 139, in sage.misc.persist.load
      (build/cythonized/sage/misc/persist.c:2409)
      
      ...
      
            File "/home/slabbe/GitBox/sage/local/lib/python2.7/socket.py",
      line 559, in create_connection
              for res in getaddrinfo(host, port, 0, SOCK_STREAM):
          IOError: [Errno socket error] [Errno -2] Name or service not known
      **********************************************************************
      File "src/sage/misc/persist.pyx", line 81, in sage.misc.persist.load
      Failed example:
          s                                                            #
      optional - internet
      Exception raised:
          Traceback (most recent call last):
            File "/home/slabbe/GitBox/sage/local/lib/python2.7/site-
      packages/sage/doctest/forker.py", line 573, in _run
              self.compile_and_execute(example, compiler, test.globs)
            File "/home/slabbe/GitBox/sage/local/lib/python2.7/site-
      packages/sage/doctest/forker.py", line 983, in compile_and_execute
              exec(compiled, globs)
            File "<doctest sage.misc.persist.load[2]>", line 1, in <module>
              s                                                            #
      optional - internet
          NameError: name 's' is not defined
      **********************************************************************
      1 item had failures:
         2 of  20 in sage.misc.persist.load
          [99 tests, 2 failures, 1.14 s]
      ----------------------------------------------------------------------
      sage -t --long src/sage/misc/persist.pyx  # 2 doctests failed
      ----------------------------------------------------------------------
      Total time for all tests: 2.2 seconds
          cpu time: 0.6 seconds
          cumulative wall time: 1.1 seconds
      External software detected for doctesting: internet
      }}}
      
      URL: https://trac.sagemath.org/25614
      Reported by: slabbe
      Ticket author(s): Sébastien Labbé
      Reviewer(s): Vincent Klein
      5717cdd0
    • Release Manager's avatar
      Trac #23024: Replacement of sage/libs/ppl.pyx by pplpy · 0218ccfe
      Release Manager authored
      The Sage wrappers around [http://bugseng.com/products/ppl/ ppl] are now
      superseded by the standalone [https://gitlab.com/videlec/pplpy pplpy]
      (Python/Cython compatible). This ticket proposes to replace
      `src/sage/libs/ppl.pyx` extension with pplpy. It
      
      - creates a new standard package pplpy
      - upgrade gmpy2 from optional to standard
      - replace the Sage code calling sage/libs/ppl.pyx to call pplpy
      - make appropriate deprecation for `sage.libs.ppl`
      
      pplpy' Tarball : [https://files.pythonhosted.org/packages/fe/f4/765628c7
      4624cea90cc6f260d222dcfc1dff520a54e0f8cc5d67c602d638/pplpy-0.8.4.tar.gz
      pplpy-0.8.4.tar.gz]
      
      URL: https://trac.sagemath.org/23024
      Reported by: vklein
      Ticket author(s): Vincent Klein
      Reviewer(s): Dima Pasechnik, François Bissey, ​Vincent Delecroix, Jeroen
      Demeyer, Erik Bray
      0218ccfe
    • Release Manager's avatar
      Trac #27380: fix gap_packages install on OSX · b5905c6b
      Release Manager authored
      #27218 broke gap_packages on OSX. Here is the fix
      
      sdh_install does "cp -R", which on OSX copies the contents of the 1st
      argument if it ends with '/', dropping everything before the last '/'.
      This broke gap_packages on OSX
      
      URL: https://trac.sagemath.org/27380
      Reported by: dimpase
      Ticket author(s): Dima Pasechnik
      Reviewer(s): Erik Bray
      b5905c6b
    • Vincent Klein's avatar
      Trac #23024: add a spkg-postrm script to clean... · 829317e5
      Vincent Klein authored
      ... the documentation directory
      829317e5
    • Vincent Klein's avatar
      Trac #23024: upgrade pplpy to 0.8.4 · 76cfa5f9
      Vincent Klein authored
      76cfa5f9
    • Dima Pasechnik's avatar
      whitespaces adjusted, tabs removed · 844e2411
      Dima Pasechnik authored
      844e2411
    • Sébastien Labbé's avatar
      307e663c
    • Sébastien Labbé's avatar
      25614: fixing failing internet doctest · 78ff0118
      Sébastien Labbé authored
      78ff0118
  4. 27 Feb, 2019 7 commits
  5. 26 Feb, 2019 16 commits
    • Release Manager's avatar
      Trac #27353: Coerce_dict deprecations and documention updates · f8252a7d
      Release Manager authored
      Following up on #24135: deprecations. Some minor issues with
      documentation that was out of date as well.
      
      URL: https://trac.sagemath.org/27353
      Reported by: nbruin
      Ticket author(s): Nils Bruin
      Reviewer(s): Jeroen Demeyer
      f8252a7d
    • Release Manager's avatar
      Trac #27349: py3 compatible test for the category of finite posets · dc7b849a
      Release Manager authored
      Fix `categories/finite_posets.py` for py3.
      
      URL: https://trac.sagemath.org/27349
      Reported by: jmantysalo
      Ticket author(s): Jori Mäntysalo
      Reviewer(s): Frédéric Chapoton
      dc7b849a
    • Release Manager's avatar
      Trac #27357: remove deprecation in finite state machines · 05319047
      Release Manager authored
      after #16538
      
      plus some cleanup of imports from copy
      
      URL: https://trac.sagemath.org/27357
      Reported by: chapoton
      Ticket author(s): Frédéric Chapoton
      Reviewer(s): Travis Scrimshaw
      05319047
    • Release Manager's avatar
      Trac #27356: remove one deprecated file in species · eba7d0f3
      Release Manager authored
      after #14846
      
      URL: https://trac.sagemath.org/27356
      Reported by: chapoton
      Ticket author(s): Frédéric Chapoton
      Reviewer(s): Travis Scrimshaw
      eba7d0f3
    • Release Manager's avatar
      Trac #27355: remove deprecated stuff in pbori.pyx · 2419827a
      Release Manager authored
      after #13849
      
      plus some cleanup of code and doc
      
      URL: https://trac.sagemath.org/27355
      Reported by: chapoton
      Ticket author(s): Frédéric Chapoton
      Reviewer(s): Travis Scrimshaw
      2419827a
    • Release Manager's avatar
      Trac #27344: py3: fix some doctests about hash for real and complex double · 9f32d7ee
      Release Manager authored
      URL: https://trac.sagemath.org/27344
      Reported by: chapoton
      Ticket author(s): Frédéric Chapoton
      Reviewer(s): Jeroen Demeyer
      9f32d7ee
    • Release Manager's avatar
      Trac #27342: py3: some tiny fixes in numerical folder · ce983fe4
      Release Manager authored
      URL: https://trac.sagemath.org/27342
      Reported by: chapoton
      Ticket author(s): Frédéric Chapoton
      Reviewer(s): Travis Scrimshaw
      ce983fe4
    • Release Manager's avatar
      Trac #27245: py3: fix doctests in generic_graph (part 9) -- automorphism_group · d526ff1c
      Release Manager authored
      We fix failing doctests in `automorphism_group`.
      
      We also do some minor cleaning in the method.
      
      URL: https://trac.sagemath.org/27245
      Reported by: dcoudert
      Ticket author(s): David Coudert
      Reviewer(s): Kevin Dilks
      d526ff1c
    • Release Manager's avatar
      Trac #27335: Out-of-bounds memory access in PARI isprime() function · bbea55c9
      Release Manager authored
      This was originally reported in #27267, but determined to be a distinct
      issue from another crash reported on that ticket.
      
      This is easily reproduced on Cygwin:
      {{{
      sage: (2^127 - 1).is_prime()
      
      *** SIG 11 *** inside sig_on
      do_raise_exception(sig=11)
      PyErr_Occurred() = 0x0
      Raising Python exception 0 ms after signal...
      ------------------------------------------------------------------------
      ---
      SignalError                               Traceback (most recent call
      last)
      <ipython-input-1-714806c14b73> in <module>()
      ----> 1 (Integer(2)**Integer(127) - Integer(1)).is_prime()
      
      /home/embray/src/sagemath/sage/local/lib/python2.7/site-
      packages/sage/rings/integer.pyx in sage.rings.integer.Integer.is_prime
      (build/cythonized/sage/rings/integer.c:32034)()
         5141             proof = get_flag(proof, "arithmetic")
         5142         if proof:
      -> 5143             return self.__pari__().isprime()
         5144         else:
         5145             return self.__pari__().ispseudoprime()
      
      cypari2/gen.pyx in cypari2.gen.Gen.isprime()
      
      SignalError: Segmentation fault
      }}}
      
      The C stack trace in the case of these crashes looks like:
      
      {{{
      Program received signal SIGSEGV, Segmentation fault.
      0x00000003b598daf4 in red_montgomery ()
         from /home/embray/src/sagemath/sage/local/lib/libpari-gmp.dll
      (gdb) where
      #0  0x00000003b598daf4 in red_montgomery ()
         from /home/embray/src/sagemath/sage/local/lib/libpari-gmp.dll
      #1  0x00000003b5bd482f in gen_pow_i ()
         from /home/embray/src/sagemath/sage/local/lib/libpari-gmp.dll
      #2  0x00000003b5b58d1e in Fp_pow ()
         from /home/embray/src/sagemath/sage/local/lib/libpari-gmp.dll
      #3  0x00000003b5e77644 in pl831 ()
         from /home/embray/src/sagemath/sage/local/lib/libpari-gmp.dll
      #4  0x00000003b5e7a8f4 in BPSW_isprime.part.15 ()
         from /home/embray/src/sagemath/sage/local/lib/libpari-gmp.dll
      #5  0x00000003b5e7acb2 in isprime ()
         from /home/embray/src/sagemath/sage/local/lib/libpari-gmp.dll
      #6  0x00000003b5d0d4cf in map_proto_lG ()
         from /home/embray/src/sagemath/sage/local/lib/libpari-gmp.dll
      #7  0x00000003b269a455 in
      __pyx_pf_7cypari2_3gen_3Gen_118isprime.isra.124 ()
         from /home/embray/src/sagemath/sage/local/lib/python2.7/site-
      packages/cypari2/gen.dll
      #8  0x00000003b277765f in __pyx_pw_7cypari2_3gen_3Gen_119isprime ()
         from /home/embray/src/sagemath/sage/local/lib/python2.7/site-
      packages/cypari2/gen.dll
      #9  0x000000039881394c in __Pyx_CyFunction_CallAsMethod ()
         from /home/embray/src/sagemath/sage/local/lib/python2.7/site-
      packages/sage/misc/persist.dll
      #10 0x0000000393e55486 in __Pyx__PyObject_CallOneArg ()
         from /home/embray/src/sagemath/sage/local/lib/python2.7/site-
      packages/sage/rings/integer.dll
      #11 0x0000000393e645c5 in __Pyx_PyObject_CallOneArg ()
         from /home/embray/src/sagemath/sage/local/lib/python2.7/site-
      packages/sage/rings/integer.dll
      #12 0x0000000393e6bccc in
      __pyx_pw_4sage_5rings_7integer_7Integer_203is_prime
          ()
         from /home/embray/src/sagemath/sage/local/lib/python2.7/site-
      packages/sage/rings/integer.dll
      #13 0x00000003c1548bfa in PyEval_EvalFrameEx ()
         from /home/embray/src/sagemath/sage/local/bin/libpython2.7.dll
      }}}
      
      It can also be reproduced on Linux, but only after forcing some
      unaccessible memory:
      {{{
      >>> import os, mmap; from cypari2 import Pari; pari = Pari()
      >>> z = open("/dev/zero"); m = mmap.mmap(z.fileno(), 2**30, prot=0)
      >>> pari.allocatemem(2**32)
      PARI stack size set to 4294967296 bytes, maximum size set to 4294967296
      >>> pari(2**127 - 1).isprime()
      sys:1: RuntimeWarning: cypari2 leaked 5704 bytes on the PARI stack
      Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
        File "cypari2/gen.pyx", line 2077, in cypari2.gen.Gen.isprime
      cysignals.signals.SignalError: Segmentation fault
      }}}
      
      URL: https://trac.sagemath.org/27335
      Reported by: embray
      Ticket author(s): Jeroen Demeyer
      Reviewer(s): Erik Bray
      bbea55c9
    • Release Manager's avatar
      Trac #27267: Segfaults in cypari2 when running out of stack during deep object deallocation · b58cc785
      Release Manager authored
      Since cypari2-2 (#26442), the `__dealloc__` for `Gen` may cause deep
      (but finite) recursions, causing a stack overflow. This happens in
      particular on Cygwin which has a smallish stack by default (and maybe it
      also uses more stack space?) but it can be provoked easily on other
      systems too with
      {{{
      pari.allocatemem(2^28); L = [pari(i) for i in range(2^20)]; x =
      pari.Pi(); del L; del x
      }}}
      
      For reference, this is the test failure on Cygwin:
      {{{
      sage -t --long src/sage/rings/number_field/totallyreal.pyx
      **********************************************************************
      File "src/sage/rings/number_field/totallyreal.pyx", line 243, in
      sage.rings.number_field.totallyreal.?
      Failed example:
          len(enumerate_totallyreal_fields_prim(2,2**15)) # long time
      Exception raised:
          Traceback (most recent call last):
            File "/home/embray/src/sagemath/sage/local/lib/python2.7/site-
      packages/sage/doctest/forker.py", line 671, in _run
              self.compile_and_execute(example, compiler, test.globs)
            File "/home/embray/src/sagemath/sage/local/lib/python2.7/site-
      packages/sage/doctest/forker.py", line 1095, in compile_and_execute
              exec(compiled, globs)
            File "<doctest sage.rings.number_field.totallyreal.?[3]>", line 1,
      in <module>
              len(enumerate_totallyreal_fields_prim(Integer(2),Integer(2)**Int
      eger(15))) # long time
            File "sage/misc/lazy_import.pyx", line 354, in
      sage.misc.lazy_import.LazyImport.__call__
      (build/cythonized/sage/misc/lazy_import.c:3683)
              return self.get_object()(*args, **kwds)
            File "sage/rings/number_field/totallyreal.pyx", line 393, in
      sage.rings.number_field.totallyreal.enumerate_totallyreal_fields_prim
      (build/cythonized/sage/rings/number_field/totallyreal.c:5753)
              ng = <pari_gen>((<pari_gen>(pari([nf,zk]))).polredabs())
            File "cypari2/auto_gen.pxi", line 22098, in
      cypari2.gen.Gen_base.polredabs
            File "cypari2/stack.pyx", line 156, in cypari2.stack.new_gen
            File "cypari2/stack.pyx", line 194, in
      cypari2.stack.new_gen_noclear
            File "cypari2/stack.pyx", line 128, in
      cypari2.stack.move_gens_to_heap
          SignalError: Segmentation fault
      }}}
      
      It turns out that CPython's "trashcan" mechanism was precisely designed
      to solve this problem. So we added support upstream in Cython for
      `@cython.trashcan` and then use that in cypari2. While we're at it, we
      upgrade to the latest Cython release
      
      '''Tarball''': https://files.pythonhosted.org/packages/e0/31/4a166556f92
      c469d8291d4b03a187f325c773c330fffc1e798bf83d947f2/Cython-0.29.5.tar.gz
      
      '''Upstream tickets''':
      - https://github.com/cython/cython/pull/2842
      - https://github.com/sagemath/cypari2/pull/77
      
      URL: https://trac.sagemath.org/27267
      Reported by: embray
      Ticket author(s): Jeroen Demeyer
      Reviewer(s): Erik Bray
      b58cc785
    • Frédéric Chapoton's avatar
    • Dima Pasechnik's avatar
      added a test for version >= 1.2 · 6b611568
      Dima Pasechnik authored
      6b611568
    • Dima Pasechnik's avatar
      spkg-configure.m4 for gf2x · a1ee9bd8
      Dima Pasechnik authored
      a1ee9bd8
    • Samuel Lelièvre's avatar
      #27362 Set PYTHONPATH more robustly · a96f0387
      Samuel Lelièvre authored
      a96f0387
    • Dmitrii Pasechnik's avatar
    • Frédéric Chapoton's avatar
      trac 27356 fixing the references · 23fa553e
      Frédéric Chapoton authored
      23fa553e