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

Random doctest failure in structure/coerce_actions.pyx #35973

Closed
2 tasks done
jhpalmieri opened this issue Jul 20, 2023 · 1 comment · Fixed by #36789
Closed
2 tasks done

Random doctest failure in structure/coerce_actions.pyx #35973

jhpalmieri opened this issue Jul 20, 2023 · 1 comment · Fixed by #36789
Labels
Milestone

Comments

@jhpalmieri
Copy link
Member

Steps To Reproduce

OS X 13.4.1 on Apple M1. ./sage -t --long src/sage/structure/coerce_actions.pyx typically passes, but with a specific random seed, I get failures:

./sage -t --long --random-seed=59996678553091503109319269785176095170 src/sage/structure/coerce_actions.pyx

fails as described below.

Expected Behavior

Doctests should pass.

Actual Behavior

./sage -t --long --random-seed=59996678553091503109319269785176095170 src/sage/structure/coerce_actions.pyx

fails:

**********************************************************************
File "src/sage/structure/coerce_actions.pyx", line 777, in sage.structure.coerce_actions.IntegerMulAction._act_
Failed example:
    alarm(0.001); 2^(10^7) * P
Expected:
    Traceback (most recent call last):
    ...
    AlarmInterrupt
Got:
    (0 : 1 : 0)
**********************************************************************
File "src/sage/structure/coerce_actions.pyx", line 785, in sage.structure.coerce_actions.IntegerMulAction._act_
Failed example:
    from cysignals.tests import print_sig_occurred
Exception raised:
    Traceback (most recent call last):
      File "/Users/jpalmier/Desktop/Sage/TESTING/sage-10.1.beta6/src/sage/doctest/forker.py", line 696, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/Users/jpalmier/Desktop/Sage/TESTING/sage-10.1.beta6/src/sage/doctest/forker.py", line 1106, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.structure.coerce_actions.IntegerMulAction._act_[12]>", line 1, in <module>
        from cysignals.tests import print_sig_occurred
      File "<frozen importlib._bootstrap>", line 405, in parent
      File "src/cysignals/signals.pyx", line 310, in cysignals.signals.python_check_interrupt
    cysignals.signals.AlarmInterrupt
**********************************************************************
File "src/sage/structure/coerce_actions.pyx", line 786, in sage.structure.coerce_actions.IntegerMulAction._act_
Failed example:
    print_sig_occurred()
Exception raised:
    Traceback (most recent call last):
      File "/Users/jpalmier/Desktop/Sage/TESTING/sage-10.1.beta6/src/sage/doctest/forker.py", line 696, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/Users/jpalmier/Desktop/Sage/TESTING/sage-10.1.beta6/src/sage/doctest/forker.py", line 1106, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.structure.coerce_actions.IntegerMulAction._act_[13]>", line 1, in <module>
        print_sig_occurred()
        ^^^^^^^^^^^^^^^^^^
    NameError: name 'print_sig_occurred' is not defined
**********************************************************************
1 item had failures:
   3 of  15 in sage.structure.coerce_actions.IntegerMulAction._act_
    [150 tests, 3 failures, 0.10 s]
----------------------------------------------------------------------
sage -t --long --warn-long 32.2 --random-seed=59996678553091503109319269785176095170 src/sage/structure/coerce_actions.pyx  # 3 doctests failed

Additional Information

No response

Environment

- **OS**: Mac OS 13.4.1, Apple M1 Max chip
- **Sage Version**: 10.1.beta6, built with `./configure --with-system-singular=no`, otherwise using as many Homebrew packages as possible.

Checklist

  • I have searched the existing issues for a bug report that matches the one I want to file, without success.
  • I have read the documentation and troubleshoot guide
@jhpalmieri
Copy link
Member Author

If others can confirm the failure, this is an instance of #32544.

vbraun pushed a commit to vbraun/sage that referenced this issue Jan 2, 2024
…s.pyx

    
A doctest in coerce_actions.pyx tests whether "large multiplications can
be interrupted". Depending on the random input and on the speed of the
machine, that multiplication can happen too fast, and then the interrupt
doesn't happen in time. So let's make the multiplication take longer.

<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes sagemath#1234" use "Introduce new method to
calculate 1+1"
-->

This should fix sagemath#35973.

In some testing: this multiplication uses `P = E.random_element()` where
`E` is some elliptic curve. If this happens to be `(0:1:0)`, then on at
least one machine, the multiplication is completed too quickly. We could
reject that particular point, or we can increase the multiplication by a
factor of 10. This PR uses the second approach.

<!-- Describe your changes here in detail -->

<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [X] The title is concise, informative, and self-explanatory.
- [X] The description explains in detail what this PR is about.
- [X] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#36789
Reported by: John H. Palmieri
Reviewer(s):
vbraun pushed a commit to vbraun/sage that referenced this issue Jan 5, 2024
…s.pyx

    
A doctest in coerce_actions.pyx tests whether "large multiplications can
be interrupted". Depending on the random input and on the speed of the
machine, that multiplication can happen too fast, and then the interrupt
doesn't happen in time. So let's make the multiplication take longer.

<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes sagemath#1234" use "Introduce new method to
calculate 1+1"
-->

This should fix sagemath#35973.

In some testing: this multiplication uses `P = E.random_element()` where
`E` is some elliptic curve. If this happens to be `(0:1:0)`, then on at
least one machine, the multiplication is completed too quickly. We could
reject that particular point, or we can increase the multiplication by a
factor of 10. This PR uses the second approach.

<!-- Describe your changes here in detail -->

<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [X] The title is concise, informative, and self-explanatory.
- [X] The description explains in detail what this PR is about.
- [X] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#36789
Reported by: John H. Palmieri
Reviewer(s):
@vbraun vbraun closed this as completed in 3e8006f Jan 14, 2024
@mkoeppe mkoeppe added this to the sage-10.3 milestone Jan 14, 2024
@mantepse mantepse mentioned this issue May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants