Skip to content

Fix doctests related to singular: make them compatible with newer releases of Singular.#41624

Merged
vbraun merged 2 commits intosagemath:developfrom
jhpalmieri:singular-doctests
Feb 25, 2026
Merged

Fix doctests related to singular: make them compatible with newer releases of Singular.#41624
vbraun merged 2 commits intosagemath:developfrom
jhpalmieri:singular-doctests

Conversation

@jhpalmieri
Copy link
Copy Markdown
Member

Singular doctests: make compatible with new versions of Singular

New versions of Singular, at least on OS X via homebrew, lead to doctest failures: see #40873. This addresses most of those failures.

  • In the sandpiles code, it can now handle trailing zeros which may or may not be included in resolutions; this fix is very similar to what was done in fix is_free method for new version Singular #41138.
  • In algebraic_scheme.py, the doctest now will not depend on which particular scalar multiples of a polynomial are used to define an ideal, etc.
  • In singular/function.pyx, the previous test now no longer produces an error with some versions of Singular, so it is no longer testing what it was intended to. We delete this doctest.
  • Various other doctests have been modified to be compatible with both old and new versions.

This will fix all but one of the failures in #40873; the failure in sage/schemes/curves/affine_curve.py remains.

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation and checked the documentation preview.

⌛ Dependencies

@dimpase
Copy link
Copy Markdown
Member

dimpase commented Feb 11, 2026

works for me on Intel macOS

@dimpase
Copy link
Copy Markdown
Member

dimpase commented Feb 11, 2026

let's see how it goes on the CI

@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 11, 2026

Documentation preview for this PR (built with commit fd08f92; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

@cxzhong cxzhong added the p: CI fix merged before running CI tests label Feb 15, 2026
vbraun pushed a commit to vbraun/sage that referenced this pull request Feb 16, 2026
sagemathgh-41624: Fix doctests related to singular: make them compatible with newer releases of Singular.
    
Singular doctests: make compatible with new versions of Singular

<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

New versions of Singular, at least on OS X via homebrew, lead to doctest
failures: see sagemath#40873. This addresses most of those failures.

- In the sandpiles code, it can now handle trailing zeros which may or
may not be included in resolutions; this fix is very similar to what was
done in sagemath#41138.
- In algebraic_scheme.py, the doctest now will not depend on which
particular scalar multiples of a polynomial are used to define an ideal,
etc.
- In `singular/function.pyx`, the previous test now no longer produces
an error with some versions of Singular, so it is no longer testing what
it was intended to. We delete this doctest.
- Various other doctests have been modified to be compatible with both
old and new versions.

This will fix all but one of the failures in sagemath#40873; the failure in
`sage/schemes/curves/affine_curve.py` remains.

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [X] The title is concise and informative.
- [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 and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#41624
Reported by: John H. Palmieri
Reviewer(s): Chenxin Zhong, Dima Pasechnik
vbraun pushed a commit to vbraun/sage that referenced this pull request Feb 20, 2026
sagemathgh-41624: Fix doctests related to singular: make them compatible with newer releases of Singular.
    
Singular doctests: make compatible with new versions of Singular

<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

New versions of Singular, at least on OS X via homebrew, lead to doctest
failures: see sagemath#40873. This addresses most of those failures.

- In the sandpiles code, it can now handle trailing zeros which may or
may not be included in resolutions; this fix is very similar to what was
done in sagemath#41138.
- In algebraic_scheme.py, the doctest now will not depend on which
particular scalar multiples of a polynomial are used to define an ideal,
etc.
- In `singular/function.pyx`, the previous test now no longer produces
an error with some versions of Singular, so it is no longer testing what
it was intended to. We delete this doctest.
- Various other doctests have been modified to be compatible with both
old and new versions.

This will fix all but one of the failures in sagemath#40873; the failure in
`sage/schemes/curves/affine_curve.py` remains.

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [X] The title is concise and informative.
- [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 and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#41624
Reported by: John H. Palmieri
Reviewer(s): Chenxin Zhong, Dima Pasechnik
@vbraun vbraun merged commit d0928a9 into sagemath:develop Feb 25, 2026
25 of 26 checks passed
@antonio-rojas
Copy link
Copy Markdown
Member

Which version of singular did this target? I'm getting many other failures with 4.4.1.p5, including some segfaults

python3 -m sage.doctest --long /usr/lib/python3.14/site-packages/sage/schemes/curves/affine_curve.py  # 2 doctests failed
python3 -m sage.doctest --long /usr/lib/python3.14/site-packages/sage/rings/polynomial/multi_polynomial_libsingular.pyx  # 4 doctests failed
python3 -m sage.doctest --long /usr/lib/python3.14/site-packages/sage/rings/polynomial/polynomial_element.pyx  # SignalError in doctesting framework
python3 -m sage.doctest --long /usr/lib/python3.14/site-packages/sage/rings/polynomial/multi_polynomial_ideal.py  # SignalError in doctesting framework
python3 -m sage.doctest --long /usr/lib/python3.14/site-packages/sage/rings/tate_algebra_ideal.pyx  # 1 doctest failed
python3 -m sage.doctest --long /usr/lib/python3.14/site-packages/sage/libs/singular/ring.pyx  # 3 doctests failed
python3 -m sage.doctest --long /usr/lib/python3.14/site-packages/sage/rings/polynomial/polynomial_singular_interface.py  # 1 doctest failed
python3 -m sage.doctest --long /usr/lib/python3.14/site-packages/sage/schemes/elliptic_curves/addition_formulas_ring.py  # SignalError in doctesting framework

@dimpase
Copy link
Copy Markdown
Member

dimpase commented Mar 10, 2026

segfaults appear to indicate that your version of Singular has problems

@antonio-rojas
Copy link
Copy Markdown
Member

Yes, that's why I asked which version was this tested with. It turns out 4.4.1.p5 causes segfaults, which are fixed upstream in Singular/Singular@56681f1

The other failures seem less severe, will follow up in another PR.

@cxzhong
Copy link
Copy Markdown
Contributor

cxzhong commented Mar 11, 2026

Yes, that's why I asked which version was this tested with. It turns out 4.4.1.p5 causes segfaults, which are fixed upstream in Singular/Singular@56681f1

The other failures seem less severe, will follow up in another PR.

may let them to release a new version

@antonio-rojas
Copy link
Copy Markdown
Member

Yes, that's why I asked which version was this tested with. It turns out 4.4.1.p5 causes segfaults, which are fixed upstream in Singular/Singular@56681f1

The other failures seem less severe, will follow up in another PR.

Looks like another upstream bug, reported at Singular/Singular#1334

antonio-rojas added a commit to antonio-rojas/sage that referenced this pull request Mar 12, 2026
Follow up to sagemath#41624, fixes the remaining issues
@antonio-rojas
Copy link
Copy Markdown
Member

Opened #41798 to fix the remaining issues on the sage side

vbraun pushed a commit to vbraun/sage that referenced this pull request Mar 15, 2026
sagemathgh-41798: Fix test failures with singular 4.4.1.p5
    
Follow up to sagemath#41624, fixes the
remaining issues
    
URL: sagemath#41798
Reported by: Antonio Rojas
Reviewer(s): Chenxin Zhong
vbraun pushed a commit to vbraun/sage that referenced this pull request Mar 18, 2026
sagemathgh-41798: Fix test failures with singular 4.4.1.p5
    
Follow up to sagemath#41624, fixes the
remaining issues
    
URL: sagemath#41798
Reported by: Antonio Rojas
Reviewer(s): Chenxin Zhong
vbraun pushed a commit to vbraun/sage that referenced this pull request Mar 21, 2026
sagemathgh-41798: Fix test failures with singular 4.4.1.p5
    
Follow up to sagemath#41624, fixes the
remaining issues
    
URL: sagemath#41798
Reported by: Antonio Rojas
Reviewer(s): Chenxin Zhong
vbraun pushed a commit to vbraun/sage that referenced this pull request Mar 22, 2026
sagemathgh-41798: Fix test failures with singular 4.4.1.p5
    
Follow up to sagemath#41624, fixes the
remaining issues
    
URL: sagemath#41798
Reported by: Antonio Rojas
Reviewer(s): Chenxin Zhong
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p: CI fix merged before running CI tests p: major / 3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants