Commit 30c3116
Release Manager
sagemathgh-39153: Mark several tests as random to avoid test failure
This fails sometimes in e.g. https://github.com/sagemath/sage/actions/ru
ns/12388661556/job/34580166155?pr=39152#step:10:9714
Marking this as random looks reasonable because one of the test above
(specifying the exact embedding) is also marked as random, and if the
embedding is random then of course the element representation in terms
of the generator `a` should also be random.
More context:
* the first `# random` is added first in https://github.com/sagemath/sag
e/commit/37fc8e88689a0197c5513161b85b8bbadd5630ab#diff-
c63508ebde0716605e6cdac05e43c8945616c2245158d30ff5ae39936ff4d9a0R1892
* then the note that `number_field_elements_from_algebraics` is OS-
dependent ("32 versus 64 bit") is removed at https://github.com/sagemath
/sage/commit/61e4df9fabf9e06a21d75eb6320ab3179bc28096 for reasons I
can't figure out. (how to find out the discussion around a commit? it
was before trac to GitHub migration)
------
Should the entry in `/.github/workflows/ci-conda-known-test-
failures.json` be removed?
```
"sage.rings.qqbar": {
"failed": "unreported failure on macOS seen in https://github.co
m/sagemath/sage/actions/runs/9525536510/job/26259809272?pr=37998"
},
```
### 📝 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 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: ... -->
------
Other failing tests:
```
TESTS:
Number fields defined by non-monic and non-integral
polynomials are supported (:issue:`252`)::
sage: K.<a> = NumberField(2*x^4 + 6*x^2 + 1/2)
sage: K.optimized_subfields()
[
(Number Field in a0 with defining polynomial x, Ring morphism:
From: Number Field in a0 with defining polynomial x
To: Number Field in a with defining polynomial 2*x^4 + 6*x^2 +
1/2
Defn: 0 |--> 0, None),
(Number Field in a1 with defining polynomial x^2 - 2*x + 2, Ring
morphism:
From: Number Field in a1 with defining polynomial x^2 - 2*x + 2
To: Number Field in a with defining polynomial 2*x^4 + 6*x^2 +
1/2
Defn: a1 |--> a^3 + 7/2*a + 1, None),
(Number Field in a2 with defining polynomial x^2 - 2*x + 2, Ring
morphism:
From: Number Field in a2 with defining polynomial x^2 - 2*x + 2
To: Number Field in a with defining polynomial 2*x^4 + 6*x^2 +
1/2
Defn: a2 |--> -a^3 - 7/2*a + 1, None),
(Number Field in a3 with defining polynomial x^2 - 2, Ring morphism:
From: Number Field in a3 with defining polynomial x^2 - 2
To: Number Field in a with defining polynomial 2*x^4 + 6*x^2 +
1/2
Defn: a3 |--> a^2 + 3/2, None),
(Number Field in a4 with defining polynomial x^2 + 1, Ring morphism:
From: Number Field in a4 with defining polynomial x^2 + 1
To: Number Field in a with defining polynomial 2*x^4 + 6*x^2 +
1/2
Defn: a4 |--> a^3 + 7/2*a, None),
(Number Field in a5 with defining polynomial x^2 + 2, Ring morphism:
From: Number Field in a5 with defining polynomial x^2 + 2
To: Number Field in a with defining polynomial 2*x^4 + 6*x^2 +
1/2
Defn: a5 |--> 2*a^3 + 5*a, None),
(Number Field in a6 with defining polynomial x^4 + 1, Ring morphism:
From: Number Field in a6 with defining polynomial x^4 + 1
To: Number Field in a with defining polynomial 2*x^4 + 6*x^2 +
1/2
Defn: a6 |--> a^3 + 1/2*a^2 + 5/2*a + 3/4, Ring morphism:
From: Number Field in a with defining polynomial 2*x^4 + 6*x^2 +
1/2
To: Number Field in a6 with defining polynomial x^4 + 1
Defn: a |--> -1/2*a6^3 + a6^2 - 1/2*a6)
]
```
I look into what determines the ordering.
It uses `_subfields_helper` which uses either `f.polred(2)` or
`f.nfsubfields(degree)`,
and there's no sorting going on.
Conclusion: marking as `random sort order` is fine. In fact it doesn't
even say which subfields
should be returned exactly, and other tests in that function are marked
as `# random` anyway,
so marking as `# random` is fine.
------
```
2024-12-18T08:35:49.0399180Z File
"src/sage/rings/number_field/number_field.py", line 8777, in
sage.rings.number_field.number_field.NumberField_absolute.subfields
2024-12-18T08:35:49.0500510Z Failed example:
2024-12-18T08:35:49.0601390Z K.subfields()
2024-12-18T08:35:49.0707380Z Expected:
2024-12-18T08:35:49.0829700Z [
2024-12-18T08:35:49.1013090Z (Number Field in a0 with defining
polynomial x, Ring morphism:
2024-12-18T08:35:49.1114120Z From: Number Field in a0 with
defining polynomial x
2024-12-18T08:35:49.1215190Z To: Number Field in a with defining
polynomial 2*x^4 + 6*x^2 + 1/2
2024-12-18T08:35:49.1319910Z Defn: 0 |--> 0, None),
2024-12-18T08:35:49.1426370Z (Number Field in a1 with defining
polynomial x^2 - 2, Ring morphism:
2024-12-18T08:35:49.1528730Z From: Number Field in a1 with
defining polynomial x^2 - 2
2024-12-18T08:35:49.1631010Z To: Number Field in a with defining
polynomial 2*x^4 + 6*x^2 + 1/2
2024-12-18T08:35:49.1659980Z Defn: a1 |--> a^2 + 3/2, None),
2024-12-18T08:35:49.1761220Z (Number Field in a2 with defining
polynomial x^2 + 4, Ring morphism:
2024-12-18T08:35:49.1862420Z From: Number Field in a2 with
defining polynomial x^2 + 4
2024-12-18T08:35:49.1970640Z To: Number Field in a with defining
polynomial 2*x^4 + 6*x^2 + 1/2
2024-12-18T08:35:49.2072220Z Defn: a2 |--> 2*a^3 + 7*a, None),
2024-12-18T08:35:49.2173950Z (Number Field in a3 with defining
polynomial x^2 + 2, Ring morphism:
2024-12-18T08:35:49.2275370Z From: Number Field in a3 with
defining polynomial x^2 + 2
2024-12-18T08:35:49.2368240Z To: Number Field in a with defining
polynomial 2*x^4 + 6*x^2 + 1/2
2024-12-18T08:35:49.2476650Z Defn: a3 |--> 2*a^3 + 5*a, None),
2024-12-18T08:35:49.2570570Z (Number Field in a4 with defining
polynomial x^4 + 1, Ring morphism:
2024-12-18T08:35:49.2672100Z From: Number Field in a4 with
defining polynomial x^4 + 1
2024-12-18T08:35:49.2774030Z To: Number Field in a with defining
polynomial 2*x^4 + 6*x^2 + 1/2
2024-12-18T08:35:49.2875400Z Defn: a4 |--> a^3 + 1/2*a^2 + 5/2*a +
3/4, Ring morphism:
2024-12-18T08:35:49.2977450Z From: Number Field in a with defining
polynomial 2*x^4 + 6*x^2 + 1/2
2024-12-18T08:35:49.3080080Z To: Number Field in a4 with
defining polynomial x^4 + 1
2024-12-18T08:35:49.3179890Z Defn: a |--> -1/2*a4^3 + a4^2 -
1/2*a4)
2024-12-18T08:35:49.3281410Z ]
2024-12-18T08:35:49.3382370Z Got:
2024-12-18T08:35:49.3483260Z [
2024-12-18T08:35:49.3584610Z (Number Field in a0 with defining
polynomial x, Ring morphism:
2024-12-18T08:35:49.3643330Z From: Number Field in a0 with
defining polynomial x
2024-12-18T08:35:49.3714430Z To: Number Field in a with defining
polynomial 2*x^4 + 6*x^2 + 1/2
2024-12-18T08:35:49.3816090Z Defn: 0 |--> 0, None),
2024-12-18T08:35:49.3923670Z (Number Field in a1 with defining
polynomial x^2 - 2, Ring morphism:
2024-12-18T08:35:49.4037810Z From: Number Field in a1 with
defining polynomial x^2 - 2
2024-12-18T08:35:49.4142230Z To: Number Field in a with defining
polynomial 2*x^4 + 6*x^2 + 1/2
2024-12-18T08:35:49.4289560Z Defn: a1 |--> -a^2 - 3/2, None),
2024-12-18T08:35:49.4391330Z (Number Field in a2 with defining
polynomial x^2 + 4, Ring morphism:
2024-12-18T08:35:49.4492300Z From: Number Field in a2 with
defining polynomial x^2 + 4
2024-12-18T08:35:49.4602960Z To: Number Field in a with defining
polynomial 2*x^4 + 6*x^2 + 1/2
2024-12-18T08:35:49.4705310Z Defn: a2 |--> -2*a^3 - 7*a, None),
2024-12-18T08:35:49.4793770Z (Number Field in a3 with defining
polynomial x^2 + 2, Ring morphism:
2024-12-18T08:35:49.4794540Z From: Number Field in a3 with
defining polynomial x^2 + 2
2024-12-18T08:35:49.4795030Z To: Number Field in a with defining
polynomial 2*x^4 + 6*x^2 + 1/2
2024-12-18T08:35:49.4795830Z Defn: a3 |--> 2*a^3 + 5*a, None),
2024-12-18T08:35:49.4796320Z (Number Field in a4 with defining
polynomial x^4 + 1, Ring morphism:
2024-12-18T08:35:49.4796780Z From: Number Field in a4 with
defining polynomial x^4 + 1
2024-12-18T08:35:49.4797230Z To: Number Field in a with defining
polynomial 2*x^4 + 6*x^2 + 1/2
2024-12-18T08:35:49.4797760Z Defn: a4 |--> a^3 - 1/2*a^2 + 5/2*a -
3/4, Ring morphism:
2024-12-18T08:35:49.4798180Z From: Number Field in a with defining
polynomial 2*x^4 + 6*x^2 + 1/2
2024-12-18T08:35:49.4852940Z To: Number Field in a4 with
defining polynomial x^4 + 1
2024-12-18T08:35:49.4987040Z Defn: a |--> -1/2*a4^3 - a4^2 -
1/2*a4)
2024-12-18T08:35:49.5088200Z ]
```
Uses https://pari.math.u-
bordeaux.fr/dochtml/html/General_number_fields.html#se:nfsubfields
internally. It doesn't state any resulting sort order, so I just reorder
them (the discriminants are all distincts so it's fine).
Alternatively it looks like just doctest against the `set()` of it might
work.
------
URL: sagemath#39153
Reported by: user202729
Reviewer(s): Tobias Diez
2 files changed
+15
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8656 | 8656 | | |
8657 | 8657 | | |
8658 | 8658 | | |
8659 | | - | |
| 8659 | + | |
8660 | 8660 | | |
8661 | 8661 | | |
8662 | 8662 | | |
| |||
8780 | 8780 | | |
8781 | 8781 | | |
8782 | 8782 | | |
8783 | | - | |
8784 | | - | |
| 8783 | + | |
| 8784 | + | |
8785 | 8785 | | |
8786 | | - | |
8787 | | - | |
8788 | | - | |
8789 | | - | |
8790 | | - | |
8791 | | - | |
8792 | | - | |
| 8786 | + | |
8793 | 8787 | | |
8794 | | - | |
| 8788 | + | |
8795 | 8789 | | |
8796 | 8790 | | |
8797 | 8791 | | |
8798 | 8792 | | |
8799 | 8793 | | |
8800 | 8794 | | |
8801 | 8795 | | |
8802 | | - | |
| 8796 | + | |
8803 | 8797 | | |
8804 | | - | |
| 8798 | + | |
8805 | 8799 | | |
8806 | | - | |
| 8800 | + | |
| 8801 | + | |
| 8802 | + | |
| 8803 | + | |
| 8804 | + | |
| 8805 | + | |
| 8806 | + | |
8807 | 8807 | | |
8808 | 8808 | | |
8809 | 8809 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2711 | 2711 | | |
2712 | 2712 | | |
2713 | 2713 | | |
2714 | | - | |
| 2714 | + | |
2715 | 2715 | | |
2716 | 2716 | | |
2717 | 2717 | | |
| |||
0 commit comments