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

Make libs doctests ready for random seeds #29964

Closed
kliem opened this issue Jun 24, 2020 · 20 comments
Closed

Make libs doctests ready for random seeds #29964

kliem opened this issue Jun 24, 2020 · 20 comments

Comments

@kliem
Copy link
Contributor

kliem commented Jun 24, 2020

This ticket makes

sage -t --long --random-seed=n src/sage/libs/

pass for different values n than just 0.

CC: @DaveWitteMorris

Component: doctest framework

Author: Jonathan Kliem

Branch/Commit: 2995c47

Reviewer: Marc Mezzarobba

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

@kliem kliem added this to the sage-9.2 milestone Jun 24, 2020
@kliem

This comment has been minimized.

@kliem
Copy link
Contributor Author

kliem commented Jun 24, 2020

comment:2

At least the following will need to be fixed:

sage -t --long --random-seed=151058820726654196682836430928254760259 src/sage/libs/flint/nmod_poly_linkage.pxi  # 28 doctests failed
sage -t --long --random-seed=151058820726654196682836430928254760259 src/sage/libs/ntl/ntl_GF2E.pyx  # 1 doctest failed
sage -t --long --random-seed=151058820726654196682836430928254760259 src/sage/libs/ntl/ntl_mat_GF2.pyx  # 29 doctests failed
sage -t --long --random-seed=151058820726654196682836430928254760259 src/sage/libs/ntl/ntl_mat_GF2E.pyx  # 3 doctests failed
sage -t --long --random-seed=151058820726654196682836430928254760259 src/sage/libs/ntl/ntl_mat_ZZ.pyx  # 1 doctest failed
sage -t --long --random-seed=151058820726654196682836430928254760259 src/sage/libs/ntl/ntl_ZZ_p.pyx  # 1 doctest failed
sage -t --long --random-seed=151058820726654196682836430928254760259 src/sage/libs/ntl/ntl_ZZ.pyx  # 3 doctests failed
sage -t --long --random-seed=151058820726654196682836430928254760259 src/sage/libs/singular/function.pyx  # 1 doctest failed

@kliem
Copy link
Contributor Author

kliem commented Jun 24, 2020

Dependencies: #29962

@mkoeppe mkoeppe modified the milestones: sage-9.2, sage-9.3 Sep 5, 2020
@kliem
Copy link
Contributor Author

kliem commented Jan 24, 2021

comment:5

The NTL function randomBits is documented incorrectly. Of course it returns a random number with n random bits which corresponds to a random number in [0, 2^n) and not 2^(n-1) as claimed.

@kliem
Copy link
Contributor Author

kliem commented Jan 24, 2021

Commit: 080538b

@kliem
Copy link
Contributor Author

kliem commented Jan 24, 2021

New commits:

080538bmake sage/libs ready for implicit fuzzing of doctests

@kliem
Copy link
Contributor Author

kliem commented Jan 24, 2021

Author: Jonathan Kliem

@kliem
Copy link
Contributor Author

kliem commented Jan 24, 2021

Branch: public/29964

@kliem
Copy link
Contributor Author

kliem commented Jan 25, 2021

comment:7
list(mult for factor, mult in decomp) <= list(range(2, 2 + len(decomp)))

This does not test for a sublist. I will implement such a quick test in #29969.

@kliem
Copy link
Contributor Author

kliem commented Jan 25, 2021

Changed dependencies from #29962 to #29969

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 25, 2021

Changed commit from 080538b to 6e02a46

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 25, 2021

Branch pushed to git repo; I updated commit sha1. New commits:

6e02a46properly check if the list is strictly increasing

@kliem
Copy link
Contributor Author

kliem commented Jan 25, 2021

Changed dependencies from #29969 to none

@mezzarobba
Copy link
Member

Reviewer: Marc Mezzarobba

@mezzarobba
Copy link
Member

comment:10

I think I would have kept the examples in gauss() (and flagged it as random), and maybe removed the test that the matrix is not reduced (no real point IMO). But that's not big deal: please feel free to set the ticket to positive_review on my behalf either after changing that or if you disagree.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 29, 2021

Branch pushed to git repo; I updated commit sha1. New commits:

2995c47keep a random doctest for illustration

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 29, 2021

Changed commit from 6e02a46 to 2995c47

@kliem
Copy link
Contributor Author

kliem commented Jan 29, 2021

comment:12

Ok, I added again one of the examples of gauss for illustration.

The test that the matrix is not reduced really tests that the remaining rows are all zero, which tests that the functions has worked correctly, I guess.

@kliem
Copy link
Contributor Author

kliem commented Jan 29, 2021

comment:13

Thank you.

@vbraun
Copy link
Member

vbraun commented Feb 20, 2021

Changed branch from public/29964 to 2995c47

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

4 participants