Skip to content
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

DIMACS solver not workng with Python3 (7 glucose optional doctests failed) #28763

Closed
seblabbe opened this issue Nov 19, 2019 · 9 comments
Closed

Comments

@seblabbe
Copy link
Contributor

With 9.0.beta6, Release Date: 2019-11-18, the following

sage -t --optional=sage,optional,external src/sage/sat/solvers/dimacs.py

gives

sage -t src/sage/sat/solvers/dimacs.py
**********************************************************************
File "src/sage/sat/solvers/dimacs.py", line 476, in sage.sat.solvers.dimacs.Glucose
Failed example:
    solver()                            # optional - glucose
Exception raised:
    Traceback (most recent call last):
      File "/home/slabbe/GitBox/sage/local/lib/python3.7/site-packages/sage/doctest/forker.py", line 681, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/home/slabbe/GitBox/sage/local/lib/python3.7/site-packages/sage/doctest/forker.py", line 1123, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.sat.solvers.dimacs.Glucose[6]>", line 1, in <module>
        solver()                            # optional - glucose
      File "/home/slabbe/GitBox/sage/local/lib/python3.7/site-packages/sage/sat/solvers/dimacs.py", line 539, in __call__
        DIMACS.__call__(self)
      File "/home/slabbe/GitBox/sage/local/lib/python3.7/site-packages/sage/sat/solvers/dimacs.py", line 406, in __call__
        self._output.append(line)
    MemoryError
**********************************************************************
File "src/sage/sat/solvers/dimacs.py", line 504, in sage.sat.solvers.dimacs.Glucose.__call__
Failed example:
    solve_sat(F, solver=sage.sat.solvers.Glucose)  # optional - glucose
Exception raised:
    Traceback (most recent call last):
      File "/home/slabbe/GitBox/sage/local/lib/python3.7/site-packages/sage/doctest/forker.py", line 681, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/home/slabbe/GitBox/sage/local/lib/python3.7/site-packages/sage/doctest/forker.py", line 1123, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.sat.solvers.dimacs.Glucose.__call__[2]>", line 1, in <module>
        solve_sat(F, solver=sage.sat.solvers.Glucose)  # optional - glucose
      File "/home/slabbe/GitBox/sage/local/lib/python3.7/site-packages/sage/sat/boolean_polynomials.py", line 271, in solve
        s = solver()
      File "/home/slabbe/GitBox/sage/local/lib/python3.7/site-packages/sage/sat/solvers/dimacs.py", line 539, in __call__
        DIMACS.__call__(self)
      File "/home/slabbe/GitBox/sage/local/lib/python3.7/site-packages/sage/sat/solvers/dimacs.py", line 406, in __call__
        self._output.append(line)
    MemoryError
**********************************************************************
File "src/sage/sat/solvers/dimacs.py", line 533, in sage.sat.solvers.dimacs.Glucose.__call__
Failed example:
    solver()                           # optional - glucose
Exception raised:
    Traceback (most recent call last):
      File "/home/slabbe/GitBox/sage/local/lib/python3.7/site-packages/sage/doctest/forker.py", line 681, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/home/slabbe/GitBox/sage/local/lib/python3.7/site-packages/sage/doctest/forker.py", line 1123, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.sat.solvers.dimacs.Glucose.__call__[8]>", line 1, in <module>
        solver()                           # optional - glucose
      File "/home/slabbe/GitBox/sage/local/lib/python3.7/site-packages/sage/sat/solvers/dimacs.py", line 539, in __call__
        DIMACS.__call__(self)
      File "/home/slabbe/GitBox/sage/local/lib/python3.7/site-packages/sage/sat/solvers/dimacs.py", line 406, in __call__
        self._output.append(line)
    MemoryError
**********************************************************************
File "src/sage/sat/solvers/dimacs.py", line 536, in sage.sat.solvers.dimacs.Glucose.__call__
Failed example:
    solver()                           # optional - glucose
Exception raised:
    Traceback (most recent call last):
      File "/home/slabbe/GitBox/sage/local/lib/python3.7/site-packages/sage/doctest/forker.py", line 681, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/home/slabbe/GitBox/sage/local/lib/python3.7/site-packages/sage/doctest/forker.py", line 1123, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.sat.solvers.dimacs.Glucose.__call__[10]>", line 1, in <module>
        solver()                           # optional - glucose
      File "/home/slabbe/GitBox/sage/local/lib/python3.7/site-packages/sage/sat/solvers/dimacs.py", line 539, in __call__
        DIMACS.__call__(self)
      File "/home/slabbe/GitBox/sage/local/lib/python3.7/site-packages/sage/sat/solvers/dimacs.py", line 406, in __call__
        self._output.append(line)
    MemoryError
**********************************************************************
File "src/sage/sat/solvers/dimacs.py", line 585, in sage.sat.solvers.dimacs.GlucoseSyrup.__call__
Failed example:
    solve_sat(F, solver=sage.sat.solvers.GlucoseSyrup)  # optional - glucose
Exception raised:
    Traceback (most recent call last):
      File "/home/slabbe/GitBox/sage/local/lib/python3.7/site-packages/sage/doctest/forker.py", line 681, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/home/slabbe/GitBox/sage/local/lib/python3.7/site-packages/sage/doctest/forker.py", line 1123, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.sat.solvers.dimacs.GlucoseSyrup.__call__[2]>", line 1, in <module>
        solve_sat(F, solver=sage.sat.solvers.GlucoseSyrup)  # optional - glucose
      File "/home/slabbe/GitBox/sage/local/lib/python3.7/site-packages/sage/sat/boolean_polynomials.py", line 271, in solve
        s = solver()
      File "/home/slabbe/GitBox/sage/local/lib/python3.7/site-packages/sage/sat/solvers/dimacs.py", line 618, in __call__
        DIMACS.__call__(self)
      File "/home/slabbe/GitBox/sage/local/lib/python3.7/site-packages/sage/sat/solvers/dimacs.py", line 406, in __call__
        self._output.append(line)
    MemoryError
**********************************************************************
File "src/sage/sat/solvers/dimacs.py", line 612, in sage.sat.solvers.dimacs.GlucoseSyrup.__call__
Failed example:
    solver()                          # optional - glucose
Exception raised:
    Traceback (most recent call last):
      File "/home/slabbe/GitBox/sage/local/lib/python3.7/site-packages/sage/doctest/forker.py", line 681, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/home/slabbe/GitBox/sage/local/lib/python3.7/site-packages/sage/doctest/forker.py", line 1123, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.sat.solvers.dimacs.GlucoseSyrup.__call__[8]>", line 1, in <module>
        solver()                          # optional - glucose
      File "/home/slabbe/GitBox/sage/local/lib/python3.7/site-packages/sage/sat/solvers/dimacs.py", line 618, in __call__
        DIMACS.__call__(self)
      File "/home/slabbe/GitBox/sage/local/lib/python3.7/site-packages/sage/sat/solvers/dimacs.py", line 406, in __call__
        self._output.append(line)
    MemoryError
**********************************************************************
File "src/sage/sat/solvers/dimacs.py", line 615, in sage.sat.solvers.dimacs.GlucoseSyrup.__call__
Failed example:
    solver()                          # optional - glucose
Exception raised:
    Traceback (most recent call last):
      File "/home/slabbe/GitBox/sage/local/lib/python3.7/site-packages/sage/doctest/forker.py", line 681, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/home/slabbe/GitBox/sage/local/lib/python3.7/site-packages/sage/doctest/forker.py", line 1123, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.sat.solvers.dimacs.GlucoseSyrup.__call__[10]>", line 1, in <module>
        solver()                          # optional - glucose
      File "/home/slabbe/GitBox/sage/local/lib/python3.7/site-packages/sage/sat/solvers/dimacs.py", line 618, in __call__
        DIMACS.__call__(self)
      File "/home/slabbe/GitBox/sage/local/lib/python3.7/site-packages/sage/sat/solvers/dimacs.py", line 406, in __call__
        self._output.append(line)
    MemoryError
**********************************************************************
3 items had failures:
   1 of   8 in sage.sat.solvers.dimacs.Glucose
   3 of  12 in sage.sat.solvers.dimacs.Glucose.__call__
   3 of  12 in sage.sat.solvers.dimacs.GlucoseSyrup.__call__
    [87 tests, 7 failures, 278.79 s]
----------------------------------------------------------------------
sage -t src/sage/sat/solvers/dimacs.py  # 7 doctests failed
----------------------------------------------------------------------
Total time for all tests: 278.9 seconds
    cpu time: 278.6 seconds
    cumulative wall time: 278.8 seconds
External software detected for doctesting: 

CC: @sagetrac-tmonteil

Component: packages: optional

Author: Thierry Monteil

Branch/Commit: e26e260

Reviewer: Sébastien Labbé

Issue created by migration from https://trac.sagemath.org/ticket/28763

@seblabbe
Copy link
Contributor Author

comment:1

Can you give a look at this Thierry?

@sagetrac-tmonteil
Copy link
Mannequin

sagetrac-tmonteil mannequin commented Nov 19, 2019

comment:2

I confirm the issue. I do not know the culprit though.

@sagetrac-tmonteil
Copy link
Mannequin

sagetrac-tmonteil mannequin commented Nov 20, 2019

comment:3

OK, it is a bytes vs str issue in Python3. I have a fix, but i do not know whether it will continue to work with Python2 yet, need to recompile first.

@sagetrac-tmonteil
Copy link
Mannequin

sagetrac-tmonteil mannequin commented Nov 20, 2019

Author: Thierry Monteil

@sagetrac-tmonteil sagetrac-tmonteil mannequin changed the title 7 glucose optional doctests failed in sat/solvers/dimacs.py DIMACS solver not workng with Python3 (7 glucose optional doctests failed) Nov 20, 2019
@sagetrac-tmonteil
Copy link
Mannequin

sagetrac-tmonteil mannequin commented Nov 20, 2019

@sagetrac-tmonteil
Copy link
Mannequin

sagetrac-tmonteil mannequin commented Nov 20, 2019

Commit: e26e260

@sagetrac-tmonteil
Copy link
Mannequin

sagetrac-tmonteil mannequin commented Nov 20, 2019

comment:6

This branch should work both on Python2 and Python3.


New commits:

e26e260#28763 : fix a bytes vs str Python3 issue in dimacs solver

@seblabbe
Copy link
Contributor Author

Reviewer: Sébastien Labbé

@vbraun
Copy link
Member

vbraun commented Nov 30, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants