-
Notifications
You must be signed in to change notification settings - Fork 165
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
Hidden implication cache gets corrupted, breaks method reordering #3058
Comments
Justa very quick thought based on your last paragraph. If you break chains and then insert new entries, you can restore the chains in ways you may not expect or want. |
Yes, and I even experimented with a patch where instead of zeroing "deleted" entries, I replaced the key with a dummy value ( So breaking chains at worst should cause some entries to appear twice in the table, but only valid ones. So the other idea is that perhaps we call |
This issue is IMHO a blocker for GAP 4.11. We must either resolve it, or remove / disable the method reordering. |
I agree. Unfortunately I don't think I have the necessary skills to help to resolve the problem. |
@fingolfin Do you have instructions to reproduce this? For me with current master and a fairly recent set of packages I can't reproduce it. |
I wasn't able to reproduce this again recently, so perhaps it was a fluke?!? I am closing this for now, and will reopen should I manage to trigger it again. |
The method reordering code we merged for GAP 4.11 caused all kinds of new test failures (see issue #2818 and PR #2835 among others), most of them caused by actual bugs that slipped through our radar for years. One of the last remaining ones looks like this in the test logs, after using
LoadAllPackages()
:Note that this issue does not always occur! E.g. for PR #2835, it appears in the 32bit build, but not the 64 bit build. On my computer, in 64bit builds, I can sometimes reproduce it and sometimes not. I have not yet determined a pattern telling me when and why, though :-/.
Anyway, after managing to successfully reproduce it often enough, further analysis showed that this is already triggered by
DihedralGroup(IsFpGroup,24)
, which in turn leads toIrreducibleModules
being invoked. For that operation, there are two different methods, and the wrong one was called... And that despite the correct one actually having higher rank.Further inspection revealed that the two methods were ordered incorrectly. Indeed, one can fix the problem by asking GAP to reorder methods again after
LoadAllPackages()
(which also reorders methods):Going further, I determined that the method reordering code is fine; the problem seems to be in the handling of hidden implication, esp. the
WITH_HIDDEN_IMPS_FLAGS_CACHE
. To get to that conclusion, I first applied this patch to GAP as a kind of "breakpoint" whenever it sorted those methods:Now when starting GAP, and when loading package, one is thrown onto a break loop:
A simple fix is to change
CLEAR_HIDDEN_IMP_CACHE
to always clear the whole cache. That resolves the issue in my tests. But I have not yet really understood why this is -- and that concerns me, I don't like fixes that I don't fully understand.One thing I did notice is that strictly speaking,
CLEAR_HIDDEN_IMP_CACHE
right now is not quite correct for a hash table with open addressing: By replacing entries with NULL, it can break the "chains" used by open addressing. But that should only lead to entries getting "lost" in the hash table, not to bad values getting inserted. So I don't quite see how this should cause the issue at hand.Anybody got any ideas? In particular people familia with this code, such as @frankluebeck , @ThomasBreuer , @stevelinton ?
The text was updated successfully, but these errors were encountered: