Skip to content
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

Optimizations in GeneralizedMorphismsForCAP probably do not fulfill the specifications #1669

Open
zickgraf opened this issue Sep 11, 2024 · 0 comments

Comments

@zickgraf
Copy link
Member

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.

zickgraf added a commit to zickgraf/CAP_project that referenced this issue Sep 11, 2024
to avoid timeouts in tests in CategoricalTowers

The optimizations probably do not fulfill the specification
"equal input gives equal output",
see homalg-project#1669
zickgraf added a commit to zickgraf/CAP_project that referenced this issue Sep 11, 2024
to avoid timeouts in tests in CategoricalTowers

The optimizations probably do not fulfill the specification
"equal input gives equal output",
see homalg-project#1669
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant