alexcrichton opened PR #3229 from deterministic
to main
:
Currently wasmtime's compilation artifacts are not deterministic due to
the usage ofHashMap
during serialization which has randomized order
of its elements. This commit fixes that by switching to a sorted
BTreeMap
for various maps. A test is also added to ensure determinism.If in the future the performance of
BTreeMap
is not as good as
HashMap
for some of these cases we can implement a fancier
serialize_with
-style solution where we sort keys during serialization,
but only during serialization and otherwise use aHashMap
.<!--
Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
peterhuene submitted PR review.
alexcrichton updated PR #3229 from deterministic
to main
.
alexcrichton updated PR #3229 from deterministic
to main
.
alexcrichton merged PR #3229.
Last updated: Nov 22 2024 at 17:03 UTC