Opened 8 years ago
Last modified 5 weeks ago
#17010 new defect
Random failure in diagram algebras
Reported by: | vbraun | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | combinatorics | Keywords: | random_fail |
Cc: | SimonKing | Merged in: | |
Authors: | Reviewers: | ||
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
I've seen this more than once on the buildbot...
sage -t --long src/sage/combinat/diagram_algebras.py ********************************************************************** File "src/sage/combinat/diagram_algebras.py", line 696, in sage.combinat.diagram_algebras.SubPartitionAlgebra.__init__ Failed example: BA.ambient().has_coerce_map_from(BA) Expected: True Got: False **********************************************************************
Change History (7)
comment:1 Changed 8 years ago by
Cc: | SimonKing added |
---|
comment:2 Changed 8 years ago by
I suppose the problem comes from __init_extra__
, which for algebras is supposed to register the coercion from the base ring.
comment:3 Changed 8 years ago by
I found that we are in a rare case. This
try: has_custom_conversion = self.category().parent_class.from_base_ring.__func__ is not self.from_base_ring.__func__ except AttributeError: # Sometimes from_base_ring is a lazy attribute has_custom_conversion = True
ends up in "except AttributeError
". So, the question is if it is really the case here that from_base_ring
exists as lazy attribute, or the attribute error came from a different reason.
comment:5 Changed 8 years ago by
I'm thinking the problem is coming from line 700-1:
self.module_morphism(self.lift, codomain=amb, category=self.category()).register_as_coercion()
and is similar to what I posted on #16532, as a reference to the ambient partition algebra is not held by the subpartition algebra.
I'm thinking the easiest fix would be to actually just store a reference to the ambient algebra in the subpartition algebra. The best fix would probably be to add a _coerce_map_from_
in PartitionAlgebra
which checks if the parent is an instance of SubPartitionAlgebra
and returns the lift module morphism. Both fixes are easy, which do you think we should do?
comment:6 Changed 8 years ago by
I don't see how storing a reference to ambient is going to help, the call to has_coerce_map_from
in the ticket description already holds a reference to ambient (== self)
comment:7 Changed 5 weeks ago by
Milestone: | sage-6.4 |
---|
Something related to the coercion is getting garbage collected during the execution of the command. On my desktop (a fast computer with gobs of RAM) I always get the right answer. But if I use the trace hook to force run a garbage collection between each Python command:
then a) everything gets dog slow, about 5 mins for the lines below, and b) I get the wrong answer: