-
Notifications
You must be signed in to change notification settings - Fork 267
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
suspected bug: different results on x86 vs apple arm #2360
Comments
Do you have source for the Wasm? Also, even if you don't have source for the Wasm, some minimal Go code to load the blob and show the difference would be helpful (obviously, the larger the blob, the worst that is). A repo (or a gist) with a MCVE is always helpful. Also, how was the Wasm compiled? Does it use SIMD? Is it possible the difference is in SIMD code? In terms of assurances of the output being equal, I'm reasonably sure it should be equal, if it's using IEEE 754 floats. I'm less sure if it is using SIMD. |
Also one thing to keep in mind is NaN isn't deterministic in Wasm. https://github.com/WebAssembly/design/blob/main/Nondeterminism.md Not sure but found that perhaps it is being used in the test case. Would be good to confirm it (though I would be surprised if Wasmer handled them more deterministically than Wazero). https://github.com/CosmWasm/cosmwasm/blob/main/contracts/floaty/src/floats.rs#L27 If NaN is indeed an issue, one approach could be to check the result |
@faddat if this is indeed an issue, it's something we'd want to fix. But we need more info/help. |
yep, floating point is non deterministic and it's clearly documented in the spec (and each CPU has different behavior as it's undefined!) - unless you give us the real repro which doesn't involve NaN or Inf, i am closing |
Ok, thank you all for your feedback! I have been afk for a few days, and I'll poke around and come back. |
#2365 should not change anything, unless (again) there is a If you have a discrepancy to report, between interpreter and compiler or across platforms, please do so. But it should be (as much as possible) a reduced test case, which is not supposed to be non-deterministic or unspecified to begin with. |
This is the same floating point math test. The only difference is that it is being run on an ubuntu instance and on an M1.
Ubuntu fails because I used the result from my m1.
https://github.com/CosmWasm/wasmvm/actions/runs/12732434887/job/35487631744?pr=582
https://github.com/CosmWasm/wasmvm/actions/runs/12732434887/job/35487631959?pr=582
My understanding is that the output should be exactly the same, regardless of platform. Is that correct?
The text was updated successfully, but these errors were encountered: