Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Issue 2671803002: [wasm] Refactor the non-determinism detection in the interpreter. (Closed)

Created:
3 years, 10 months ago by ahaas
Modified:
3 years, 10 months ago
Reviewers:
Eric Holk, titzer
CC:
v8-reviews_googlegroups.com
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[wasm] Refactor the non-determinism detection in the interpreter. Apparently it happens quite easily that different NaNs are produced in the interpreter than in the execution of the compiled code. This non-determinism caused problems for the fuzzer which compares the equality of the results of the interpreter and the compiled code. I decided therefore to refactor the detection of non-determinism in the interpreter. Instead of tracking whether potentially non-deterministic NaNs were produced, I track now whether potentially non-deterministic NaNs could have been observed. The only way the NaN non-determinism can be observed is by observing the non-deterministic bit pattern of the NaN. AFAICT the only way to observe the bit pattern is with a I(32|64)_REINTERPRET_F(32|64) instruction or with a F(32|64)_STORE followed by a load. Therefore I flag an execution as potentially non-deterministic when either a NaN is reinterpreted to an int, or when a NaN is stored to memory. R=titzer@chromium.org, eholk@chromium.org BUG=682180 Review-Url: https://codereview.chromium.org/2671803002 Cr-Commit-Position: refs/heads/master@{#42917} Committed: https://chromium.googlesource.com/v8/v8/+/ac187c03230980c4bb8950851d8f2bbda78d3cd2

Patch Set 1 #

Total comments: 6

Patch Set 2 : Also adjust copysign #

Unified diffs Side-by-side diffs Delta from patch set Stats (+119 lines, -99 lines) Patch
M src/wasm/wasm-interpreter.cc View 1 11 chunks +87 lines, -69 lines 0 comments Download
M test/cctest/wasm/test-run-wasm-interpreter.cc View 1 1 chunk +32 lines, -30 lines 0 comments Download

Messages

Total messages: 18 (12 generated)
ahaas
3 years, 10 months ago (2017-02-02 20:16:38 UTC) #1
Eric Holk
lgtm Somehow I suspect the fuzzer will still be clever enough to defeat this, but ...
3 years, 10 months ago (2017-02-03 03:11:27 UTC) #6
ahaas
PTAL. Also the copysign instructions allow you to observe the non-determinism of NaNs. https://codereview.chromium.org/2671803002/diff/1/test/cctest/wasm/test-run-wasm-interpreter.cc File ...
3 years, 10 months ago (2017-02-03 09:16:06 UTC) #9
titzer
lgtm https://codereview.chromium.org/2671803002/diff/1/test/cctest/wasm/test-run-wasm-interpreter.cc File test/cctest/wasm/test-run-wasm-interpreter.cc (left): https://codereview.chromium.org/2671803002/diff/1/test/cctest/wasm/test-run-wasm-interpreter.cc#oldcode384 test/cctest/wasm/test-run-wasm-interpreter.cc:384: BUILD(r, WASM_F64_SQRT(WASM_GET_LOCAL(0))); On 2017/02/03 09:16:06, ahaas wrote: > ...
3 years, 10 months ago (2017-02-03 09:48:05 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2671803002/20001
3 years, 10 months ago (2017-02-03 09:49:28 UTC) #15
commit-bot: I haz the power
3 years, 10 months ago (2017-02-03 09:51:13 UTC) #18
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as
https://chromium.googlesource.com/v8/v8/+/ac187c03230980c4bb8950851d8f2bbda78...

Powered by Google App Engine
This is Rietveld 408576698