RPython hashes no longer preserved across translation

Hi all, I would like to merge the branch "rpython-hash". That branch drops the RPython requirement that hashes (notably of prebuilt instances) don't change across translation. By dropping it, I could remove some cruft at various places, and it makes the life a bit easier for other systems like STM, too. The motivation is that in py3.5 we're considering the hash randomization feature again, for strings. This feature is not compatible at all with the idea that hashes should not change. So with "rpython-hash" it should be possible, at translation-time, to choose the algorithm used by CPython 3.5 (siphash-2-4), and moreover with an optional seed at runtime. The main place that relied on the hashes not changing is prebuilt dictionaries. That branch fixes them by not including the "indexes" part at all during translation, and rebuilding the index on the first usage. There were only three places I found in PyPy that relied on this feature: weakrefs caching the hash of their referent; frozensets caching their own hash; and a detail inside _cffi_backend. All places needed fixing, but that was easy. I think it's a good move and a small simplification of RPython internals. Of course it might break other RPython-based interpreters out there. Any feedback about that would be appreciated. A bientôt, Armin.
participants (2)
-
Armin Rigo
-
Carl Friedrich Bolz