#29964 closed enhancement (fixed)

Make libs doctests ready for random seeds

Reported by: gh-kliem Owned by:
Priority: major Milestone: sage-9.3
Component: doctest framework Keywords:
Cc: gh-DaveWitteMorris Merged in:
Authors: Jonathan Kliem Reviewers: Marc Mezzarobba
Report Upstream: N/A Work issues:
Branch: 2995c47 (Commits, GitHub, GitLab) Commit: 2995c477d7c9eabc2744636e601427312d321d07
Dependencies: Stopgaps:

Status badges

Description (last modified by gh-kliem)

This ticket makes

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

pass for different values n than just 0.

Change History (14)

comment:1 Changed 18 months ago by gh-kliem

  • Description modified (diff)

comment:2 Changed 18 months ago by gh-kliem

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

comment:3 Changed 18 months ago by gh-kliem

  • Dependencies set to #29962

comment:4 Changed 15 months ago by mkoeppe

  • Milestone changed from sage-9.2 to sage-9.3

comment:5 Changed 10 months ago by gh-kliem

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.

comment:6 Changed 10 months ago by gh-kliem

  • Authors set to Jonathan Kliem
  • Branch set to public/29964
  • Cc gh-DaveWitteMorris added
  • Commit set to 080538b3c6a7d2c2a99d27c41d96ffad59d232fd
  • Status changed from new to needs_review

New commits:

080538bmake sage/libs ready for implicit fuzzing of doctests

comment:7 Changed 10 months ago by gh-kliem

  • Dependencies changed from #29962 to #29969
  • Status changed from needs_review to needs_work
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.

comment:8 Changed 10 months ago by git

  • Commit changed from 080538b3c6a7d2c2a99d27c41d96ffad59d232fd to 6e02a466ca9635800b3659ba749ea477d1a18b9f

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

6e02a46properly check if the list is strictly increasing

comment:9 Changed 10 months ago by gh-kliem

  • Dependencies #29969 deleted
  • Status changed from needs_work to needs_review

comment:10 Changed 10 months ago by mmezzarobba

  • Reviewers set to Marc Mezzarobba

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.

comment:11 Changed 10 months ago by git

  • Commit changed from 6e02a466ca9635800b3659ba749ea477d1a18b9f to 2995c477d7c9eabc2744636e601427312d321d07

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

2995c47keep a random doctest for illustration

comment:12 Changed 10 months ago by gh-kliem

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.

comment:13 Changed 10 months ago by gh-kliem

  • Status changed from needs_review to positive_review

Thank you.

comment:14 Changed 10 months ago by vbraun

  • Branch changed from public/29964 to 2995c477d7c9eabc2744636e601427312d321d07
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.