Skip to content

Optimizations in GeneralizedMorphismsForCAP probably do not fulfill the specifications #1669

@zickgraf

Description

@zickgraf

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions