Opened 11 years ago

Closed 7 months ago

#12419 closed defect (fixed)

factorization of 0 in GF(p)[x,y] fails

Reported by: Paul Zimmermann Owned by: tbd
Priority: minor Milestone: sage-9.6
Component: factorization Keywords:
Cc: Merged in:
Authors: Paul Zimmermann Reviewers: Frédéric Chapoton
Report Upstream: N/A Work issues:
Branch: c7e7d54 (Commits, GitHub, GitLab) Commit: c7e7d54dd25c06d5d930a3a70e2587d049cac1ed
Dependencies: Stopgaps:

Status badges

Description

This was reported by Charles Bouillaguet.

sage: R.<x,y> = GF(2)[] 
sage: R(1).factor()    
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
...

AttributeError: 'sage.rings.finite_rings.integer_mod.IntegerMod_int' object has no attribute 'factor'

Paul Zimmermann

Change History (27)

comment:1 Changed 9 years ago by Jeroen Demeyer

Milestone: sage-5.11sage-5.12

comment:2 Changed 9 years ago by For batch modifications

Milestone: sage-6.1sage-6.2

comment:3 Changed 8 years ago by For batch modifications

Milestone: sage-6.2sage-6.3

comment:4 Changed 8 years ago by For batch modifications

Milestone: sage-6.3sage-6.4

comment:5 Changed 13 months ago by Frédéric Chapoton

works now (sage 9.5.b0):

sage: R.<x,y> = GF(2)[]  
sage: R(1).factor()                                                       
1

comment:6 Changed 13 months ago by Paul Zimmermann

Status: newneeds_review

it works already in Sage 9.1. I propose to resolve as "fixed".

comment:7 Changed 13 months ago by Frédéric Chapoton

somebody(?) should add a doctest, no ?

comment:8 Changed 13 months ago by Paul Zimmermann

I can do it, but it's a long time I didn't contribute to Sage. Is there a howto somewhere?

comment:9 Changed 13 months ago by Frédéric Chapoton

humm, if you know git, this is simple. Otherwise, c'est moins simple.

there is the big developer manual, and in particular

https://doc.sagemath.org/html/en/developer/index.html#git-tricks-tips

in very short :

(1) clone the git repo and go to the develop branch

(2) set the remote to trac

(3) make a local branch on top of the develop branch

(4) push the branch to trac under u/your_trac_name/branch_name

(5) write that branch name in the ticket branch field

Last edited 13 months ago by Frédéric Chapoton (previous) (diff)

comment:10 Changed 13 months ago by Paul Zimmermann

thanks, I've added a doctest, now running sage -t -all

comment:11 Changed 13 months ago by Frédéric Chapoton

si la branche est prete, le patchbot peut se charger de lancer les tests.

comment:12 Changed 13 months ago by Paul Zimmermann

I get the following error while running the tests:

zimmerma@tomate:/tmp/sage$ ./sage -t -p 4 -all
...
Killing test src/sage/rings/valuation/augmented_valuation.py
Killing test src/sage/combinat/rigged_configurations/rc_infinity.py
Killing test src/sage/symbolic/integration/external.py
Killing test src/sage/coding/databases.py
----------------------------------------------------------------------
sage -t --long --warn-long 56.2 --random-seed=0 src/sage/functions/piecewise.py  # UnicodeEncodeError in doctesting framework
Doctests interrupted: 666/4346 files tested
----------------------------------------------------------------------
Total time for all tests: 2466.7 seconds
    cpu time: 6988.6 seconds
    cumulative wall time: 9651.5 seconds
Traceback (most recent call last):
  File "/tmp/sage/src/bin/sage-runtests", line 144, in <module>
    err = DC.run()
  File "/tmp/sage/local/lib/python3.9/site-packages/sage/doctest/control.py", line 1207, in run
    self.run_doctests()
  File "/tmp/sage/local/lib/python3.9/site-packages/sage/doctest/control.py", line 909, in run_doctests
    self.dispatcher.dispatch()
  File "/tmp/sage/local/lib/python3.9/site-packages/sage/doctest/forker.py", line 2044, in dispatch
    self.parallel_dispatch()
  File "/tmp/sage/local/lib/python3.9/site-packages/sage/doctest/forker.py", line 1965, in parallel_dispatch
    w.read_messages()
  File "/tmp/sage/local/lib/python3.9/site-packages/sage/doctest/forker.py", line 2255, in read_messages
    self.messages += bytes_to_str(s)
  File "sage/cpython/string.pxd", line 28, in sage.cpython.string.bytes_to_str (build/cythonized/sage/cpython/string.c:1588)
  File "sage/cpython/string.pxd", line 51, in sage.cpython.string.bytes_to_str (build/cythonized/sage/cpython/string.c:1466)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 1627: invalid start byte

comment:13 Changed 13 months ago by Frédéric Chapoton

merci de pousser la branche sur trac, et d'écrire son nom dans le champ "branch" ci-dessus. On fera faire les tests par un patchbot.

comment:14 Changed 13 months ago by Paul Zimmermann

it seems I don't have the right to push to trac (or I did the wrong command):

zimmerma@tomate:/tmp/sage$ git remote -v
origin  https://github.com/sagemath/sage.git (fetch)
origin  https://github.com/sagemath/sage.git (push)
trac    git@trac.sagemath.org:sage.git (fetch)
trac    git@trac.sagemath.org:sage.git (push)

zimmerma@tomate:/tmp/sage$ git push --set-upstream trac trac-12419
X11 forwarding request failed on channel 0
Enumerating objects: 13, done.
Counting objects: 100% (13/13), done.
Delta compression using up to 4 threads
Compressing objects: 100% (7/7), done.
Writing objects: 100% (7/7), 629 bytes | 629.00 KiB/s, done.
Total 7 (delta 6), reused 0 (delta 0), pack-reused 0
remote: FATAL: W refs/heads/trac-12419 sage zimmerma DENIED by fallthru
remote: error: hook declined to update refs/heads/trac-12419
To trac.sagemath.org:sage.git
 ! [remote rejected]       trac-12419 -> trac-12419 (hook declined)
error: failed to push some refs to 'trac.sagemath.org:sage.git'

comment:15 Changed 13 months ago by Frédéric Chapoton

my remote says

~/sage$ git remote -v
trac	ssh://git@trac.sagemath.org:22/sage.git (fetch)
trac	ssh://git@trac.sagemath.org:22/sage.git (push)

Tro to use simply

git push trac HEAD:u/zimmerman/12419
Version 0, edited 13 months ago by Frédéric Chapoton (next)

comment:16 Changed 13 months ago by Frédéric Chapoton

Milestone: sage-6.4sage-9.5

comment:17 Changed 13 months ago by Paul Zimmermann

Milestone: sage-9.5sage-6.4

thanks, it works! The branch is called u/zimmerma/12419.

For the record, what I did:

git clone ssh://git@trac.sagemath.org:22/sage.git
cd sage
git remote add trac ssh://git@trac.sagemath.org:22/sage.git -t master
git remote set-url --push trac ssh://git@trac.sagemath.org:22/sage.git
<edit files>
git commit -a
git push trac HEAD:u/zimmerma/12419

comment:18 Changed 13 months ago by Frédéric Chapoton

Authors: Paul Zimmermann
Branch: u/zimmerma/12419
Commit: 1733915f770a73937280c86aecf5e76c544a785b
Milestone: sage-6.4sage-9.5

I have put the branch name in place


New commits:

1733915added doctect for trac #12419

comment:19 Changed 13 months ago by Frédéric Chapoton

branch looks good. A patchbot should come, if not I will launch mine when it becomes available.

comment:20 Changed 13 months ago by Frédéric Chapoton

Reviewers: Frédéric Chapoton
Status: needs_reviewpositive_review

ok, green bot

comment:21 Changed 12 months ago by Volker Braun

Status: positive_reviewneeds_work

Merge conflict

comment:22 Changed 9 months ago by Matthias Köppe

Milestone: sage-9.5sage-9.6

comment:23 Changed 7 months ago by Frédéric Chapoton

Branch: u/zimmerma/12419u/chapoton/12419
Commit: 1733915f770a73937280c86aecf5e76c544a785bc7e7d54dd25c06d5d930a3a70e2587d049cac1ed
Status: needs_workneeds_review

rebased


New commits:

c7e7d54Merge branch 'u/zimmerma/12419' in 9.6.b1

comment:24 Changed 7 months ago by Frédéric Chapoton

Status: needs_reviewpositive_review

back to positive

comment:25 Changed 7 months ago by Paul Zimmermann

I don't have time to test, but the original failure was for 0 not 1 if I remember correctly. Does it work for 0 too?

comment:26 Changed 7 months ago by Paul Zimmermann

sorry, the factorization of 0 is not defined. For 1 it works already in 9.4.

comment:27 Changed 7 months ago by Volker Braun

Branch: u/chapoton/12419c7e7d54dd25c06d5d930a3a70e2587d049cac1ed
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.