-
-
Notifications
You must be signed in to change notification settings - Fork 503
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
modules/fp_graded/morphism.py test failure #33794
Comments
comment:1
works fine for me on ubuntu 20.04:
|
comment:2
We can make this change, just to be on the safe side: diff --git a/src/sage/modules/fp_graded/steenrod/profile.py b/src/sage/modules/fp_graded/steenrod/profile.py
index 5dd91e1b26..0e30b4b413 100755
--- a/src/sage/modules/fp_graded/steenrod/profile.py
+++ b/src/sage/modules/fp_graded/steenrod/profile.py
@@ -79,7 +79,7 @@ def profile_elt(elt, char=2):
pass
if char == 2:
- minprofile = [max(0, n.exact_log(char) + 1) for n in elt]
+ minprofile = [max(0, ZZ(n).exact_log(char) + 1) for n in elt]
return find_min_profile(minprofile, char)
# odd primes:
|
Branch: u/jhpalmieri/trac33794 |
Commit: |
Author: John Palmieri |
New commits:
|
Reviewer: Travis Scrimshaw |
comment:5
My guess is that it is not machine dependent but order dependent on the doctests: Something is getting cached with an Anyways, for now, green bot => positive review. |
comment:6
It might be a sign of a deeper problem, but without more information, for example a repeatable failure, I have no idea how to diagnose it. |
comment:7
The initial failure happened on NixOS CI on builder that has 64 cores. I reproduced this on the first try locally (on x86_64) by running |
This comment has been minimized.
This comment has been minimized.
comment:8
Well, since I cannot reproduce the original error, I can only say that this definitely should fix it. Tests pass for me, so I am going to set a positive review. comment:7: Strange. Perhaps it is related to the number of cores somehow? That would be surprising to me. Do you get the failure when running it more locally, say, on this file or with the folder specifically? |
comment:9
comment:8: I unfortunately have no good way of reproducing this. Running the test suite just on the I noticed something while browsing the code: (A similar problem might affect the line |
comment:10
For what it's worth, def __getitem__(self, n, verbose=False):
print('hello')
return self.vector_presentation(n, verbose) and there was only one doctest failure when I tested
|
comment:11
Replying to @collares:
That makes it seem like it is some kind of caching issue with an
I don’t think it bypasses it, but this is easy to verify similar to John’s test in comment:10.
I don’t think that is relevant to the bugs at hand as I cannot see any relation. There could potentially be a separate issue with the caching not being done as it should, but that is a performance issue and not a true bug IMO. |
comment:12
You two are absolutely right, of course! Thanks for the explanation. Besides, making such a specific guess without having a way to reproduce the failure was clearly a bad idea. Fortunately, I now have a way to do reproduce the bug! Applying the following patch, the bug shows up every time when running diff --git a/src/sage/modules/fp_graded/steenrod/morphism.py b/src/sage/modules/fp_graded/steenrod/morphism.py
index d55b51faf4..b0cf86c587 100755
--- a/src/sage/modules/fp_graded/steenrod/morphism.py
+++ b/src/sage/modules/fp_graded/steenrod/morphism.py
@@ -82,11 +82,16 @@ class SteenrodFPModuleMorphism(FPModuleMorphism):
def _flatten(f):
return [c for value in f for c in value.dense_coefficient_list()]
+ import gc
+ n = gc.collect()
+
elements = (_flatten(self.domain().relations())
+ _flatten(self.codomain().relations())
+ _flatten(self.values()))
elements = [a for a in elements if a not in (0, 1)]
return enveloping_profile_elements(elements,
char=self.base_ring().characteristic())
diff --git a/src/sage/structure/unique_representation.py b/src/sage/structure/unique_representation.py
index 5d8d4ad758..4afccaec88 100644
--- a/src/sage/structure/unique_representation.py
+++ b/src/sage/structure/unique_representation.py
@@ -989,7 +989,7 @@ class CachedRepresentation(metaclass=ClasscallMetaclass):
:meth:`__init__<object.__init__>`.
"""
- @weak_cached_function(cache=128) # automatically a staticmethod
+ @weak_cached_function(cache=0) # automatically a staticmethod
def __classcall__(cls, *args, **options):
"""
Construct a new object of this class or reuse an existing one.
|
Changed branch from u/jhpalmieri/trac33794 to |
Happened when doctesting with
--long --all
and 64 threads, both on x86_64 and on aarch64. Possibly related to #30680.CC: @jhpalmieri @tscrim
Component: algebra
Author: John Palmieri
Branch/Commit:
0b48601
Reviewer: Travis Scrimshaw
Issue created by migration from https://trac.sagemath.org/ticket/33794
The text was updated successfully, but these errors were encountered: