Stream: git-wasmtime

Topic: wasmtime / PR #5535 Treat `wasmtime::component::Val::Floa...


view this post on Zulip Wasmtime GitHub notifications bot (Jan 05 2023 at 21:56):

lann opened PR #5535 from val-float-nan-equality to main:

In #5510 we changed the value types of these variants from u{32,64} to f{32,64}. One side effect of this change was that two NaN values would no longer compare equal. While this is behavior complies with IEEE-754 floating point operations, it broke equality assumptions in fuzzing.

This commit changes equality for Val to make NaNs compare equal. Since the component model requires NaN canonicalization, all NaN bit representations compare equal, which is different from the original behavior.

This also gives Vals the semantics of Eq again, so that trait impl has been reintroduced to related types as well.

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Jan 05 2023 at 22:00):

lann updated PR #5535 from val-float-nan-equality to main.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 05 2023 at 22:01):

lann edited PR #5535 from val-float-nan-equality to main:

In #5510 we changed the value types of these variants from u{32,64} to f{32,64}. One side effect of this change was that two NaN values would no longer compare equal. While this is behavior complies with IEEE-754 floating point operations, it broke equality assumptions in fuzzing.

This commit changes equality for Val to make NaNs compare equal. Since the component model requires NaN canonicalization, all NaN bit representations compare equal, which is different from the original behavior.

This also gives Vals the semantics of Eq again, so that trait impl has been reintroduced to related types as well.

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Jan 06 2023 at 14:11):

lann updated PR #5535 from val-float-nan-equality to main.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 06 2023 at 16:40):

alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 06 2023 at 16:40):

alexcrichton merged PR #5535.


Last updated: Dec 23 2024 at 12:05 UTC