-
-
Notifications
You must be signed in to change notification settings - Fork 481
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
Rename change the hash value of some objects #8119
Comments
comment:1
For immutable objects, like Parents, the default
|
Attachment: 8119-parent-hash.patch.gz |
comment:2
This is a partial fix (that won't work for SageObject in general, unless we enforce that mutable objects maintain their own hash, and I don't think we want to put an extra field on all Elements), but resolves the most important case. It's also a performance gain. |
comment:3
Hi Robert, I've one question related to this and I like to have the confirmation from an expert. After your patch, upon pickling/unpickling the hash value can change because it is not pickled and neither is the name, right ? As far as I manage to test this is not harmful to pickle a dict containing a renamed parent. Indeed, trying to read If this is not both this patch and #8120 are broken. Also, after this, do you still need #8506 ? Florent |
comment:4
Replying to @hivert:
That is correct. Hashes in general are not guaranteed to be consistent from run to run, all that really matters is that they satisfy (to the best they can) the equality constraints.
Yes, #8506 is still important--in my case I'm reducing a curve mod many, many primes, doing just a bit of stuff on each before throwing them away. I suppose eventually caching the hash value would eventually be a win, but that's a separate optimization. |
comment:6
hivert: do you want to review this ticket? |
comment:7
Sure ! I completely forgot about this one. Sorry ! They are a few place where we should remove the bad implementation using
I don't have time to do it right now. I'll do it soon if you don't beat me. |
Reviewer: Florent Hivert |
comment:8
I just added a review patch which removes the wrong hash methods. Please review. I'm ok with the original patch, so if my review patch is ok |
This comment has been minimized.
This comment has been minimized.
comment:9
Attachment: 8119-parent-hash-review.patch.gz Florent's review patch looks good. However Cheers, |
Author: Robert Bradshaw |
Changed reviewer from Florent Hivert to Florent Hivert, Nicolas M. Thiéry |
comment:10
Attachment: 8119-parent-hash.2.patch.gz Fixed the typo, I don't think the issue with sparse PolynomialRing #11231 should hold this ticket up any longer (it's had a patch sitting on it for over a year...) |
This comment has been minimized.
This comment has been minimized.
comment:11
I'm assuming the "apply" should be changed... |
comment:18
Apply 8119-parent-hash-final.patch Granted, the patchbot doesn't bother testing positively reviewed tickets (not that anything it's concerned with changed). Thanks for getting to this for me. |
comment:19
Some of these doctests should be differentiated on 32-bit systems (in particular, all the results of |
Work Issues: fix on 32-bit |
comment:20
bump |
This comment has been minimized.
This comment has been minimized.
Changed work issues from fix on 32-bit to none |
Changed reviewer from Florent Hivert, Nicolas M. Thiéry to Florent Hivert, Nicolas M. Thiéry, Nicolas Borie |
comment:23
On boxen (Linux x86_64), I get:
|
comment:24
Attachment: 8119-parent-hash-final-fix32.patch.gz Replying to @jdemeyer:
Weird, I get here the same result as you on boxen, both with 4.8 and 5.0.beta8. I don't know how a wrong return value ended up in the patch. Oh well, I updated the patch to expect the result obtained on boxen. |
comment:26
Apply 8119-parent-hash-final-fix32.patch (for patchbot) |
Attachment: 8119-parent-hash-final.patch.gz |
This comment has been minimized.
This comment has been minimized.
comment:28
Hi there, I'm setting a positive review here but I uploaded a new patch removing a Florent |
comment:29
Thanks for the final review! |
Merged: sage-5.0.rc0 |
For many objects the hash value is computed from
__repr__
. This is a bad idea since renaming the object change its hash value.Apply Only:
CC: @jasongrout @simon-king-jena
Component: misc
Author: Robert Bradshaw
Reviewer: Florent Hivert, Nicolas M. Thiéry, Nicolas Borie
Merged: sage-5.0.rc0
Issue created by migration from https://trac.sagemath.org/ticket/8119
The text was updated successfully, but these errors were encountered: