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

Avoid new type readonly (was: #142) #291

Conversation

markuspf
Copy link
Member

This is a remake of #142 in which I deleted all commented out code and just return the result of NEW_TYPE in places.

The original PR has a comment about making the codepath (for NEW_TYPE I presume) even simpler. I am now looking at this too. I do suggest to merge this PR though and to close #142, because as far as I can see it already improves the situation.

After the cleanup of ZmodnZ in gap-system#147, this is the patch that remains.
@fingolfin
Copy link
Member

This patch, just like #142, changes the semantics of the type code, and I am not yet convinced this is safe. My questions on #142 were not addressed, and I am opposed to this being merged before somebody at least acknowledges what I pointed out.

Namely, if a type is cached, then with this patch, we return the cached type, WITHOUT verifying that its extended data entries match the "parent" data we pass in. I have not tried to actually do it, but it seems conceivable to me that one can artificially create a setup were this leads to a change in behavior with and without this patch applied.

But perhaps I am wrong, and this cannot occur, for reasons I missed. Or perhaps it can occur, but we somehow know this never occurs in "real world" scenarios. But I still feel that this then should be explicitly explained.

@ChrisJefferson
Copy link
Contributor

I agree with @fingolfin that something needs to be considered here, but I don't understand GAP's type system quite well enough to figure out what is going on.

It seems to me if there is an issue with the parent type getting out of date, the same problem would occur (perhaps) just generally, once you have made a type with a particular parent, and then the parent gets updated later -- but that might be a different type of issue.

@ChrisJefferson
Copy link
Contributor

I just tried checking if the parents do always turn out to be the same, and they don't. The sensible thing to do (under the problem that I don't 100% know what's going on) is to add a parent check to the caching. This slightly increases cache misses (from 54 to 67).

@ChrisJefferson
Copy link
Contributor

Now in #295

@fingolfin fingolfin added the topic: HPC-GAP Issues and PRs related to HPC-GAP label Oct 30, 2015
This was referenced Oct 30, 2015
@fingolfin
Copy link
Member

I believe this PR should be closed in favor of my PE #326. Thoughts?

@markuspf
Copy link
Member Author

This is obsoleted by #326

@markuspf markuspf closed this Dec 18, 2015
@markuspf markuspf deleted the hpcgap-avoid-newtype-readonly branch February 5, 2017 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: HPC-GAP Issues and PRs related to HPC-GAP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants