-
Notifications
You must be signed in to change notification settings - Fork 161
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
Test failures due to method re-ordering #2818
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Re IsAmeanable: yes, I also consider this as a bug, which is why I reported it as such to the |
Resolves part of gap-system#2818
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Alll remaining issues seems to be related to semigroups related, so perhaps @wilfwilson and @james-d-mitchell can help. Specifically, after
|
The source of the first error is this method in semirel.gi:
If
This still works if |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Did fresh pull from master and installed packages-master.tar.gz. All four above reproducible by loading all packages and reading |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
The semidirect product method issue listed under #2818 (comment) still needs to be resolved. I just looked at that; it is caused by the rank of The rank of To track down which packages are at fault, I used this GAP script: pkgs := RecNames( GAPInfo.PackagesInfo );;
check:=function()
Assert(0, RankFilter(IsGroupHomomorphism) < RankFilter(IsGroupHomomorphism and IsNearAdditiveElement));
Assert(0, RankFilter(IsGroup and IsFinite) < RankFilter(IsGroup and IsFinite and IsComponentObjectRep));
end;
check();
for pkg in pkgs do
#if pkg in ["xmod", "guava"] then continue; fi;
Print("Loading ", pkg, "\n");
LoadPackage(pkg);
check();
od; Turns out the first issue is caused by InstallTrueMethod(IsEnumerableSemigroupRep, IsGroup and IsFinite); Pining @james-d-mitchell @wilfwilson The second issue is caused by InstallTrueMethod( IsNearRingElement, IsMapping );
InstallTrueMethod( IsNearAdditiveElementWithInverse, IsGeneralMapping ); |
"Fixing" those two issues in a hackish way (i.e. just removing the |
Sorry, I had a copy&paste mistake in my post above regarding the faulty line in semigroups; I fixed it there now, but to avoid confusion for people who read the email notifications, this is the actual "bad" line: InstallTrueMethod(IsEnumerableSemigroupRep, IsGroup and IsFinite); There are more similar issues, though, e.g. these are also bad:
and probably all involving |
Thanks for the information @fingolfin, and for creating the Semigroups package issue. |
Concerning the latest examples of bad implications: |
@ThomasBreuer I agree! In fact, to locate the offending |
@fingolfin I will prepare a pull request for the new feature that no implications to representation filters are allowed. UPDATE: Thomas submitted PR #3006 |
#2977 helped a lot to the core system tests when they are run with all packages loaded. However, there are still some packages that had runnable tests before method reordering but failing tests now. They can be seen at https://travis-ci.org/gap-system/gap-docker-pkg-tests-master (I deliberately did not transfer them to the staging tests, to make that visible). |
This comment has been minimized.
This comment has been minimized.
Status update: I have moved all packages with failing tests in the GAP master branch to the staging build - see commit message under https://github.com/gap-system/gap-docker-pkg-tests-master/commit/08d5b9778bba5534b6bd67c2fb9b0db2dc31b581 for the list of 10 packages and links to individual commit messages with further details. Half of these seem to be caused by other problems and not by method reordering. However, automgrp, grpconst, polycyclic, RCWA and possibly profiling are impacted. |
This comment has been minimized.
This comment has been minimized.
Resolves part of gap-system#2818
I went through this issue and hid a lot of comments which seemed to be resolved or otherwise outdated, so that the stuff that still needs work stands out. As far as I could determine, we are in good shape, only a few things are left:
|
[ ping to @alex-konovalov @stevelinton @frankluebeck @ThomasBreuer @ChrisJefferson @markuspf ]
Having merged PR #2773, which updates the ordering of messages as new implications are added (fixing various issues, see issue #2513), we now are seeing a lot of test failures after
LoadAllPackages()
.Some of them are fixed by PR #2815, but by far not all. The ones I looked at so far all follow the same pattern: two methods A, B in the GAP library where A used to be ranked above B reverse order when all packages are loaded, due to changes in the relative ranking of their involved filters.
In some cases, there already was a static rank adjustment, i.e., by a fixed number, applied in the library; but that change becomes insufficient if one filter increases massively when all packages are loaded, the other are not.
Example 1:
Explanation for example 1: Before loading all packages, this
ViewObj
method is used fromcoll.gi:528
:Note the manual rank increase by 20. After loading all packages, this method is used instead:
Yet in a fresh GAP session, started with
gap -A
, we observe this:Oops. So the meager static rank adjustment by 20 is not enough. We'd have to use at least 133 instead. But of course that won't work, unless one adds more packages.
A quick fix for this is the following: since we always want to prefer the
IsEnumeratorByFunctions
if it is applicable, we could use this dynamic rank adjustment instead:{} -> RankFilter(IsList and IsFinite)
.This works, but it leaves me a bit uneasy: for example, the
PrintObj
method forIsEnumeratorByFunctions
has no rank adjustment, static or dynamic, and it doesn't need one. But it might need one if somebody ever adds aPrintObj
for, say,IsList and IsFinite
. I.e., a non-local change could break that code; there is no way to code defensively to prevent this using a simple low static or dynamic rank adjustment.So perhaps a better fix is to use
SUM_FLAGS
here as rank adjustment (strictly speaking, that's still a static rank adjustment, but for practical purposes works fine). After all, we wan these ViewObj and PrintObj methods applied to allIsEnumeratorByFunctions
objects (which, after all, have built-in hooks for setting customViewObj
andPrintObj
functions). And even if somebody wanted to install a custom method for theirIsEnumeratorByFunctions and IsFOOBAR
objects, they can do it, as long as they also setSUM_FLAGS
as rank adjustment.A totally different angle to view this problem is to wonder why did the rank of
IsFinite and IsList
increase so much? Most of it comes fromIsFinite
, indeed,RankFilter(IsFinite) = 136
after all packages are loaded.That's because tons of packages add implications to
IsFinite
, and at least in some cases, I'd argue they are wrong or at least problematic. But there are certainly many legitimate ones...And then of course there are countless hidden implications which nevertheless affect the ranking (see issue #2336). So in the end, we can't completely fight this...
But in this particular case, the big jump in rank is due to a single implications, set by the
automgrp
package. It does this:DeclareProperty("IsAmenable", IsTreeAutomorphismGroup); InstallTrueMethod(IsAmenable, IsAbelian); InstallTrueMethod(IsAmenable, IsFinite);
So now
IsFinite
impliesIsAmenable
and that in turn has an hidden implication toIsTreeAutomorphismGroup
, hence toIsGroup
. If I change the above lines to.. then I get
RankFilter(IsList and IsFinite) = 6
, which is still less thanRankFilter(IsEnumeratorByFunctions) = 7
, so example 1 is fixed.But of course this is a fragile fix (and not completely under our control, although I'll contact the AutomGrp authors).
I'll add more examples if I find time, but for now I can already say that we'll have to change something, in the GAP library and in packages:
SUM_FLAGS
for some methods; very loosely said: we'll want that if the filter involves a representation (e.g. in example 1,IsEnumeratorByFunctions
is an and-filter that hasIsEnumeratorByFunctionsRep
amongst it constituents). Perhaps we'd even want to rank representations higher than 1 by default???The text was updated successfully, but these errors were encountered: