Eliminate remaining 32- and 64-bit doctest output tags#41540
Merged
vbraun merged 17 commits intosagemath:developfrom Feb 11, 2026
Merged
Eliminate remaining 32- and 64-bit doctest output tags#41540vbraun merged 17 commits intosagemath:developfrom
vbraun merged 17 commits intosagemath:developfrom
Conversation
Rewrite one test that depends on the bitness of the machine to use the 32_bit feature tag rather than the non-standard output tags.
Rewrite one test in this file to use the 32_bit feature rather than the (nonstandard) bitness tags on the output.
We are testing two separate cases for the quotient x/y in a multivariate polynomial ring, but both answers are wrong. Rather than combine the two cases, I think we can stop testing this bug.
Move the bitness tags from the output to the input in one example that returns slightly different answers on 32- and 64-bit systems.
One test in this file has special cases for 32- and 64-bit systems, but is marked "# not tested" anyway. Since we are not testing it (it takes several minutes to run), we delete the test to avoid the need for special cases in the output.
Use "# needs 32_bit" on the input rather than "# 32-bit" on the output, as the latter is nonstandard.
Use the appropriate "needs" tag on the input line rather than tagging the output with the bitness (which is non-standard).
Tag the input with the bitness rather than the output; the latter is nonstandard.
The one example for arb_to_mpfi() has special cases for the machine bitness, but it's not a great example anyway. We first provide a better example (showing that we've actually converted arb something to mpfi something), and then rewrite the old example to tag the input with the bitness rather than the output.
There's a doctest in this file that overflows on both 32- and 64-bit systems with slightly different output, but we don't need to test that (differing) output. We can combine the two cases with ellipses.
One test in this file has special cases for the output on 32- and 64-bit systems, but I'm fairly sure that with two coefficients on the order of e-19 and an abs tol of 1e-14, the remaining coefficient of 0.759316500288427 is the only one tested -- and it's the same regardless of bitness.
Most of the 32- and 64-bit tags in these files are for outputs that can only be compared as strings anyway, because there's no easy way to input them literally. For those we replace the "32-bit" and "64-bit" tags on the output with "needs 32_bit" and "needs !32_bit" on the input. This is a little bit more standard.
Instead of recommending the 32-bit and 64-bit output tags (which are nonstandard), suggest the 32_bit feature.
Make one example follow the recommendation that follows it.
These will be removed shortly.
These have been excised from the sage library.
|
Documentation preview for this PR (built with commit 92afcf2; changes) is ready! 🎉 |
Contributor
Author
|
The tests look OK on CI, too, but I made a few non-trivial edits that need to be checked on a 32-bit system. |
cxzhong
approved these changes
Jan 28, 2026
Contributor
|
Can you check this also on 32-bit OS ? |
Contributor
Author
I don't have a 32-bit machine available but I've CCed two people who might. |
tobiasdiez
approved these changes
Jan 31, 2026
Contributor
tobiasdiez
left a comment
There was a problem hiding this comment.
Thanks, this is a nice idea! Volkers bots will test a 32bit system, so let's try this.
5 tasks
vbraun
pushed a commit
to vbraun/sage
that referenced
this pull request
Feb 5, 2026
sagemathgh-41540: Eliminate remaining 32- and 64-bit doctest output tags Our `# 32-bit` and `# 64bit` tags, namely that they must annotate the output lines and not the input line, are non-standard. We have replacements that work on the input lines in `# needs 32_bit` or `# needs !32_bit`, but in some cases we can handle both cases simultaneously (which is preferable, in my opinion). This PR replaces all uses of the old tags, updates the documentation to suggest `# needs 32_bit`, and removes support for the old tags from the doctest runner. The latter is a backwards-incompatible change, but it cannot break user code, only custom tests. If we were to make the old- style tags raise deprecation warnings, exactly the same tests would break, so it does not seem worthwhile to deprecate and remove later. This is a follow-up to sagemath#41468, and supersedes sagemath#40238. The tests pass for me on a 64-bit system, but I don't have a 32-bit one to try with. URL: sagemath#41540 Reported by: Michael Orlitzky Reviewer(s): Chenxin Zhong, Tobias Diez
vbraun
pushed a commit
to vbraun/sage
that referenced
this pull request
Feb 7, 2026
sagemathgh-41540: Eliminate remaining 32- and 64-bit doctest output tags Our `# 32-bit` and `# 64bit` tags, namely that they must annotate the output lines and not the input line, are non-standard. We have replacements that work on the input lines in `# needs 32_bit` or `# needs !32_bit`, but in some cases we can handle both cases simultaneously (which is preferable, in my opinion). This PR replaces all uses of the old tags, updates the documentation to suggest `# needs 32_bit`, and removes support for the old tags from the doctest runner. The latter is a backwards-incompatible change, but it cannot break user code, only custom tests. If we were to make the old- style tags raise deprecation warnings, exactly the same tests would break, so it does not seem worthwhile to deprecate and remove later. This is a follow-up to sagemath#41468, and supersedes sagemath#40238. The tests pass for me on a 64-bit system, but I don't have a 32-bit one to try with. URL: sagemath#41540 Reported by: Michael Orlitzky Reviewer(s): Chenxin Zhong, Tobias Diez
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Our
# 32-bitand# 64bittags, namely that they must annotate the output lines and not the input line, are non-standard. We have replacements that work on the input lines in# needs 32_bitor# needs !32_bit, but in some cases we can handle both cases simultaneously (which is preferable, in my opinion).This PR replaces all uses of the old tags, updates the documentation to suggest
# needs 32_bit, and removes support for the old tags from the doctest runner. The latter is a backwards-incompatible change, but it cannot break user code, only custom tests. If we were to make the old-style tags raise deprecation warnings, exactly the same tests would break, so it does not seem worthwhile to deprecate and remove later.This is a follow-up to #41468, and supersedes #40238.
The tests pass for me on a 64-bit system, but I don't have a 32-bit one to try with.