Change 'incompletely specified behavior' phrasing to 'limited local nondeterminism' by lukewagner · Pull Request #141 · WebAssembly/design (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation39 Commits9 Checks0 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

lukewagner

@lukewagner

kripken

WebAssembly is a [portable](Portability.md) sandboxed platform with limited,
local, nondeterminism.
* *limited* : non-deterministic execution can only occur in a small number of

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apologies for an unimportant question, but was the space before : intentional here? (it would feel natural for me to not have it there, but maybe it's a style I'm not familiar with)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, it'd look better w/o space before.

@lukewagner

kripken

[Control Flow Integrity](http://research.microsoft.com/apps/pubs/default.aspx?id=64250).
* WebAssembly has no [nasal demons](https://en.wikipedia.org/w/index.php?title=Nasal\_demons).
Ideally, WebAssembly would be fully deterministic. Nondeterminism is only

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another probably unimportant note, it might be better to avoid saying "fully deterministic" because in a more general sense, there is or will be nondeterminism in wasm - stuff like calling a random number generator. Very nitpicky of course, as your intention is clear, so feel free to ignore.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha, good point, I forgot about random. I can reword.

@lukewagner

@sunfishcode

jfbastien

Ideally, WebAssembly would be fully deterministic (except where nondeterminism
was introduced by the API, like `random` or input events). Nondeterminism is only
specified as a compromise when there is no other practical way to achieve
[portable](Portability.md), near-native performance.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drop "near-"? We want native performance!

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think "near-" is an acknowledgement that we are sandboxed and that we are providing a portability abstraction that discards certain unappetizing-but-nonetheless-expedient implementation details, and until we get hardware support there's always going to be some overhead. But ultimately it's a question of taste here.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this is just the conservative "don't overpromise" engineer in me, but "native" is probably fine here, so I'll take out "near-".

@lukewagner

jfbastien

- [Fixed-width SIMD may want some flexibility](EssentialPostMVPFeatures.md#fixed-width-simd)
- In SIMD.js, floating point values may or may not have subnormals flushed to zero.
- In SIMD.js, operations ending in "Approximation" return approximations that may vary between platforms.
- Environment-dependent resource limits may be exhausted

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing period.

@jfbastien

lgtm after nit, and assuming you move the race/data stuff to another PR.

@lukewagner

@lukewagner

Pulling this now-hidden note into the main discussion:

So as @jfbastien pointed out, there are two levels of non-determinism here:

  1. the non-seq-cst you get if you have a data race
  2. even with seq-cst, it's still non-deterministic

and 2 isn't really called out, so I think a further update is necessary.

@lukewagner

@lukewagner

@jfbastien

@lukewagner

sunfishcode

- [When threads are added as a feature](EssentialPostMVPFeatures.md#threads),
even without shared memory, nondeterminism will be visible through the
ordering of API calls. Shared memory will allow further nondeterminism via

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if this is too pedantic, but it's also visible between API calls and WebAssembly program termination.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True true, we must never forget termination.

@sunfishcode

@lukewagner

…ename-incompletely-specified-behavior

@lukewagner

…on nondeterminism of load

@lukewagner

How about this? I couldn't think of how non-termination was visible except through APIs (like postMessage and onmessage).

@lukewagner

@sunfishcode

lukewagner added a commit that referenced this pull request

Jun 11, 2015

@lukewagner

…d-behavior

Change 'incompletely specified behavior' phrasing to 'limited local nondeterminism'

@lukewagner lukewagner deleted the rename-incompletely-specified-behavior branch

June 11, 2015 20:47