Open pchiusano opened 2 years ago
@ceedubs and @stew can provide some color on this.
Having this is going to give us more confidence when merging stuff like #3377
Ideas we discussed:
hash
builtin, so we know if hashing code ever changesUniversal.==
to the originalsdebug.permute-code-cache
command, just use this within the transcript. Involves some munging of runtime state.Value.(de)serializeSelfContained
which serializes a value and all its Code
dependencies (transitive). Just do this for a bunch of values, store them in git. Then have a io.test
that picks a random permutation of those files and deserializes them all and has the same the hash.
We want to make sure a whole bunch of values round trip successfully, and also test the situation where the "sender" code cache is in a different state than the "receiver" code cache.
Suggestion: have some golden files of serialized stuff, which is checked in, make sure we can deserialize them.
Suggestion: have the golden file be generated from a Unison transcript that calls
Value.serialize
, that way we will notice if the serialization format ever accidentally changes.