-
Notifications
You must be signed in to change notification settings - Fork 18
Description
The optimizations in GeneralizedMorphismsForCAP which I have removed in #1653 probably do not fulfill the specification "equal input gives equal output". Test:
LoadPackage( "LazyCategories" );
LoadPackage( "FreydCategoriesForCAP" );
QQ := HomalgFieldOfRationals( );
rows := CategoryOfRows( QQ );
L := LazyCategory( rows : optmize := 0 );
gen := GeneralizedMorphismCategoryByThreeArrows( L );
obj := 2 / rows / L;
mor := IdentityMorphism( obj );
mor_gen := AsGeneralizedMorphismByThreeArrows( mor );
# alternative:
# mor_gen := GeneralizedMorphismByThreeArrows( mor, mor, mor );
Display( Arrow( mor_gen ) );
Display( SourceAid( mor_gen ) );
Display( RangeAid( mor_gen ) );
# triggers evaluation
#Assert( 0, IsWellDefined( mor_gen ) );
comp := PreCompose( mor_gen, mor_gen );
Display( Arrow( comp ) );
Display( SourceAid( comp ) );
Display( RangeAid( comp ) );
One can check that both alternatives of mor_gen
are equal but the composition gives a different result in the alternative case due to the optimizations. The caches might still make this work somehow, but I'm not sure they actually guarantee the correctness and since we do not want to rely on caching for correctness anyway this is bad in any case.
Background: Without the optimizations, some tests in CategoricalTowers are significantly slower (e.g. SnakeInFreeAbelian.g
in FiniteCocompletions and all tests in Algebroids using GeneralizedMorphisms). To avoid long running tests and timeouts in the CI, I will reintroduce the optimizations. However, they should be removed at some point and possibly replaced by compiled code with good performance.