-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add sorted_iter_mut for NonstandardWitSection.adapters for determinism #3851
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we instead introduce a sorted_iter_mut()
?
I've never looked at this part of the code, but the way ordered iteration is done is kinda awful. Apart from a proper fix to all these cases I would prefer to stick with the current implementation.
d6e66a9
to
7078c80
Compare
I've updated this to add a new |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies, forgot to mention the changelog, could you add an entry there considering that this change might actually be relevant for users?
Otherwise LGTM.
In the `externref` code, we call `export_xform` while iterating over `adapters` with `iter_mut`. Calling `export_xform` can result in shims, with the id depending on the order in which we iterate over the exports. To make the final .wasm output deterministic, I've changed this to use a new `sorted_iter_mut` method (based on `sorted_iter`).
7078c80
to
1cf8f92
Compare
I updated the changelog |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Is there a plan, or estimation, on when |
I will try to make a new release at the end of the week. |
In the
externref
code, we callexport_xform
while iterating overadapters
withiter_mut
. Callingexport_xform
can result in shims, with the id depending on the order in which we iterate over the exports.This makes the .wasm output deterministic when using
--reference-types